Position and thickness of underline as text size changes
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 01:54:19 +0000 (01:54 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2014 01:54:19 +0000 (01:54 +0000)
commita43b77cb22213a951b7267e61167cb447619b4d6
treebe6e2fbe1753fc79e1d29fea462a385fc6841a52
parentaa673103a2b0e69036b56e7c46ea5cb6170f3bb7
Position and thickness of underline as text size changes
https://bugs.webkit.org/show_bug.cgi?id=16768

Source/WebCore:

Reviewed by Dean Jackson.

This patch adopts the iOS codepath for underlines. It also reorganizes
drawLineForText to avoid a costly global state save & restore.

Test: fast/css3-text/css3-text-decoration/text-decoration-thickness.html

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::computeLineBoundsAndAntialiasingModeForText):
(WebCore::GraphicsContext::computeLineBoundsForText):
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration):

LayoutTests:

This test draws underlined text at a very large font size. It then positions and clips
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.

Reviewed by Dean Jackson.

* fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-thickness.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/rendering/InlineTextBox.cpp