[css3-text] Add rendering support for -webkit-text-underline-position
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 19:43:22 +0000 (19:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 19:43:22 +0000 (19:43 +0000)
commit9a781b9c7f507632c75b63f32a70baf39ae3db12
tree1265781c4bfeb5f880a2219e9f74fe3b7184fa44
parent941263149ad23269f73edffeda97529fc74120d9
[css3-text] Add rendering support for -webkit-text-underline-position
https://bugs.webkit.org/show_bug.cgi?id=102795

Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-03-18
Reviewed by Levi Weintraub.

Source/WebCore:

This patch implements rendering support for values [ auto | alphabetic | under ]
of CSS3 property text-underline-position. We don't fully match the specification
as we don't support [ left | right ] and this is left for another implementation
as the rendering will need to be added.

Tests: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html
       fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html
       fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html
       fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html
       fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeMaxLogicalTop): Added method to compute maximal logical top among all chidren of
this InlineTextBox.
* rendering/InlineFlowBox.h:
(InlineFlowBox):
* rendering/InlineTextBox.cpp:
(WebCore::computeUnderlineOffset): Added method to compute offset for text-underline-position property.
(WebCore::InlineTextBox::paintDecoration): Paint decoration at position calculated using computeUnderlineOffset().
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):
(WebCore::RootInlineBox::alignBoxesInBlockDirection): Call method to compute maximal logical top among all
children of this RootInlineBox.
* rendering/RootInlineBox.h:
(RootInlineBox):
(WebCore::RootInlineBox::maxLogicalTop): Added getter for m_maxLogicalTop class member.
* rendering/style/RenderStyle.h: Added the usual getter / setter / initial methods for text-underline-position
property

LayoutTests:

Added text-underline-position tests for 'text-underline-position' CSS3
property, with 'webkit' prefix.

* fast/css3-text/css3-text-decoration/text-underline-position/style.css: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png: Added.
* platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/style.css [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h