Implement stroke-color CSS property.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Apr 2017 08:01:51 +0000 (08:01 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Apr 2017 08:01:51 +0000 (08:01 +0000)
commit77f23f4116eb4bfdb89ab292f8bd1764d05cb324
tree44e9bccaac729f9de830c9e500a55020b4b281e3
parentf6bb55cce3668b4e69738255e152589eba1ea00c
Implement stroke-color CSS property.
https://bugs.webkit.org/show_bug.cgi?id=169352

Reviewed by Jon Lee.

Source/WebCore:

Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/.
Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still
works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been
set, we fall back to the value of the -webkit-text-stroke-color property.

Tests: fast/css/stroke-color-fallback.html
       fast/css/stroke-color.html
       fast/css/visited-link-stroke-color.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueStrokeColor):
* css/StyleResolver.cpp:
(WebCore::isValidVisitedLinkProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isColorPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::computeTextSelectionPaintStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline):
(WebCore::RenderStyle::colorIncludingFallback):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::strokeColor):
(WebCore::RenderStyle::setStrokeColor):
(WebCore::RenderStyle::setVisitedLinkStrokeColor):
(WebCore::RenderStyle::visitedLinkStrokeColor):
(WebCore::RenderStyle::setHasExplicitlySetStrokeColor):
(WebCore::RenderStyle::hasExplicitlySetStrokeColor):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

* fast/css/stroke-color-expected.html: Added.
* fast/css/stroke-color-fallback-expected.html: Added.
* fast/css/stroke-color-fallback.html: Added.
* fast/css/stroke-color.html: Added.
* fast/css/visited-link-stroke-color-expected.html: Added.
* fast/css/visited-link-stroke-color.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/stroke-color-expected.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-color-fallback-expected.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-color-fallback.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-color.html [new file with mode: 0644]
LayoutTests/fast/css/visited-link-stroke-color-expected.html [new file with mode: 0644]
LayoutTests/fast/css/visited-link-stroke-color.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/rendering/TextDecorationPainter.cpp
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h