[css3-text] Add partial parsing support for text-underline-position property from...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 01:10:35 +0000 (01:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 01:10:35 +0000 (01:10 +0000)
commit4eae2c15b32c5094d27afae25ac3bbc3c0f370f7
tree46d9b92babe8b0ab774fde6a3a6d86f281d19ada
parentbb2385b947d0bd63b99eba27162a41bdf2d49c06
[css3-text] Add partial parsing support for text-underline-position property from CSS3 Text
https://bugs.webkit.org/show_bug.cgi?id=102491

Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-03-11
Reviewed by Julien Chaffraix.

Source/WebCore:

This patch extends the existing parsing to support 'auto', 'alphabetic' and 'under'. 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.

Test: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTextUnderlinePosition):
* css/CSSParser.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextUnderlinePosition):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
Added parsing-related checks for text-underline-position property.
* css/CSSPropertyNames.in: Added '-webkit-underline-position' property.
* css/CSSValueKeywords.in:
* css/SVGCSSValueKeywords.in:
* css/StyleBuilder.cpp:
(ApplyPropertyTextUnderlinePosition):
(WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
(WebCore::ApplyPropertyTextUnderlinePosition::createHandler):
(WebCore::StyleBuilder::StyleBuilder):
Set property handler for text-underline-position.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
Added support for m_textUnderlinePosition on copy constructor and operator
assignment functions.
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData): Added m_textUnderlinePosition here as it won't be used regularly.

LayoutTests:

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

* fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt: Added.
* fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html: Added.
* fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js: Added.
(testElementStyle):
(testComputedStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html [new file with mode: 0644]
LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/SVGCSSValueKeywords.in
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h