Diff
Modified: trunk/LayoutTests/ChangeLog (195179 => 195180)
--- trunk/LayoutTests/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/ChangeLog 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,3 +1,19 @@
+2016-01-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove TextRun::allowsRoundingHacks()
+ https://bugs.webkit.org/show_bug.cgi?id=153185
+
+ Reviewed by Simon Fraser.
+
+ * platform/mac/fast/text/rounding-hacks-expansion.html: Removed.
+ * platform/mac/fast/text/rounding-hacks.html: Removed.
+ * platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.png: Removed.
+ * platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.txt: Removed.
+ * platform/mac/platform/mac/fast/text/rounding-hacks-expected.png: Removed.
+ * platform/mac/platform/mac/fast/text/rounding-hacks-expected.txt: Removed.
+ * svg/text/svg-font-word-rounding-hacks-spaces-expected.html: Removed.
+ * svg/text/svg-font-word-rounding-hacks-spaces.html: Removed.
+
2016-01-16 Skachkov Oleksandr <gskach...@gmail.com>
[ES6] Arrow function syntax. Arrow function should support the destructuring parameters.
Deleted: trunk/LayoutTests/platform/mac/fast/text/rounding-hacks-expansion.html (195179 => 195180)
--- trunk/LayoutTests/platform/mac/fast/text/rounding-hacks-expansion.html 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/platform/mac/fast/text/rounding-hacks-expansion.html 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,17 +0,0 @@
-<script>
- if (window.internals)
- internals.allowRoundingHacks();
-</script>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
-<div style="text-rendering: optimizelegibility; border: solid cyan; font: 16px 'lucida grande'; text-align: justify; width: 300px;">Given an opportunity to make a mistake</div>
Deleted: trunk/LayoutTests/platform/mac/fast/text/rounding-hacks.html (195179 => 195180)
--- trunk/LayoutTests/platform/mac/fast/text/rounding-hacks.html 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/platform/mac/fast/text/rounding-hacks.html 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,21 +0,0 @@
-<script>
- if (window.internals)
- internals.allowRoundingHacks();
-</script>
-<div style="font-family: 'lucida grande'; font-size: 22px;">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent
- ullamcorper accumsan hendrerit. Phasellus bibendum fringilla
- sollicitudin. Donec blandit rutrum neque eget euismod. Nullam nec
- felis turpis, vitae tempor enim. Aenean venenatis blandit dui
- vel ultrices. Donec porta nunc ut nibh adipiscing id suscipit
-</div>
-<div style="font-family: 'lucida grande'; font-size: 18px;">
- dolor facilisis. Vestibulum vitae enim vitae dolor sollicitudin
- imperdiet sit amet ac tortor. Quisque egestas adipiscing volutpat.
- Proin eu nibh eros, quis luctus urna. Sed tincidunt iaculis tempor.
- Vestibulum dapibus lorem sit amet libero
- pharetra at sodales nisi pulvinar. Morbi eu risus lectus, id scelerisque
- neque. Aenean eget mauris nulla. Nunc egestas elit nec lorem fermentum
- mattis. Sed adipiscing metus nec diam congue at ornare sapien faucibus.
- Vestibulum varius tempor quam sed malesuada. Sed vitae quam nulla.
-</div>
Deleted: trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.txt (195179 => 195180)
--- trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.txt 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expansion-expected.txt 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,57 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,42) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,84) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,126) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,168) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,210) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,252) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,294) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,336) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,378) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,420) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,462) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
- RenderBlock {DIV} at (0,504) size 306x42 [border: (3px solid #00FFFF)]
- RenderText {#text} at (3,3) size 300x36
- text run at (3,3) width 300: "Given an opportunity to make a"
- text run at (3,21) width 61: "mistake"
Deleted: trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expected.txt (195179 => 195180)
--- trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expected.txt 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/platform/mac/platform/mac/fast/text/rounding-hacks-expected.txt 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,38 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 784x130
- RenderText {#text} at (0,0) size 777x130
- text run at (0,0) width 313: "Lorem ipsum dolor sit amet, "
- text run at (313,0) width 387: "consectetur adipiscing elit. Praesent"
- text run at (0,26) width 468: "ullamcorper accumsan hendrerit. Phasellus "
- text run at (468,26) width 199: "bibendum fringilla"
- text run at (0,52) width 604: "sollicitudin. Donec blandit rutrum neque eget euismod. "
- text run at (604,52) width 128: "Nullam nec "
- text run at (732,52) width 45: "felis"
- text run at (0,78) width 606: "turpis, vitae tempor enim. Aenean venenatis blandit dui "
- text run at (606,78) width 124: "vel ultrices."
- text run at (0,104) width 283: "Donec porta nunc ut nibh "
- text run at (283,104) width 227: "adipiscing id suscipit"
- RenderBlock {DIV} at (0,130) size 784x147
- RenderText {#text} at (0,0) size 766x147
- text run at (0,0) width 434: "dolor facilisis. Vestibulum vitae enim vitae dolor "
- text run at (434,0) width 102: "sollicitudin "
- text run at (536,0) width 189: "imperdiet sit amet ac"
- text run at (0,21) width 394: "tortor. Quisque egestas adipiscing volutpat. "
- text run at (394,21) width 360: "Proin eu nibh eros, quis luctus urna. Sed"
- text run at (0,42) width 146: "tincidunt iaculis "
- text run at (146,42) width 76: "tempor. "
- text run at (222,42) width 373: "Vestibulum dapibus lorem sit amet libero "
- text run at (595,42) width 169: "pharetra at sodales"
- text run at (0,63) width 318: "nisi pulvinar. Morbi eu risus lectus, "
- text run at (318,63) width 127: "id scelerisque "
- text run at (445,63) width 297: "neque. Aenean eget mauris nulla."
- text run at (0,84) width 355: "Nunc egestas elit nec lorem fermentum "
- text run at (355,84) width 411: "mattis. Sed adipiscing metus nec diam congue"
- text run at (0,105) width 235: "at ornare sapien faucibus. "
- text run at (235,105) width 433: "Vestibulum varius tempor quam sed malesuada. "
- text run at (668,105) width 80: "Sed vitae"
- text run at (0,126) width 105: "quam nulla."
Deleted: trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces-expected.html (195179 => 195180)
--- trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces-expected.html 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces-expected.html 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.blackbox {
- display: inline-block;
- width: 14px;
- height: 21px;
- background: black;
-}
-.whitebox {
- display: inline-block;
- width: 14px;
- height: 21px;
- background: white;
-}
-</style>
-</head>
-<body>
-<div style="display: none;">This test makes sure that text drawn with an SVG font with word-wrapping hacks has spaces.
-The test is successful if the space between the two boxes below is the same as the width of each of the boxes.</div>
-<div><div class="blackbox"></div><div class="whitebox"></div><div class="blackbox"></div></div>
-</body>
-</html>
Deleted: trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces.html (195179 => 195180)
--- trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces.html 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces.html 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-@font-face {
- font-family: 'Litherum';
- src: url("resources/Litherum.svg") format(svg)
-}
-</style>
-<script>
-if (window.internals)
- window.internals.allowRoundingHacks();
-</script>
-</head>
-<body>
-<div style="display: none;">This test makes sure that text drawn with an SVG font with word-wrapping hacks has spaces.
-The test is successful if the space between the two boxes below is the same as the width of each of the boxes.</div>
-<div style="font: 14px Litherum;">a a</div>
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (195179 => 195180)
--- trunk/Source/WebCore/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/ChangeLog 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,3 +1,68 @@
+2016-01-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove TextRun::allowsRoundingHacks()
+ https://bugs.webkit.org/show_bug.cgi?id=153185
+
+ Reviewed by Simon Fraser.
+
+ Rounding hacks are disallowed by default, and are only re-enabled on iOS 4 and
+ earlier, which are not supported OSes. Because they are disallowed on all
+ supported configurations, remove support for them wholesale.
+
+ No new tests.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::drawTextInternal):
+ * platform/graphics/FontCascade.cpp:
+ * platform/graphics/FontCascade.h:
+ (WebCore::FontCascade::isRoundingHackCharacter): Deleted.
+ * platform/graphics/StringTruncator.cpp:
+ (WebCore::stringWidth):
+ (WebCore::truncateString):
+ (WebCore::StringTruncator::centerTruncate):
+ (WebCore::StringTruncator::rightTruncate):
+ (WebCore::StringTruncator::width):
+ (WebCore::StringTruncator::leftTruncate):
+ (WebCore::StringTruncator::rightClipToCharacter):
+ (WebCore::StringTruncator::rightClipToWord):
+ * platform/graphics/StringTruncator.h:
+ * platform/graphics/TextRun.cpp:
+ (WebCore::TextRun::setAllowsRoundingHacks): Deleted.
+ (WebCore::TextRun::allowsRoundingHacks): Deleted.
+ * platform/graphics/TextRun.h:
+ (WebCore::TextRun::TextRun):
+ (WebCore::TextRun::applyRunRounding): Deleted.
+ (WebCore::TextRun::applyWordRounding): Deleted.
+ (WebCore::TextRun::disableRoundingHacks): Deleted.
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advanceInternal):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+ * platform/mac/DragImageMac.mm:
+ (WebCore::widthWithFont): Deleted.
+ (WebCore::drawAtPoint): Deleted.
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::fileTextValue):
+ (WebCore::RenderFileUploadControl::paintObject): Deleted.
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::paintItemForeground):
+ (WebCore::RenderListBox::updateFromElement): Deleted.
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::getAverageCharWidth): Deleted.
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::fileListNameForWidth):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::fileListNameForWidth):
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
+ * rendering/svg/SVGTextMetrics.cpp:
+ (WebCore::SVGTextMetrics::constructTextRun): Deleted.
+ * testing/Internals.cpp:
+ (WebCore::Internals::resetToConsistentState): Deleted.
+ (WebCore::Internals::allowRoundingHacks): Deleted.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2016-01-16 Andreas Kling <akl...@apple.com>
Allocate style sheet media queries in BumpArena.
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (195179 => 195180)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -2362,7 +2362,7 @@
bool isRTL = direction == RTL;
bool override = computedStyle ? isOverride(computedStyle->unicodeBidi()) : false;
- TextRun textRun(normalizedText, 0, 0, AllowTrailingExpansion, direction, override, true, TextRun::NoRounding);
+ TextRun textRun(normalizedText, 0, 0, AllowTrailingExpansion, direction, override, true);
// Draw the item text at the correct point.
FloatPoint location(x, y);
switch (state().textBaseline) {
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -46,17 +46,6 @@
static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontCascadeDescription&, RefPtr<FontSelector>&&);
-const uint8_t FontCascade::s_roundingHackCharacterTable[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1 /*no-break space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
static bool isDrawnWithSVGFont(const TextRun& run)
{
return run.renderingContext();
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/FontCascade.h 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h 2016-01-17 04:54:32 UTC (rev 195180)
@@ -265,12 +265,6 @@
static CodePath codePath();
static CodePath s_codePath;
- static const uint8_t s_roundingHackCharacterTable[256];
- static bool isRoundingHackCharacter(UChar32 c)
- {
- return !(c & ~0xFF) && s_roundingHackCharacterTable[c];
- }
-
FontSelector* fontSelector() const;
static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; }
static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; }
Modified: trunk/Source/WebCore/platform/graphics/StringTruncator.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/StringTruncator.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/StringTruncator.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -192,15 +192,13 @@
return length - adjustedStartIndex;
}
-static float stringWidth(const FontCascade& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
+static float stringWidth(const FontCascade& renderer, const UChar* characters, unsigned length)
{
TextRun run(StringView(characters, length));
- if (disableRoundingHacks)
- run.disableRoundingHacks();
return renderer.width(run);
}
-static String truncateString(const String& string, float maxWidth, const FontCascade& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks, float* resultWidth = nullptr, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false)
+static String truncateString(const String& string, float maxWidth, const FontCascade& font, TruncationFunction truncateToBuffer, float* resultWidth = nullptr, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false)
{
if (string.isEmpty())
return string;
@@ -210,7 +208,7 @@
ASSERT(maxWidth >= 0);
- float currentEllipsisWidth = shouldInsertEllipsis ? stringWidth(font, &horizontalEllipsis, 1, disableRoundingHacks) : customTruncationElementWidth;
+ float currentEllipsisWidth = shouldInsertEllipsis ? stringWidth(font, &horizontalEllipsis, 1) : customTruncationElementWidth;
UChar stringBuffer[STRING_BUFFER_SIZE];
unsigned truncatedLength;
@@ -229,7 +227,7 @@
truncatedLength = length;
}
- float width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
+ float width = stringWidth(font, stringBuffer, truncatedLength);
if (!shouldInsertEllipsis && alwaysTruncate)
width += customTruncationElementWidth;
if ((width - maxWidth) < 0.0001) { // Ignore rounding errors.
@@ -269,7 +267,7 @@
truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
- width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
+ width = stringWidth(font, stringBuffer, truncatedLength);
if (!shouldInsertEllipsis)
width += customTruncationElementWidth;
if (width <= maxWidth) {
@@ -295,44 +293,44 @@
return String(stringBuffer, truncatedLength);
}
-String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
+String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font)
{
- return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks);
+ return truncateString(string, maxWidth, font, centerTruncateToBuffer);
}
-String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
+String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font)
{
- return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks);
+ return truncateString(string, maxWidth, font, rightTruncateToBuffer);
}
-float StringTruncator::width(const String& string, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
+float StringTruncator::width(const String& string, const FontCascade& font)
{
- return stringWidth(font, StringView(string).upconvertedCharacters(), string.length(), !enableRoundingHacks);
+ return stringWidth(font, StringView(string).upconvertedCharacters(), string.length());
}
-String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
{
- return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+ return truncateString(string, maxWidth, font, centerTruncateToBuffer, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
}
-String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
{
- return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+ return truncateString(string, maxWidth, font, rightTruncateToBuffer, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
}
-String StringTruncator::leftTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+String StringTruncator::leftTruncate(const String& string, float maxWidth, const FontCascade& font, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
{
- return truncateString(string, maxWidth, font, leftTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+ return truncateString(string, maxWidth, font, leftTruncateToBuffer, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
}
-String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const FontCascade& font, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
{
- return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+ return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
}
-String StringTruncator::rightClipToWord(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth, bool alwaysTruncate)
+String StringTruncator::rightClipToWord(const String& string, float maxWidth, const FontCascade& font, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth, bool alwaysTruncate)
{
- return truncateString(string, maxWidth, font, rightClipToWordBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate);
+ return truncateString(string, maxWidth, font, rightClipToWordBuffer, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/StringTruncator.h (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/StringTruncator.h 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/StringTruncator.h 2016-01-17 04:54:32 UTC (rev 195180)
@@ -37,18 +37,16 @@
class StringTruncator {
public:
- enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks };
+ WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&);
+ WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&);
- WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
- WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
+ WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+ WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+ WEBCORE_EXPORT static String leftTruncate(const String&, float maxWidth, const FontCascade&, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+ WEBCORE_EXPORT static String rightClipToCharacter(const String&, float maxWidth, const FontCascade&, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+ WEBCORE_EXPORT static String rightClipToWord(const String&, float maxWidth, const FontCascade&, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false);
- WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
- WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
- WEBCORE_EXPORT static String leftTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
- WEBCORE_EXPORT static String rightClipToCharacter(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
- WEBCORE_EXPORT static String rightClipToWord(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false);
-
- WEBCORE_EXPORT static float width(const String&, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
+ WEBCORE_EXPORT static float width(const String&, const FontCascade&);
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/TextRun.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/TextRun.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/TextRun.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -41,16 +41,4 @@
COMPILE_ASSERT(sizeof(TextRun) == sizeof(ExpectedTextRunSize), TextRun_is_not_of_expected_size);
-bool TextRun::s_allowsRoundingHacks = false;
-
-void TextRun::setAllowsRoundingHacks(bool allowsRoundingHacks)
-{
- s_allowsRoundingHacks = allowsRoundingHacks;
}
-
-bool TextRun::allowsRoundingHacks()
-{
- return s_allowsRoundingHacks;
-}
-
-}
Modified: trunk/Source/WebCore/platform/graphics/TextRun.h (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/TextRun.h 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/TextRun.h 2016-01-17 04:54:32 UTC (rev 195180)
@@ -45,15 +45,7 @@
class TextRun {
WTF_MAKE_FAST_ALLOCATED;
public:
- enum RoundingHackFlags {
- NoRounding = 0,
- RunRounding = 1 << 0,
- WordRounding = 1 << 1,
- };
-
- typedef unsigned RoundingHacks;
-
- explicit TextRun(StringView text, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)
+ explicit TextRun(StringView text, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true)
: m_text(text)
, m_charactersLength(text.length())
, m_tabSize(0)
@@ -65,8 +57,6 @@
, m_direction(direction)
, m_directionalOverride(directionalOverride)
, m_characterScanForCodePath(characterScanForCodePath)
- , m_applyRunRounding((roundingHacks & RunRounding) && s_allowsRoundingHacks)
- , m_applyWordRounding((roundingHacks & WordRounding) && s_allowsRoundingHacks)
, m_disableSpacing(false)
{
}
@@ -118,12 +108,9 @@
bool ltr() const { return m_direction == LTR; }
bool directionalOverride() const { return m_directionalOverride; }
bool characterScanForCodePath() const { return m_characterScanForCodePath; }
- bool applyRunRounding() const { return m_applyRunRounding; }
- bool applyWordRounding() const { return m_applyWordRounding; }
bool spacingDisabled() const { return m_disableSpacing; }
void disableSpacing() { m_disableSpacing = true; }
- void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
void setDirection(TextDirection direction) { m_direction = direction; }
void setDirectionalOverride(bool override) { m_directionalOverride = override; }
void setCharacterScanForCodePath(bool scan) { m_characterScanForCodePath = scan; }
@@ -145,12 +132,7 @@
RenderingContext* renderingContext() const { return m_renderingContext.get(); }
void setRenderingContext(PassRefPtr<RenderingContext> context) { m_renderingContext = context; }
- WEBCORE_EXPORT static void setAllowsRoundingHacks(bool);
- WEBCORE_EXPORT static bool allowsRoundingHacks();
-
private:
- WEBCORE_EXPORT static bool s_allowsRoundingHacks;
-
RefPtr<RenderingContext> m_renderingContext;
StringView m_text;
@@ -171,8 +153,6 @@
unsigned m_direction : 1;
unsigned m_directionalOverride : 1; // Was this direction set by an override character.
unsigned m_characterScanForCodePath : 1;
- unsigned m_applyRunRounding : 1;
- unsigned m_applyWordRounding : 1;
unsigned m_disableSpacing : 1;
};
Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -237,13 +237,6 @@
// SVG uses horizontalGlyphStretch(), when textLength is used to stretch/squeeze text.
width *= m_run.horizontalGlyphStretch();
-
- // We special case spaces in two ways when applying word rounding.
- // First, we round spaces to an adjusted width in all fonts.
- // Second, in fixed-pitch fonts we ensure that all characters that
- // match the width of the space character have the same width as the space character.
- if (m_run.applyWordRounding() && width == font->spaceWidth() && (font->pitch() == FixedPitch || glyph == font->spaceGlyph()))
- width = font->adjustedSpaceWidth();
}
if (font != lastFontData && width) {
@@ -297,34 +290,29 @@
if (m_expansion) {
bool expandLeft, expandRight;
std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), m_isAfterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
- float previousExpansion = m_expansion;
if (expandLeft) {
if (m_run.ltr()) {
// Increase previous width
m_expansion -= m_expansionPerOpportunity;
- float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
- m_runWidthSoFar += expansionAtThisOpportunity;
+ m_runWidthSoFar += m_expansionPerOpportunity;
if (glyphBuffer) {
if (glyphBuffer->isEmpty()) {
if (m_forTextEmphasis)
glyphBuffer->add(font->zeroWidthSpaceGlyph(), font, m_expansionPerOpportunity, currentCharacter);
else
- glyphBuffer->add(font->spaceGlyph(), font, expansionAtThisOpportunity, currentCharacter);
+ glyphBuffer->add(font->spaceGlyph(), font, m_expansionPerOpportunity, currentCharacter);
} else
- glyphBuffer->expandLastAdvance(expansionAtThisOpportunity);
+ glyphBuffer->expandLastAdvance(m_expansionPerOpportunity);
}
} else {
// Increase next width
- float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion - m_expansionPerOpportunity);
- leftoverJustificationWidth += expansionAtThisOpportunity;
+ leftoverJustificationWidth += m_expansionPerOpportunity;
m_isAfterExpansion = true;
}
- previousExpansion = m_expansion;
}
if (expandRight) {
m_expansion -= m_expansionPerOpportunity;
- float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
- width += expansionAtThisOpportunity;
+ width += m_expansionPerOpportunity;
if (m_run.ltr())
m_isAfterExpansion = true;
}
@@ -359,32 +347,8 @@
float oldWidth = width;
- // Force characters that are used to determine word boundaries for the rounding hack
- // to be integer width, so following words will start on an integer boundary.
- if (m_run.applyWordRounding() && FontCascade::isRoundingHackCharacter(character)) {
- width = ceilf(width);
+ widthSinceLastRounding += width;
- // Since widthSinceLastRounding can lose precision if we include measurements for
- // preceding whitespace, we bypass it here.
- m_runWidthSoFar += width;
-
- // Since this is a rounding hack character, we should have reset this sum on the previous
- // iteration.
- ASSERT(!widthSinceLastRounding);
- } else {
- // Check to see if the next character is a "rounding hack character", if so, adjust
- // width so that the total run width will be on an integer boundary.
- if ((m_run.applyWordRounding() && static_cast<unsigned>(textIterator.currentCharacter()) < m_run.length() && FontCascade::isRoundingHackCharacter(*(textIterator.characters())))
- || (m_run.applyRunRounding() && static_cast<unsigned>(textIterator.currentCharacter()) >= m_run.length())) {
- float totalWidth = widthSinceLastRounding + width;
- widthSinceLastRounding = ceilf(totalWidth);
- width += widthSinceLastRounding - totalWidth;
- m_runWidthSoFar += widthSinceLastRounding;
- widthSinceLastRounding = 0;
- } else
- widthSinceLastRounding += width;
- }
-
if (glyphBuffer)
glyphBuffer->add(glyph, font, (rtl ? oldWidth + lastRoundingWidth : width), currentCharacter);
Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -668,7 +668,6 @@
bool lastRun = r + 1 == runCount;
float spaceWidth = font.spaceWidth() - font.syntheticBoldOffset();
- CGFloat roundedSpaceWidth = std::round(spaceWidth);
const UChar* cp = complexTextRun.characters();
CGPoint glyphOrigin = CGPointZero;
CFIndex lastCharacterIndex = m_run.ltr() ? std::numeric_limits<CFIndex>::min() : std::numeric_limits<CFIndex>::max();
@@ -704,17 +703,8 @@
glyph = font.spaceGlyph();
}
- float roundedAdvanceWidth = roundf(advance.width);
advance.width += font.syntheticBoldOffset();
-
- // We special case spaces in two ways when applying word rounding.
- // First, we round spaces to an adjusted width in all fonts.
- // Second, in fixed-pitch fonts we ensure that all glyphs that
- // match the width of the space glyph have the same width as the space glyph.
- if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (font.pitch() == FixedPitch || glyph == font.spaceGlyph()))
- advance.width = font.adjustedSpaceWidth();
-
if (hasExtraSpacing) {
// If we're a glyph with an advance, add in letter-spacing.
// That way we weed out zero width lurkers. This behavior matches the fast text code path.
@@ -744,22 +734,18 @@
if (m_expansion) {
bool expandLeft, expandRight;
std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), afterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
- float previousExpansion = m_expansion;
if (expandLeft) {
// Increase previous width
m_expansion -= m_expansionPerOpportunity;
- float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
- m_totalWidth += expansionAtThisOpportunity;
+ m_totalWidth += m_expansionPerOpportunity;
if (m_adjustedAdvances.isEmpty())
- m_leadingExpansion = expansionAtThisOpportunity;
+ m_leadingExpansion = m_expansionPerOpportunity;
else
- m_adjustedAdvances.last().width += expansionAtThisOpportunity;
- previousExpansion = m_expansion;
+ m_adjustedAdvances.last().width += m_expansionPerOpportunity;
}
if (expandRight) {
m_expansion -= m_expansionPerOpportunity;
- float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
- advance.width += expansionAtThisOpportunity;
+ advance.width += m_expansionPerOpportunity;
afterExpansion = true;
}
} else
@@ -772,34 +758,8 @@
afterExpansion = false;
}
- // Apply rounding hacks if needed.
- // We adjust the width of the last character of a "word" to ensure an integer width.
- // Force characters that are used to determine word boundaries for the rounding hack
- // to be integer width, so the following words will start on an integer boundary.
- if (m_run.applyWordRounding() && FontCascade::isRoundingHackCharacter(ch))
- advance.width = std::ceil(advance.width);
+ widthSinceLastCommit += advance.width;
- // Check to see if the next character is a "rounding hack character", if so, adjust the
- // width so that the total run width will be on an integer boundary.
- bool needsRoundingForCharacter = m_run.applyWordRounding() && !lastGlyph && FontCascade::isRoundingHackCharacter(nextCh);
- if (needsRoundingForCharacter || (m_run.applyRunRounding() && lastGlyph)) {
- CGFloat totalWidth = widthSinceLastCommit + advance.width;
- widthSinceLastCommit = std::ceil(totalWidth);
- CGFloat extraWidth = widthSinceLastCommit - totalWidth;
- if (m_run.ltr())
- advance.width += extraWidth;
- else {
- if (m_lastRoundingGlyph)
- m_adjustedAdvances[m_lastRoundingGlyph - 1].width += extraWidth;
- else
- m_finalRoundingWidth = extraWidth;
- m_lastRoundingGlyph = m_adjustedAdvances.size() + 1;
- }
- m_totalWidth += widthSinceLastCommit;
- widthSinceLastCommit = 0;
- } else
- widthSinceLastCommit += advance.width;
-
// FIXME: Combining marks should receive a text emphasis mark if they are combine with a space.
if (m_forTextEmphasis && (!FontCascade::canReceiveTextEmphasis(ch) || (U_GET_GC_MASK(ch) & U_GC_M_MASK)))
glyph = 0;
Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (195179 => 195180)
--- trunk/Source/WebCore/platform/mac/DragImageMac.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -194,7 +194,6 @@
if (canUseFastRenderer(buffer.data(), length)) {
FontCascade webCoreFont(FontPlatformData(toCTFont(font), [font pointSize]));
TextRun run(StringView(buffer.data(), length));
- run.disableRoundingHacks();
return webCoreFont.width(run);
}
@@ -226,7 +225,6 @@
FontCascade webCoreFont(FontPlatformData(toCTFont(font), [font pointSize]), Antialiased);
TextRun run(StringView(buffer.data(), length));
- run.disableRoundingHacks();
CGFloat red;
CGFloat green;
Modified: trunk/Source/WebCore/platform/win/DragImageWin.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/win/DragImageWin.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/win/DragImageWin.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -199,13 +199,13 @@
static const Color bottomColor(255, 255, 255, 127); // original alpha = 0.5
if (drawURLString) {
if (clipURLString)
- urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DragLabelBorderX * 2.0f), *urlFont, StringTruncator::EnableRoundingHacks);
+ urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DragLabelBorderX * 2.0f), *urlFont);
IntPoint textPos(DragLabelBorderX, imageSize.height() - (LabelBorderYOffset + urlFont->fontMetrics().descent()));
WebCoreDrawDoubledTextAtPoint(context, urlString, textPos, *urlFont, topColor, bottomColor);
}
if (clipLabelString)
- label = StringTruncator::rightTruncate(label, imageSize.width() - (DragLabelBorderX * 2.0f), *labelFont, StringTruncator::EnableRoundingHacks);
+ label = StringTruncator::rightTruncate(label, imageSize.width() - (DragLabelBorderX * 2.0f), *labelFont);
IntPoint textPos(DragLabelBorderX, DragLabelBorderY + labelFont->pixelSize());
WebCoreDrawDoubledTextAtPoint(context, label, textPos, *labelFont, topColor, bottomColor);
Modified: trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp (195179 => 195180)
--- trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -91,7 +91,7 @@
float WebCoreTextFloatWidth(const String& text, const FontCascade& font)
{
- return StringTruncator::width(text, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::width(text, font);
}
void WebCoreSetShouldUseFontSmoothing(bool smooth)
Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -134,7 +134,6 @@
const String& displayedFilename = fileTextValue();
const FontCascade& font = style().fontCascade();
TextRun textRun = constructTextRun(this, font, displayedFilename, style(), AllowTrailingExpansion, RespectDirection | RespectDirectionOverride);
- textRun.disableRoundingHacks();
#if PLATFORM(IOS)
int iconHeight = nodeHeight(uploadButton());
@@ -271,7 +270,7 @@
ASSERT(inputElement().files());
#if PLATFORM(IOS)
if (inputElement().files()->length())
- return StringTruncator::rightTruncate(inputElement().displayString(), maxFilenameWidth(), style().fontCascade(), StringTruncator::EnableRoundingHacks);
+ return StringTruncator::rightTruncate(inputElement().displayString(), maxFilenameWidth(), style().fontCascade());
#endif
return theme().fileListNameForWidth(inputElement().files(), style().fontCascade(), maxFilenameWidth(), inputElement().multiple());
}
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -129,7 +129,6 @@
applyTextTransform(style(), text, ' ');
// FIXME: Why is this always LTR? Can't text direction affect the width?
TextRun textRun = constructTextRun(this, itemFont, text, style(), AllowTrailingExpansion);
- textRun.disableRoundingHacks();
float textWidth = itemFont.width(textRun);
width = std::max(width, textWidth);
}
@@ -398,7 +397,7 @@
paintInfo.context().setFillColor(textColor);
- TextRun textRun(itemText, 0, 0, AllowTrailingExpansion, itemStyle.direction(), isOverride(itemStyle.unicodeBidi()), true, TextRun::NoRounding);
+ TextRun textRun(itemText, 0, 0, AllowTrailingExpansion, itemStyle.direction(), isOverride(itemStyle.unicodeBidi()), true);
FontCascade itemFont = style().fontCascade();
LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
r.move(itemOffsetForAlignment(textRun, &itemStyle, itemFont, r));
Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderTextControl.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -181,7 +181,6 @@
const String str = String(&ch, 1);
const FontCascade& font = style().fontCascade();
TextRun textRun = constructTextRun(this, font, str, style(), AllowTrailingExpansion);
- textRun.disableRoundingHacks();
return font.width(textRun);
}
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1328,9 +1328,9 @@
else if (fileList->length() == 1)
string = fileList->item(0)->name();
else
- return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font);
- return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::centerTruncate(string, width, font);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1574,7 +1574,7 @@
return String();
if (fileList->length() > 1)
- return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font);
String string;
if (fileList->length())
@@ -1584,7 +1584,7 @@
else
string = fileButtonNoFileSelectedLabel();
- return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::centerTruncate(string, width, font);
}
#if ENABLE(VIDEO)
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (195179 => 195180)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -2014,9 +2014,9 @@
else if (fileList->length() == 1)
strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(fileList->item(0)->path())];
else
- return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font);
- return StringTruncator::centerTruncate(strToTruncate, width, font, StringTruncator::EnableRoundingHacks);
+ return StringTruncator::centerTruncate(strToTruncate, width, font);
}
#if ENABLE(SERVICE_CONTROLS)
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -420,8 +420,6 @@
if (style->fontCascade().primaryFont().isSVGFont())
run.setRenderingContext(SVGTextRunRenderingContext::create(renderer()));
- run.disableRoundingHacks();
-
// We handle letter & word spacing ourselves.
run.disableSpacing();
Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp (195179 => 195180)
--- trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -73,8 +73,6 @@
if (style.fontCascade().primaryFont().isSVGFont())
run.setRenderingContext(SVGTextRunRenderingContext::create(text));
- run.disableRoundingHacks();
-
// We handle letter & word spacing ourselves.
run.disableSpacing();
Modified: trunk/Source/WebCore/testing/Internals.cpp (195179 => 195180)
--- trunk/Source/WebCore/testing/Internals.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/testing/Internals.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -369,7 +369,6 @@
mainFrameView->setFixedLayoutSize(IntSize());
}
- TextRun::setAllowsRoundingHacks(false);
WebCore::overrideUserPreferredLanguages(Vector<String>());
WebCore::Settings::setUsesOverlayScrollbars(false);
page->inspectorController().setProfilerEnabled(false);
@@ -2038,11 +2037,6 @@
document->cachedResourceLoader().garbageCollectDocumentResources();
}
-void Internals::allowRoundingHacks() const
-{
- TextRun::setAllowsRoundingHacks(true);
-}
-
void Internals::insertAuthorCSS(const String& css, ExceptionCode& ec) const
{
Document* document = contextDocument();
Modified: trunk/Source/WebCore/testing/Internals.h (195179 => 195180)
--- trunk/Source/WebCore/testing/Internals.h 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/testing/Internals.h 2016-01-17 04:54:32 UTC (rev 195180)
@@ -264,8 +264,6 @@
void garbageCollectDocumentResources(ExceptionCode&) const;
- void allowRoundingHacks() const;
-
void insertAuthorCSS(const String&, ExceptionCode&) const;
void insertUserCSS(const String&, ExceptionCode&) const;
Modified: trunk/Source/WebCore/testing/Internals.idl (195179 => 195180)
--- trunk/Source/WebCore/testing/Internals.idl 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebCore/testing/Internals.idl 2016-01-17 04:54:32 UTC (rev 195180)
@@ -233,8 +233,6 @@
[RaisesException] void garbageCollectDocumentResources();
- void allowRoundingHacks();
-
[RaisesException] void insertAuthorCSS(DOMString css);
[RaisesException] void insertUserCSS(DOMString css);
Modified: trunk/Source/WebKit/ios/ChangeLog (195179 => 195180)
--- trunk/Source/WebKit/ios/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/ios/ChangeLog 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,3 +1,13 @@
+2016-01-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove TextRun::allowsRoundingHacks()
+ https://bugs.webkit.org/show_bug.cgi?id=153185
+
+ Reviewed by Simon Fraser.
+
+ * Misc/WebUIKitSupport.mm:
+ (WebKitInitialize): Deleted.
+
2016-01-13 Chris Dumez <cdu...@apple.com>
Unreviewed, rolling out r194900.
Modified: trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm (195179 => 195180)
--- trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -70,7 +70,6 @@
// We'd rather eat this cost at startup than slow down situations that need to be responsive.
// See <rdar://problem/6776301>.
LoadWebLocalizedStrings();
- [WebView _setAllowsRoundingHacks:!linkedOnOrAfterIOS5()];
[WebView registerForMemoryNotifications];
// This needs to be called before any requests are made in the process, <rdar://problem/9691871>
Modified: trunk/Source/WebKit/mac/ChangeLog (195179 => 195180)
--- trunk/Source/WebKit/mac/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,3 +1,18 @@
+2016-01-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove TextRun::allowsRoundingHacks()
+ https://bugs.webkit.org/show_bug.cgi?id=153185
+
+ Reviewed by Simon Fraser.
+
+ * Misc/WebKitNSStringExtras.mm:
+ (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): Deleted.
+ (-[NSString _web_widthWithFont:]): Deleted.
+ * WebView/WebView.mm:
+ (+[WebView _setAllowsRoundingHacks:]): Deleted.
+ (+[WebView _allowsRoundingHacks]): Deleted.
+ * WebView/WebViewPrivate.h:
+
2016-01-15 Tim Horton <timothy_hor...@apple.com>
Data detector yellow highlight location is vertically mirrored in WebKit1
Modified: trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm (195179 => 195180)
--- trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -93,7 +93,6 @@
FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize]), fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);
TextRun run(StringView(buffer.data(), length));
- run.disableRoundingHacks();
CGFloat red;
CGFloat green;
@@ -139,7 +138,6 @@
if (canUseFastRenderer(buffer.data(), length)) {
FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize]));
TextRun run(StringView(buffer.data(), length));
- run.disableRoundingHacks();
return webCoreFont.width(run);
}
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (195179 => 195180)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1494,16 +1494,6 @@
FontCascade::setCodePath(f ? FontCascade::Complex : FontCascade::Auto);
}
-+ (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks
-{
- TextRun::setAllowsRoundingHacks(allowsRoundingHacks);
-}
-
-+ (BOOL)_allowsRoundingHacks
-{
- return TextRun::allowsRoundingHacks();
-}
-
+ (BOOL)canCloseAllWebViews
{
return DOMWindow::dispatchAllPendingBeforeUnloadEvents();
Modified: trunk/Source/WebKit/mac/WebView/WebViewPrivate.h (195179 => 195180)
--- trunk/Source/WebKit/mac/WebView/WebViewPrivate.h 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/mac/WebView/WebViewPrivate.h 2016-01-17 04:54:32 UTC (rev 195180)
@@ -517,9 +517,6 @@
+ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f;
-+ (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks;
-+ (BOOL)_allowsRoundingHacks;
-
#if !TARGET_OS_IPHONE
- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL;
#endif
Modified: trunk/Source/WebKit/win/WebKitGraphics.cpp (195179 => 195180)
--- trunk/Source/WebKit/win/WebKitGraphics.cpp 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Source/WebKit/win/WebKitGraphics.cpp 2016-01-17 04:54:32 UTC (rev 195180)
@@ -113,7 +113,7 @@
{
ASSERT(buffer);
- String result = StringTruncator::centerTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks);
+ String result = StringTruncator::centerTruncate(String(text, length), width, makeFont(description));
StringView(result).getCharactersWithUpconvert(buffer);
buffer[result.length()] = '\0';
return result.length();
@@ -123,7 +123,7 @@
{
ASSERT(buffer);
- String result = StringTruncator::rightTruncate(String(text, length), width, makeFont(description), StringTruncator::EnableRoundingHacks);
+ String result = StringTruncator::rightTruncate(String(text, length), width, makeFont(description));
StringView(result).getCharactersWithUpconvert(buffer);
buffer[result.length()] = '\0';
return result.length();
Modified: trunk/Tools/ChangeLog (195179 => 195180)
--- trunk/Tools/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Tools/ChangeLog 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1,3 +1,13 @@
+2016-01-16 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove TextRun::allowsRoundingHacks()
+ https://bugs.webkit.org/show_bug.cgi?id=153185
+
+ Reviewed by Simon Fraser.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting): Deleted.
+
2016-01-15 Konstantin Tokarev <annu...@yandex.ru>
[webkitdirs] Avoid list form of open because it broke WinCairo
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (195179 => 195180)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2016-01-17 00:21:44 UTC (rev 195179)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2016-01-17 04:54:32 UTC (rev 195180)
@@ -1866,7 +1866,6 @@
[WebView _setUsesTestModeFocusRingColor:YES];
#endif
[WebView _resetOriginAccessWhitelists];
- [WebView _setAllowsRoundingHacks:NO];
[[MockGeolocationProvider shared] stopTimer];
[[MockWebNotificationProvider shared] reset];