Round-tripping stroke-width styles through getComputedStyle cause the text to gain...
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Jul 2017 00:41:14 +0000 (00:41 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Jul 2017 00:41:14 +0000 (00:41 +0000)
commite3938cbfbc4f004b3dcaa1fbd864d07a482f6af9
treefd96789c3acfdd24e358907509612c4fd3405598
parenta2012b14c89c5b1fab694dc8325f482f446a30d4
Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
https://bugs.webkit.org/show_bug.cgi?id=174701
Source/WebCore:

<rdar://problem/32903679>

Reviewed by Simon Fraser.

The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.

Test: fast/css/round-trip-stroke-width-using-computed-style.html

* rendering/TextPaintStyle.cpp:
(WebCore::updateGraphicsContext):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialStrokeWidth):
(WebCore::RenderStyle::initialStrokeColor):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):

LayoutTests:

Reviewed by Simon Fraser.

* fast/css/round-trip-stroke-width-using-computed-style-expected.html: Added.
* fast/css/round-trip-stroke-width-using-computed-style.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/round-trip-stroke-width-using-computed-style-expected.html [new file with mode: 0644]
LayoutTests/fast/css/round-trip-stroke-width-using-computed-style.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp