Title: [238860] trunk
Revision
238860
Author
ryanhad...@apple.com
Date
2018-12-04 10:50:52 -0800 (Tue, 04 Dec 2018)

Log Message

Unreviewed, rolling out r238838.

The layout test added with this change is failing on iOS.

Reverted changeset:

"Thick overlines and line-throughs grow in the wrong
direction"
https://bugs.webkit.org/show_bug.cgi?id=192264
https://trac.webkit.org/changeset/238838

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (238859 => 238860)


--- trunk/LayoutTests/ChangeLog	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/LayoutTests/ChangeLog	2018-12-04 18:50:52 UTC (rev 238860)
@@ -1,5 +1,18 @@
 2018-12-04  Ryan Haddad  <ryanhad...@apple.com>
 
+        Unreviewed, rolling out r238838.
+
+        The layout test added with this change is failing on iOS.
+
+        Reverted changeset:
+
+        "Thick overlines and line-throughs grow in the wrong
+        direction"
+        https://bugs.webkit.org/show_bug.cgi?id=192264
+        https://trac.webkit.org/changeset/238838
+
+2018-12-04  Ryan Haddad  <ryanhad...@apple.com>
+
         Unreviewed, rolling out r238840.
 
         The layout test added with this change is frequently failing.

Deleted: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction-expected.html (238859 => 238860)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction-expected.html	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction-expected.html	2018-12-04 18:50:52 UTC (rev 238860)
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-This test makes sure that overlines grow upward. The test passes if the overline on the text below has the default thickness.
-<div style="font-size: 48px; text-decoration: overline;">Hello</div>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html (238859 => 238860)


--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html	2018-12-04 18:50:52 UTC (rev 238860)
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-This test makes sure that overlines grow upward. The test passes if the overline on the text below has the default thickness.
-<div style="font-size: 48px; text-decoration: overline; overflow: hidden; text-decoration-thickness: 10px;">Hello</div>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (238859 => 238860)


--- trunk/Source/WebCore/ChangeLog	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/Source/WebCore/ChangeLog	2018-12-04 18:50:52 UTC (rev 238860)
@@ -1,5 +1,18 @@
 2018-12-04  Ryan Haddad  <ryanhad...@apple.com>
 
+        Unreviewed, rolling out r238838.
+
+        The layout test added with this change is failing on iOS.
+
+        Reverted changeset:
+
+        "Thick overlines and line-throughs grow in the wrong
+        direction"
+        https://bugs.webkit.org/show_bug.cgi?id=192264
+        https://trac.webkit.org/changeset/238838
+
+2018-12-04  Ryan Haddad  <ryanhad...@apple.com>
+
         Unreviewed, rolling out r238840.
 
         The layout test added with this change is frequently failing.

Modified: trunk/Source/WebCore/rendering/TextDecorationPainter.cpp (238859 => 238860)


--- trunk/Source/WebCore/rendering/TextDecorationPainter.cpp	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/Source/WebCore/rendering/TextDecorationPainter.cpp	2018-12-04 18:50:52 UTC (rev 238860)
@@ -296,15 +296,12 @@
         if (m_decorations.contains(TextDecoration::Overline)) {
             float wavyOffset = m_styles.overlineStyle == TextDecorationStyle::Wavy ? m_wavyOffset : 0;
             FloatRect rect(localOrigin, FloatSize(m_width, textDecorationThickness));
-            float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(m_lineStyle.computedFontSize(), fontMetrics);
-            rect.move(0, autoTextDecorationThickness - textDecorationThickness - wavyOffset);
+            rect.move(0, -wavyOffset);
             paintDecoration(TextDecoration::Overline, m_styles.overlineStyle, m_styles.overlineColor, rect);
         }
         if (m_decorations.contains(TextDecoration::LineThrough)) {
             FloatRect rect(localOrigin, FloatSize(m_width, textDecorationThickness));
-            float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(m_lineStyle.computedFontSize(), fontMetrics);
-            auto center = 2 * fontMetrics.floatAscent() / 3 + autoTextDecorationThickness / 2;
-            rect.move(0, center - textDecorationThickness / 2);
+            rect.move(0, 2 * fontMetrics.floatAscent() / 3);
             paintDecoration(TextDecoration::LineThrough, m_styles.linethroughStyle, m_styles.linethroughColor, rect);
         }
     } while (shadow);

Modified: trunk/Source/WebCore/style/InlineTextBoxStyle.cpp (238859 => 238860)


--- trunk/Source/WebCore/style/InlineTextBoxStyle.cpp	2018-12-04 18:17:16 UTC (rev 238859)
+++ trunk/Source/WebCore/style/InlineTextBoxStyle.cpp	2018-12-04 18:50:52 UTC (rev 238860)
@@ -125,7 +125,6 @@
     }
 
     // These metrics must match where underlines get drawn.
-    // FIXME: Share the code in TextDecorationPainter::paintTextDecoration() so we can just query it for the painted geometry.
     if (decoration & TextDecoration::Underline) {
         // Compensate for the integral ceiling in GraphicsContext::computeLineBoundsAndAntialiasingModeForText()
         int underlineOffset = 1;
@@ -141,31 +140,23 @@
         }
     }
     if (decoration & TextDecoration::Overline) {
-        FloatRect rect(FloatPoint(), FloatSize(1, strokeThickness));
-        float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(lineStyle.computedFontSize(), lineStyle.fontMetrics());
-        rect.move(0, autoTextDecorationThickness - strokeThickness - wavyOffset);
         if (decorationStyle == TextDecorationStyle::Wavy) {
-            FloatBoxExtent wavyExpansion;
-            wavyExpansion.setTop(wavyStrokeParameters.controlPointDistance);
-            wavyExpansion.setBottom(wavyStrokeParameters.controlPointDistance);
-            rect.expand(wavyExpansion);
+            extendIntToFloat(overflowResult.bottom, -wavyOffset + wavyStrokeParameters.controlPointDistance + strokeThickness - height);
+            extendIntToFloat(overflowResult.top, wavyOffset + wavyStrokeParameters.controlPointDistance + strokeThickness);
+        } else {
+            extendIntToFloat(overflowResult.bottom, strokeThickness - height);
+            // top is untouched
         }
-        extendIntToFloat(overflowResult.top, -rect.y());
-        extendIntToFloat(overflowResult.bottom, rect.maxY() - height);
     }
     if (decoration & TextDecoration::LineThrough) {
-        FloatRect rect(FloatPoint(), FloatSize(1, strokeThickness));
-        float autoTextDecorationThickness = TextDecorationThickness::createWithAuto().resolve(lineStyle.computedFontSize(), lineStyle.fontMetrics());
-        auto center = 2 * lineStyle.fontMetrics().floatAscent() / 3 + autoTextDecorationThickness / 2;
-        rect.move(0, center - strokeThickness / 2);
+        float baseline = lineStyle.fontMetrics().floatAscent();
         if (decorationStyle == TextDecorationStyle::Wavy) {
-            FloatBoxExtent wavyExpansion;
-            wavyExpansion.setTop(wavyStrokeParameters.controlPointDistance);
-            wavyExpansion.setBottom(wavyStrokeParameters.controlPointDistance);
-            rect.expand(wavyExpansion);
+            extendIntToFloat(overflowResult.bottom, 2 * baseline / 3 + wavyStrokeParameters.controlPointDistance + strokeThickness - height);
+            extendIntToFloat(overflowResult.top, -(2 * baseline / 3 - wavyStrokeParameters.controlPointDistance - strokeThickness));
+        } else {
+            extendIntToFloat(overflowResult.bottom, 2 * baseline / 3 + strokeThickness - height);
+            extendIntToFloat(overflowResult.top, -(2 * baseline / 3));
         }
-        extendIntToFloat(overflowResult.top, -rect.y());
-        extendIntToFloat(overflowResult.bottom, rect.maxY() - height);
     }
     return overflowResult;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to