text-emphasis-position CSS property doesn't recognize 'left' and 'right'
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 18:47:04 +0000 (18:47 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 18:47:04 +0000 (18:47 +0000)
commitfeaa9a0256da3b41e5e4ffb708cb2f2d0811e3ff
tree72115dca5a098ff59fd3047edb275f1d55343f9f
parent1ce6015dda4be3b31133403607d84338cec18127
text-emphasis-position CSS property doesn't recognize 'left' and 'right'
https://bugs.webkit.org/show_bug.cgi?id=126611

Reviewed by Simon Fraser.

Source/WebCore:

This patch allows the text-emphasis-position to accept the "left" and
"right" CSS values. In horizontal writing modes, these values no not
change behavior. In vertical writing modes, however, these values specify
which side to place the emphasis mark. Similarly, in vertical writing
modes, the "above" and "below" values should not change behavior.

However, in order to keep existing behavior, if neither "left" nor "right"
is specified, we should draw as if the appropriate value were
specified ("over" -> "right" and "under" -> "left"). Note that this
will have to be updated when we implement the
"text-orientation: sideways-left" CSS property.

Tests: fast/text/emphasis-horizontal-left-right.html
       fast/text/emphasis-vertical-over-right.html
       fast/text/emphasis-vertical-over-under.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTextEmphasisPosition):
* css/CSSParser.h:
* css/CSSPrimitiveValueMappings.h:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::valueToEmphasisPosition):
(WebCore::ApplyPropertyTextEmphasisPosition::applyValue):
(WebCore::ApplyPropertyTextEmphasisPosition::createHandler):
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove):
(WebCore::InlineTextBox::paint):
* rendering/InlineTextBox.h:
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

With regards to text-emphasis-position, "left" and "right" are only valid in
vertical writing modes, and "over" and "under" are only valid in horizontal
writing modes.

In order to keep in line with existing pages, specifying "under" without
"left" or "right" should draw text as if "under left" was specified (and
vice-versa).

The default value for text-emphasis-position should be "over right".

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/parsing-text-emphasis-expected.txt:
* fast/css/parsing-text-emphasis.html:
* fast/text/emphasis-horizontal-left-right-expected.html: Added.
* fast/text/emphasis-horizontal-left-right.html: Added.
* fast/text/emphasis-vertical-over-right-expected.html: Added.
* fast/text/emphasis-vertical-over-right.html: Added.
* fast/text/emphasis-vertical-over-under-expected.html: Added.
* fast/text/emphasis-vertical-over-under.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/fast/css/parsing-text-emphasis-expected.txt
LayoutTests/fast/css/parsing-text-emphasis.html
LayoutTests/fast/text/emphasis-horizontal-left-right-expected.html [new file with mode: 0644]
LayoutTests/fast/text/emphasis-horizontal-left-right.html [new file with mode: 0644]
LayoutTests/fast/text/emphasis-vertical-over-right-expected.html [new file with mode: 0644]
LayoutTests/fast/text/emphasis-vertical-over-right.html [new file with mode: 0644]
LayoutTests/fast/text/emphasis-vertical-over-under-expected.html [new file with mode: 0644]
LayoutTests/fast/text/emphasis-vertical-over-under.html [new file with mode: 0644]
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
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/DeprecatedStyleBuilder.cpp
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h