[Mac] [iOS] Underlines are too low
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 May 2014 17:35:14 +0000 (17:35 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 May 2014 17:35:14 +0000 (17:35 +0000)
commitb632852f223013963471de88eeeb1be2439b34e9
tree2604858040159fb9e142703a2436e3adfee7a006
parent458a509eb4f6d5d359d95fb1067dfd1a0549d581
[Mac] [iOS] Underlines are too low
https://bugs.webkit.org/show_bug.cgi?id=132770

Reviewed by Darin Adler.

Source/WebCore:
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

LayoutTests:
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-style-double-space-scales.html
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/rendering/InlineTextBox.cpp