<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[215261] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/215261">215261</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2017-04-12 01:01:51 -0700 (Wed, 12 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertiesjson">trunk/Source/WebCore/css/CSSProperties.json</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathscpp">trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextDecorationPaintercpp">trunk/Source/WebCore/rendering/TextDecorationPainter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextPaintStylecpp">trunk/Source/WebCore/rendering/TextPaintStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssstrokecolorexpectedhtml">trunk/LayoutTests/fast/css/stroke-color-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokecolorfallbackexpectedhtml">trunk/LayoutTests/fast/css/stroke-color-fallback-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokecolorfallbackhtml">trunk/LayoutTests/fast/css/stroke-color-fallback.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokecolorhtml">trunk/LayoutTests/fast/css/stroke-color.html</a></li>
<li><a href="#trunkLayoutTestsfastcssvisitedlinkstrokecolorexpectedhtml">trunk/LayoutTests/fast/css/visited-link-stroke-color-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssvisitedlinkstrokecolorhtml">trunk/LayoutTests/fast/css/visited-link-stroke-color.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/LayoutTests/ChangeLog        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-04-12  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+        Implement stroke-color CSS property.
+        https://bugs.webkit.org/show_bug.cgi?id=169352
+
+        Reviewed by Jon Lee.
+
+        * 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.
+
</ins><span class="cx"> 2017-04-11  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         LayoutTest webrtc/video-mute.html is a flaky failure
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokecolorexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-color-expected.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-color-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-color-expected.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 80px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-width: 10px;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;-webkit-text-stroke-color: red;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: #ff00ffff;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: #ffff00ff;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;-webkit-text-stroke-color: red;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: #ff00ffff;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: #ffff00ff;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokecolorfallbackexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-color-fallback-expected.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-color-fallback-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-color-fallback-expected.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 80px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-width: 10px;
+        }
+    
+        stroke-color-class {
+            stroke-color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: yellow;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: blue;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokecolorfallbackhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-color-fallback.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-color-fallback.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-color-fallback.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 80px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-width: 10px;
+        }
+    
+        stroke-color-class {
+            stroke-color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green; -webkit-text-stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue; stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue; stroke-color: green; stroke-color: yellow;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue; stroke-color: green; -webkit-text-stroke-color: red;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;stroke-color: green;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&lt;span style=&quot;stroke-color: green;&quot;&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: green; -webkit-text-stroke-color: blue;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-color: blue; stroke-color: green;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+
+&lt;div class=&quot;stroke-color-class&quot; style=&quot;-webkit-text-stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokecolorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-color.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-color.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-color.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 80px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-width: 10px;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;stroke-color: red;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: blue;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: #ff00ffff;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: #ffff00ff;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;stroke-color: red;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: blue;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: #ff00ffff;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-color: #ffff00ff;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssvisitedlinkstrokecolorexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/visited-link-stroke-color-expected.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/visited-link-stroke-color-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/visited-link-stroke-color-expected.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    a {
+        font-size: 300%;
+        -webkit-text-stroke-width: 2px;
+        -webkit-text-stroke-color: green;
+    }
+    a:visited {
+        color: red;
+        -webkit-text-stroke-color: blue;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;a href&gt;Visited link with blue stroke color&lt;/a&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssvisitedlinkstrokecolorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/visited-link-stroke-color.html (0 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/visited-link-stroke-color.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/visited-link-stroke-color.html        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    a {
+        font-size: 300%;
+        stroke-width: 2px;
+        stroke-color: green;
+    }
+    a:visited {
+        color: red;
+        stroke-color: blue;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;a href&gt;Visited link with blue stroke color&lt;/a&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/ChangeLog        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2017-04-12  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+        Implement stroke-color CSS property.
+        https://bugs.webkit.org/show_bug.cgi?id=169352
+
+        Reviewed by Jon Lee.
+
+        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:
+
</ins><span class="cx"> 2017-04-11  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Use the DisplayRefreshMonitor facilities
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -460,6 +460,7 @@
</span><span class="cx">     CSSPropertyRx,
</span><span class="cx">     CSSPropertyRy,
</span><span class="cx">     CSSPropertyStroke,
</span><ins>+    CSSPropertyStrokeColor,
</ins><span class="cx">     CSSPropertyStrokeDasharray,
</span><span class="cx">     CSSPropertyStrokeDashoffset,
</span><span class="cx">     CSSPropertyStrokeLinecap,
</span><span class="lines">@@ -3920,6 +3921,8 @@
</span><span class="cx">             return CSSPrimitiveValue::create(style-&gt;joinStyle());
</span><span class="cx">         case CSSPropertyStrokeWidth:
</span><span class="cx">             return zoomAdjustedPixelValueForLength(style-&gt;strokeWidth(), *style);
</span><ins>+        case CSSPropertyStrokeColor:
+            return currentColorOrValidColor(style, style-&gt;strokeColor());
</ins><span class="cx">         case CSSPropertyStrokeMiterlimit:
</span><span class="cx">             return CSSPrimitiveValue::create(style-&gt;strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertiesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSProperties.json (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSProperties.json        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/CSSProperties.json        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -3052,6 +3052,19 @@
</span><span class="cx">                 &quot;url&quot;: &quot;https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty&quot;
</span><span class="cx">             }
</span><span class="cx">         },
</span><ins>+        &quot;stroke-color&quot;: {
+            &quot;inherited&quot;: true,
+            &quot;codegen-properties&quot;: {
+                &quot;custom&quot;: &quot;Value&quot;,
+                &quot;initial&quot;: &quot;invalidColor&quot;,
+                &quot;visited-link-color-support&quot;: true
+            },
+            &quot;status&quot;: &quot;supported&quot;,
+            &quot;specification&quot;: {
+                &quot;category&quot;: &quot;css-text-fill-and-stroke&quot;,
+                &quot;url&quot;: &quot;https://drafts.fxtf.org/fill-stroke-3/#propdef-stroke-color&quot;
+            }
+        },
</ins><span class="cx">         &quot;stroke-width&quot;: {
</span><span class="cx">             &quot;inherited&quot;: true,
</span><span class="cx">             &quot;codegen-properties&quot;: {
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -140,6 +140,7 @@
</span><span class="cx">     static void applyValueWillChange(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx"> 
</span><span class="cx">     static void applyValueStrokeWidth(StyleResolver&amp;, CSSValue&amp;);
</span><ins>+    static void applyValueStrokeColor(StyleResolver&amp;, CSSValue&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     static void resetEffectiveZoom(StyleResolver&amp;);
</span><span class="lines">@@ -1788,4 +1789,14 @@
</span><span class="cx">     styleResolver.style()-&gt;setHasExplicitlySetStrokeWidth(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline void StyleBuilderCustom::applyValueStrokeColor(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
+    if (styleResolver.applyPropertyToRegularStyle())
+        styleResolver.style()-&gt;setStrokeColor(styleResolver.colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ false));
+    if (styleResolver.applyPropertyToVisitedLinkStyle())
+        styleResolver.style()-&gt;setVisitedLinkStrokeColor(styleResolver.colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
+    styleResolver.style()-&gt;setHasExplicitlySetStrokeColor(true);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -1468,6 +1468,7 @@
</span><span class="cx">     case CSSPropertyWebkitTextStrokeColor:
</span><span class="cx">     case CSSPropertyFill:
</span><span class="cx">     case CSSPropertyStroke:
</span><ins>+    case CSSPropertyStrokeColor:
</ins><span class="cx">         return true;
</span><span class="cx">     default:
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -168,6 +168,7 @@
</span><span class="cx">     case CSSPropertyOutlineColor:
</span><span class="cx">     case CSSPropertyStopColor:
</span><span class="cx">     case CSSPropertyStroke:
</span><ins>+    case CSSPropertyStrokeColor:
</ins><span class="cx">     case CSSPropertyWebkitBorderAfterColor:
</span><span class="cx">     case CSSPropertyWebkitBorderBeforeColor:
</span><span class="cx">     case CSSPropertyWebkitBorderEndColor:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -4014,6 +4014,7 @@
</span><span class="cx">     case CSSPropertyWebkitBorderBeforeColor:
</span><span class="cx">     case CSSPropertyWebkitBorderAfterColor:
</span><span class="cx">     case CSSPropertyWebkitTextStrokeColor:
</span><ins>+    case CSSPropertyStrokeColor:
</ins><span class="cx">     case CSSPropertyStopColor:
</span><span class="cx">     case CSSPropertyFloodColor:
</span><span class="cx">     case CSSPropertyLightingColor:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextDecorationPaintercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextDecorationPainter.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextDecorationPainter.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/TextDecorationPainter.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx">         return result;
</span><span class="cx">     if (style.hasPositiveStrokeWidth()) {
</span><span class="cx">         // Prefer stroke color if possible but not if it's fully transparent.
</span><del>-        result = style.visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</del><ins>+        result = style.visitedDependentColor(style.hasExplicitlySetStrokeColor() ? CSSPropertyStrokeColor :  CSSPropertyWebkitTextStrokeColor);
</ins><span class="cx">         if (result.isVisible())
</span><span class="cx">             return result;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextPaintStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextPaintStyle.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">     if (forceBackgroundToWhite)
</span><span class="cx">         paintStyle.fillColor = adjustColorForVisibilityOnBackground(paintStyle.fillColor, Color::white);
</span><span class="cx"> 
</span><del>-    paintStyle.strokeColor = lineStyle.visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</del><ins>+    paintStyle.strokeColor = lineStyle.visitedDependentColor(lineStyle.hasExplicitlySetStrokeColor() ? CSSPropertyStrokeColor : CSSPropertyWebkitTextStrokeColor);
</ins><span class="cx"> 
</span><span class="cx">     // Make the text stroke color legible against a white background
</span><span class="cx">     if (forceBackgroundToWhite)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">             selectionPaintStyle.strokeWidth = strokeWidth;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        Color stroke = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : pseudoStyle-&gt;visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</del><ins>+        Color stroke = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : pseudoStyle-&gt;visitedDependentColor(pseudoStyle-&gt;hasExplicitlySetStrokeColor() ? CSSPropertyStrokeColor : CSSPropertyWebkitTextStrokeColor);
</ins><span class="cx">         if (stroke != selectionPaintStyle.strokeColor) {
</span><span class="cx">             if (!paintSelectedTextOnly)
</span><span class="cx">                 paintSelectedTextSeparately = true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -886,7 +886,8 @@
</span><span class="cx">         || m_rareInheritedData-&gt;textFillColor != other.m_rareInheritedData-&gt;textFillColor
</span><span class="cx">         || m_rareInheritedData-&gt;textStrokeColor != other.m_rareInheritedData-&gt;textStrokeColor
</span><span class="cx">         || m_rareInheritedData-&gt;textEmphasisColor != other.m_rareInheritedData-&gt;textEmphasisColor
</span><del>-        || m_rareInheritedData-&gt;textEmphasisFill != other.m_rareInheritedData-&gt;textEmphasisFill)
</del><ins>+        || m_rareInheritedData-&gt;textEmphasisFill != other.m_rareInheritedData-&gt;textEmphasisFill
+        || m_rareInheritedData-&gt;strokeColor != other.m_rareInheritedData-&gt;strokeColor)
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="lines">@@ -1755,6 +1756,9 @@
</span><span class="cx">     case CSSPropertyWebkitTextStrokeColor:
</span><span class="cx">         result = visitedLink ? visitedLinkTextStrokeColor() : textStrokeColor();
</span><span class="cx">         break;
</span><ins>+    case CSSPropertyStrokeColor:
+        result = visitedLink ? visitedLinkStrokeColor() : strokeColor();
+        break;
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -1268,6 +1268,13 @@
</span><span class="cx">     bool hasExplicitlySetStrokeWidth() const { return m_rareInheritedData-&gt;hasSetStrokeWidth; };
</span><span class="cx">     bool hasPositiveStrokeWidth() const;
</span><span class="cx">     
</span><ins>+    Color strokeColor() const { return m_rareInheritedData-&gt;strokeColor; }
+    void setStrokeColor(const Color&amp; v)  { SET_VAR(m_rareInheritedData, strokeColor, v); }
+    void setVisitedLinkStrokeColor(const Color&amp; v) { SET_VAR(m_rareInheritedData, visitedLinkStrokeColor, v); }
+    const Color&amp; visitedLinkStrokeColor() const { return m_rareInheritedData-&gt;visitedLinkStrokeColor; }
+    void setHasExplicitlySetStrokeColor(bool v) { SET_VAR(m_rareInheritedData, hasSetStrokeColor, static_cast&lt;unsigned&gt;(v)); }
+    bool hasExplicitlySetStrokeColor() const { return m_rareInheritedData-&gt;hasSetStrokeColor; };
+    
</ins><span class="cx">     float strokeMiterLimit() const { return m_rareInheritedData-&gt;miterLimit; }
</span><span class="cx">     void setStrokeMiterLimit(float f) { SET_VAR(m_rareInheritedData, miterLimit, f); }
</span><span class="cx">     static float initialStrokeMiterLimit() { return defaultMiterLimit; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">     void* styleImage;
</span><span class="cx">     Color firstColor;
</span><span class="cx">     float firstFloat;
</span><del>-    Color colors[5];
</del><ins>+    Color colors[7];
</ins><span class="cx">     void* ownPtrs[1];
</span><span class="cx">     AtomicString atomicStrings[5];
</span><span class="cx">     void* refPtrs[2];
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx">     , capStyle(RenderStyle::initialCapStyle())
</span><span class="cx">     , joinStyle(RenderStyle::initialJoinStyle())
</span><span class="cx">     , hasSetStrokeWidth(false)
</span><ins>+    , hasSetStrokeColor(false)
</ins><span class="cx">     , strokeWidth(RenderStyle::initialOneLength())
</span><span class="cx">     , miterLimit(RenderStyle::initialStrokeMiterLimit())
</span><span class="cx">     , hyphenationLimitBefore(-1)
</span><span class="lines">@@ -217,7 +218,10 @@
</span><span class="cx">     , capStyle(o.capStyle)
</span><span class="cx">     , joinStyle(o.joinStyle)
</span><span class="cx">     , hasSetStrokeWidth(o.hasSetStrokeWidth)
</span><ins>+    , hasSetStrokeColor(o.hasSetStrokeColor)
</ins><span class="cx">     , strokeWidth(o.strokeWidth)
</span><ins>+    , strokeColor(o.strokeColor)
+    , visitedLinkStrokeColor(o.visitedLinkStrokeColor)
</ins><span class="cx">     , miterLimit(o.miterLimit)
</span><span class="cx">     , hyphenationString(o.hyphenationString)
</span><span class="cx">     , hyphenationLimitBefore(o.hyphenationLimitBefore)
</span><span class="lines">@@ -329,7 +333,10 @@
</span><span class="cx">         &amp;&amp; capStyle == o.capStyle
</span><span class="cx">         &amp;&amp; joinStyle == o.joinStyle
</span><span class="cx">         &amp;&amp; hasSetStrokeWidth == o.hasSetStrokeWidth
</span><ins>+        &amp;&amp; hasSetStrokeColor == o.hasSetStrokeColor
</ins><span class="cx">         &amp;&amp; strokeWidth == o.strokeWidth
</span><ins>+        &amp;&amp; strokeColor == o.strokeColor
+        &amp;&amp; visitedLinkStrokeColor == o.visitedLinkStrokeColor
</ins><span class="cx">         &amp;&amp; miterLimit == o.miterLimit
</span><span class="cx">         &amp;&amp; customProperties == o.customProperties
</span><span class="cx">         &amp;&amp; arePointingToEqualData(listStyleImage, o.listStyleImage);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (215260 => 215261)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2017-04-12 07:29:33 UTC (rev 215260)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2017-04-12 08:01:51 UTC (rev 215261)
</span><span class="lines">@@ -140,7 +140,10 @@
</span><span class="cx">     unsigned capStyle : 2; // LineCap
</span><span class="cx">     unsigned joinStyle : 2; // LineJoin
</span><span class="cx">     unsigned hasSetStrokeWidth : 1;
</span><del>-    Length strokeWidth;    
</del><ins>+    unsigned hasSetStrokeColor : 1;
+    Length strokeWidth;
+    Color strokeColor;
+    Color visitedLinkStrokeColor;
</ins><span class="cx">     float miterLimit;
</span><span class="cx"> 
</span><span class="cx">     AtomicString hyphenationString;
</span></span></pre>
</div>
</div>

</body>
</html>