Diff
Modified: branches/safari-538.34-branch/LayoutTests/ChangeLog (168820 => 168821)
--- branches/safari-538.34-branch/LayoutTests/ChangeLog 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/LayoutTests/ChangeLog 2014-05-14 08:57:48 UTC (rev 168821)
@@ -1,3 +1,23 @@
+2014-05-14 Lucas Forschler <[email protected]>
+
+ Merge r168599
+
+ 2014-05-09 Myles C. Maxfield <[email protected]>
+
+ [Mac] [iOS] Underlines are too low
+ https://bugs.webkit.org/show_bug.cgi?id=132770
+
+ Reviewed by Darin Adler.
+
+ See per-file descriptions.
+
+ * fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html: Made
+ test more robust so it does not barely clip underlines, but rather gives them a couple
+ pixels of wiggle room.
+ * fast/css3-text/css3-text-decoration/text-decoration-thickness.html: Not only does this test
+ underline thickness, but it also tests underline position. Updated this test to not expect
+ incorrect results.
+
2014-05-09 Lucas Forschler <[email protected]>
Merge r168460
Modified: branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html (168820 => 168821)
--- branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html 2014-05-14 08:57:48 UTC (rev 168821)
@@ -7,7 +7,7 @@
using overflow: hidden. It makes sure that this is exactly the same as a single underline. If the
space between the two underlines does not scale with font size, it will appear as though there is a
single thick underline (because they will be drawn on top of each other) and will thus fail this test.
-<div style="width: 100px; height: 99px; overflow: hidden;">
+<div style="width: 100px; height: 95px; overflow: hidden;">
<div style="text-decoration: underline; font-size: 100px; -webkit-text-decoration-style: double; font-family: Ahem;"> </div>
</div>
</body>
Modified: branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html (168820 => 168821)
--- branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html 2014-05-14 08:57:48 UTC (rev 168821)
@@ -7,7 +7,7 @@
the text so that the underline should fill a box if the underline grows in proportion
to text size. The comparison is to a box that has its background color set.
<div style="position: relative; width: 600px; height: 600px; overflow: hidden;">
-<div style="font-family: Ahem; text-decoration: underline; font-size: 10000px; position: absolute; left: 0px; top: -8650px;"> </div>
+<div style="font-family: Ahem; text-decoration: underline; font-size: 10000px; position: absolute; left: 0px; top: -8350px;"> </div>
</div>
</body>
</html>
Modified: branches/safari-538.34-branch/Source/WebCore/ChangeLog (168820 => 168821)
--- branches/safari-538.34-branch/Source/WebCore/ChangeLog 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/Source/WebCore/ChangeLog 2014-05-14 08:57:48 UTC (rev 168821)
@@ -1,5 +1,34 @@
2014-05-14 Lucas Forschler <[email protected]>
+ Merge r168599
+
+ 2014-05-09 Myles C. Maxfield <[email protected]>
+
+ [Mac] [iOS] Underlines are too low
+ https://bugs.webkit.org/show_bug.cgi?id=132770
+
+ Reviewed by Darin Adler.
+
+ computeUnderlineOffset() inside InlineTextBox.cpp lowers underlines from text
+ baseline by a value that is proportional to the font size. However, this
+ lowering was done a second time in
+ GraphicsContext::computeLineBoundsAndAntialiasingModeForText(). This patch
+ removes this second, platform-dependent lowering.
+
+ This duplication was caused by merging iOS into open source, where iOS used
+ the GraphicsContext approach and open source used the InlineTextBox approach.
+
+ Covered by fast/css3-text/css3-text-decoration/text-decoration-thickness.html.
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText): Remove
+ redundant lowering code
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintDecoration): Clean up textDecorationThickness
+ variable
+
+2014-05-14 Lucas Forschler <[email protected]>
+
Merge r168744
2014-05-13 Enrica Casucci <[email protected]>
Modified: branches/safari-538.34-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp (168820 => 168821)
--- branches/safari-538.34-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp 2014-05-14 08:57:48 UTC (rev 168821)
@@ -985,16 +985,8 @@
color = Color(color.red(), color.green(), color.blue(), alpha);
}
- // Don't offset line from bottom of text if scale is less than offsetUnderLineScale.
- static const float offsetUnderlineScale = 0.4f;
- float dy = scale < offsetUnderlineScale ? 0 : 1;
-
- // If we've increased the thickness of the line, make sure to move the location too.
- if (thickness > 1)
- dy += roundf(thickness) - 1;
-
FloatPoint devicePoint = transform.mapPoint(point);
- FloatPoint deviceOrigin = FloatPoint(roundf(devicePoint.x()), ceilf(devicePoint.y()) + dy);
+ FloatPoint deviceOrigin = FloatPoint(roundf(devicePoint.x()), ceilf(devicePoint.y()));
origin = transform.inverse().mapPoint(deviceOrigin);
}
return FloatRect(origin.x(), origin.y(), width, thickness);
Modified: branches/safari-538.34-branch/Source/WebCore/rendering/InlineTextBox.cpp (168820 => 168821)
--- branches/safari-538.34-branch/Source/WebCore/rendering/InlineTextBox.cpp 2014-05-14 08:53:28 UTC (rev 168820)
+++ branches/safari-538.34-branch/Source/WebCore/rendering/InlineTextBox.cpp 2014-05-14 08:57:48 UTC (rev 168821)
@@ -981,9 +981,6 @@
UNUSED_PARAM(textPainter);
#endif
- // FIXME: We should improve this rule and not always just assume 1.
- const float textDecorationThickness = 1.f;
-
if (m_truncation == cFullTruncation)
return;
@@ -1006,9 +1003,8 @@
bool isPrinting = renderer().document().printing();
const float textDecorationBaseFontSize = 16;
- float fontSizeScaling = renderer().style().fontSize() / textDecorationBaseFontSize;
- float strokeThickness = roundf(textDecorationThickness * fontSizeScaling);
- context.setStrokeThickness(strokeThickness);
+ float textDecorationThickness = renderer().style().fontSize() / textDecorationBaseFontSize;
+ context.setStrokeThickness(textDecorationThickness);
bool linesAreOpaque = !isPrinting && (!(decoration & TextDecorationUnderline) || underline.alpha() == 255) && (!(decoration & TextDecorationOverline) || overline.alpha() == 255) && (!(decoration & TextDecorationLineThrough) || linethrough.alpha() == 255);