Remove convenience constructors for TextRun
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 17:18:00 +0000 (17:18 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 17:18:00 +0000 (17:18 +0000)
commit5aa5c4a425990e30a4aa2d60bc81ba458ee504ec
treef70e35e9f92ba73ed0d84a864af180dbeee79171
parent14e67951f5ca4d535fb79ff5c0111c10eb641eba
Remove convenience constructors for TextRun
https://bugs.webkit.org/show_bug.cgi?id=144752

Source/WebCore:

These convenience constructors are unnecessary. Moving the code that makes the StringView
back to the call site will also help us make things more elegant in future refactoring.

Reviewed by Darin Adler.

No new tests because there is no behavior change.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
* platform/graphics/StringTruncator.cpp:
(WebCore::stringWidth):
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
* platform/mac/DragImageMac.mm:
(WebCore::widthWithFont):
(WebCore::drawAtPoint):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintText):

Source/WebKit/mac:

These convenience constructors are unnecessary. Moving the code that makes the StringView
back to the call site will also help us make things more elegant in future refactoring.

Reviewed by Darin Adler.

No new tests because there is no behavior change.

* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]):
(-[NSString _web_widthWithFont:]):

Source/WTF:

Reviewed by Anders Carlsson.

No reason why StringView shouldn't have a StringImpl* constructor.

Test: StringView8Bit in TestWebKitAPI

* wtf/text/StringView.h: Add the constructor.

Tools:

Reviewed by Anders Carlsson.

Test the StringView which takes a StringImpl*.

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(StringView8Bit): Testing is8Bit() on StringView

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringView.h
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/platform/graphics/StringTruncator.cpp
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp
Source/WebCore/rendering/TextPainter.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/StringView.cpp