<!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>[213634] 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/213634">213634</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2017-03-09 01:51:04 -0800 (Thu, 09 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement stroke-width CSS property.
https://bugs.webkit.org/show_bug.cgi?id=169273

Reviewed by Simon Fraser.

Source/WebCore:

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

Tests: fast/css/stroke-width-percent.html
       fast/css/stroke-width.html

* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueStrokeWidth):
(WebCore::StyleBuilderCustom::applyValueWebkitTextStrokeWidth):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeOverflow):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::computeTextSelectionPaintStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::computedTextStrokeWidth):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setHasExplicitlySetStrokeWidth):
(WebCore::RenderStyle::hasExplicitlySetStrokeWidth):
(WebCore::RenderStyle::setHasExplicitlySetWebKitTextStrokeWidth):
(WebCore::RenderStyle::hasExplicitlySetWebKitTextStrokeWidth):
(WebCore::RenderStyle::InheritedFlags::operator==):

LayoutTests:

* fast/css/stroke-width-expected.html: Added.
* fast/css/stroke-width-percent-expected.html: Added.
* fast/css/stroke-width-percent.html: Added.
* fast/css/stroke-width.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="#trunkSourceWebCorecssCSSPropertiesjson">trunk/Source/WebCore/css/CSSProperties.json</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp">trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.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="#trunkLayoutTestsfastcssstrokewidthexpectedhtml">trunk/LayoutTests/fast/css/stroke-width-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokewidthpercentexpectedhtml">trunk/LayoutTests/fast/css/stroke-width-percent-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokewidthpercenthtml">trunk/LayoutTests/fast/css/stroke-width-percent.html</a></li>
<li><a href="#trunkLayoutTestsfastcssstrokewidthhtml">trunk/LayoutTests/fast/css/stroke-width.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/LayoutTests/ChangeLog        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-03-08  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+        Implement stroke-width CSS property.
+        https://bugs.webkit.org/show_bug.cgi?id=169273
+
+        Reviewed by Simon Fraser.
+
+        * fast/css/stroke-width-expected.html: Added.
+        * fast/css/stroke-width-percent-expected.html: Added.
+        * fast/css/stroke-width-percent.html: Added.
+        * fast/css/stroke-width.html: Added.
+
</ins><span class="cx"> 2017-03-09  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Loading in-body stylesheets should not block rendering of elements before them
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokewidthexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-width-expected.html (0 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-width-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-width-expected.html        2017-03-09 09:51:04 UTC (rev 213634)
</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-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;-webkit-text-stroke-width: 25px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 0.2in;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 2mm;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 0.1cm;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;-webkit-text-stroke-width: 25px;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 0.2in;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 2mm;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;-webkit-text-stroke-width: 0.1cm;&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="trunkLayoutTestsfastcssstrokewidthpercentexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-width-percent-expected.html (0 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-width-percent-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-width-percent-expected.html        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 200px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;stroke-width: 0px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 7px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 14px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 35px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 70px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokewidthpercenthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-width-percent.html (0 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-width-percent.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-width-percent.html        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        div {
+            font-size: 200px;
+            color: gray;
+            text-shadow: none;
+            -webkit-text-stroke-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;stroke-width: 0%;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 1%;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 2%;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 5%;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 10%;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssstrokewidthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/stroke-width.html (0 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/stroke-width.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/stroke-width.html        2017-03-09 09:51:04 UTC (rev 213634)
</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-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div style=&quot;stroke-width: 25px;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 0.2in;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 2mm;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 0.1cm;&quot;&gt;&amp;#x25fc;&lt;/div&gt;
+
+&lt;div style=&quot;stroke-width: 25px;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 0.2in;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 2mm;&quot;&gt;&lt;span&gt;&amp;#x25fc;&lt;/span&gt;&lt;/div&gt;
+&lt;div style=&quot;stroke-width: 0.1cm;&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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/ChangeLog        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2017-03-08  Per Arne Vollan  &lt;pvollan@apple.com&gt;
+
+        Implement stroke-width CSS property.
+        https://bugs.webkit.org/show_bug.cgi?id=169273
+
+        Reviewed by Simon Fraser.
+
+        Support setting text stroke width using the CSS property stroke-width, see https://drafts.fxtf.org/paint/.
+        Text stroke width can currently be set with the -webkit-text-stroke-width property. To make sure this still
+        works, I added a check to determine if the stroke-width property has been explicitly set. If it has not been
+        set, we fall back to the value of the -webkit-text-stroke-width property.
+
+        Tests: fast/css/stroke-width-percent.html
+               fast/css/stroke-width.html
+
+        * css/CSSProperties.json:
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueStrokeWidth):
+        (WebCore::StyleBuilderCustom::applyValueWebkitTextStrokeWidth):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::addToLine):
+        (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::computeOverflow):
+        * rendering/TextDecorationPainter.cpp:
+        (WebCore::decorationColor):
+        * rendering/TextPaintStyle.cpp:
+        (WebCore::computeTextPaintStyle):
+        (WebCore::computeTextSelectionPaintStyle):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::RenderStyle):
+        (WebCore::RenderStyle::computedTextStrokeWidth):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::setHasExplicitlySetStrokeWidth):
+        (WebCore::RenderStyle::hasExplicitlySetStrokeWidth):
+        (WebCore::RenderStyle::setHasExplicitlySetWebKitTextStrokeWidth):
+        (WebCore::RenderStyle::hasExplicitlySetWebKitTextStrokeWidth):
+        (WebCore::RenderStyle::InheritedFlags::operator==):
+
</ins><span class="cx"> 2017-03-09  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allow the page to render before &lt;link&gt; stylesheet tags in body
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertiesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSProperties.json (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSProperties.json        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/css/CSSProperties.json        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -3028,6 +3028,7 @@
</span><span class="cx">         &quot;stroke-width&quot;: {
</span><span class="cx">             &quot;inherited&quot;: true,
</span><span class="cx">             &quot;codegen-properties&quot;: {
</span><ins>+                &quot;custom&quot;: &quot;Value&quot;,
</ins><span class="cx">                 &quot;initial&quot;: &quot;initialOneLength&quot;,
</span><span class="cx">                 &quot;converter&quot;: &quot;Length&quot;
</span><span class="cx">             },
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -139,6 +139,8 @@
</span><span class="cx">     static void applyValueAlt(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static void applyValueWillChange(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx"> 
</span><ins>+    static void applyValueStrokeWidth(StyleResolver&amp;, CSSValue&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     static void resetEffectiveZoom(StyleResolver&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -1780,4 +1782,10 @@
</span><span class="cx">     styleResolver.style()-&gt;setWillChange(WTFMove(willChange));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline void StyleBuilderCustom::applyValueStrokeWidth(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    styleResolver.style()-&gt;setStrokeWidth(StyleBuilderConverter::convertLength(styleResolver, value));
+    styleResolver.style()-&gt;setHasExplicitlySetStrokeWidth(true);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">         const RenderStyle&amp; childStyle = child-&gt;lineStyle();
</span><span class="cx">         if (child-&gt;behavesLikeText()) {
</span><span class="cx">             const RenderStyle* childStyle = &amp;child-&gt;lineStyle();
</span><del>-            if (childStyle-&gt;letterSpacing() &lt; 0 || childStyle-&gt;textShadow() || childStyle-&gt;textEmphasisMark() != TextEmphasisMarkNone || childStyle-&gt;textStrokeWidth())
</del><ins>+            if (childStyle-&gt;letterSpacing() &lt; 0 || childStyle-&gt;textShadow() || childStyle-&gt;textEmphasisMark() != TextEmphasisMarkNone || childStyle-&gt;hasPositiveStrokeWidth())
</ins><span class="cx">                 child-&gt;clearKnownToHaveNoOverflow();
</span><span class="cx">         } else if (child-&gt;renderer().isReplaced()) {
</span><span class="cx">             const RenderBox&amp; box = downcast&lt;RenderBox&gt;(child-&gt;renderer());
</span><span class="lines">@@ -904,7 +904,8 @@
</span><span class="cx">     int leftGlyphEdge = glyphOverflow ? glyphOverflow-&gt;left : 0;
</span><span class="cx">     int rightGlyphEdge = glyphOverflow ? glyphOverflow-&gt;right : 0;
</span><span class="cx"> 
</span><del>-    int strokeOverflow = static_cast&lt;int&gt;(ceilf(lineStyle.textStrokeWidth() / 2.0f));
</del><ins>+    auto viewportSize = textBox.renderer().frame().view() ? textBox.renderer().frame().view()-&gt;size() : IntSize();
+    int strokeOverflow = std::ceil(lineStyle.computedStrokeWidth(viewportSize) / 2.0f);
</ins><span class="cx">     int topGlyphOverflow = -strokeOverflow - topGlyphEdge;
</span><span class="cx">     int bottomGlyphOverflow = strokeOverflow + bottomGlyphEdge;
</span><span class="cx">     int leftGlyphOverflow = -strokeOverflow - leftGlyphEdge;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -68,7 +68,8 @@
</span><span class="cx"> static FloatRect computeOverflow(const RenderBlockFlow&amp; flow, const FloatRect&amp; layoutRect)
</span><span class="cx"> {
</span><span class="cx">     auto overflowRect = layoutRect;
</span><del>-    auto strokeOverflow = std::ceil(flow.style().textStrokeWidth());
</del><ins>+    auto viewportSize = flow.frame().view() ? flow.frame().view()-&gt;size() : IntSize();
+    auto strokeOverflow = std::ceil(flow.style().computedStrokeWidth(viewportSize));
</ins><span class="cx">     overflowRect.inflate(strokeOverflow);
</span><span class="cx"> 
</span><span class="cx">     auto letterSpacing = flow.style().fontCascade().letterSpacing();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextDecorationPaintercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextDecorationPainter.cpp (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextDecorationPainter.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/TextDecorationPainter.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -357,7 +357,7 @@
</span><span class="cx">     Color result = style.visitedDependentColor(CSSPropertyWebkitTextDecorationColor);
</span><span class="cx">     if (result.isValid())
</span><span class="cx">         return result;
</span><del>-    if (style.textStrokeWidth() &gt; 0) {
</del><ins>+    if (style.hasPositiveStrokeWidth()) {
</ins><span class="cx">         // Prefer stroke color if possible but not if it's fully transparent.
</span><span class="cx">         result = style.visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
</span><span class="cx">         if (result.isVisible())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextPaintStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextPaintStyle.cpp (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/TextPaintStyle.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -67,7 +67,8 @@
</span><span class="cx"> #if ENABLE(LETTERPRESS)
</span><span class="cx">     paintStyle.useLetterpressEffect = lineStyle.textDecorationsInEffect() &amp; TextDecorationLetterpress;
</span><span class="cx"> #endif
</span><del>-    paintStyle.strokeWidth = lineStyle.textStrokeWidth();
</del><ins>+    auto viewportSize = frame.view() ? frame.view()-&gt;size() : IntSize();
+    paintStyle.strokeWidth = lineStyle.computedStrokeWidth(viewportSize);
</ins><span class="cx">     paintStyle.paintOrder = lineStyle.paintOrder();
</span><span class="cx">     paintStyle.lineJoin = lineStyle.joinStyle();
</span><span class="cx">     paintStyle.lineCap = lineStyle.capStyle();
</span><span class="lines">@@ -148,7 +149,8 @@
</span><span class="cx">             selectionShadow = shadow;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        float strokeWidth = pseudoStyle-&gt;textStrokeWidth();
</del><ins>+        auto viewportSize = renderer.frame().view() ? renderer.frame().view()-&gt;size() : IntSize();
+        float strokeWidth = pseudoStyle-&gt;computedStrokeWidth(viewportSize);
</ins><span class="cx">         if (strokeWidth != selectionPaintStyle.strokeWidth) {
</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 (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -2259,5 +2259,34 @@
</span><span class="cx">     return paintOrder;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float RenderStyle::computedStrokeWidth(const IntSize&amp; viewportSize) const
+{
+    if (!hasExplicitlySetStrokeWidth())
+        return textStrokeWidth();
+    
+    const Length&amp; length = strokeWidth();
</ins><span class="cx"> 
</span><ins>+    if (length.isPercent()) {
+        // According to the spec, https://drafts.fxtf.org/paint/#stroke-width, the percentage is relative to the scaled viewport size.
+        // The scaled viewport size is the geometric mean of the viewport width and height.
+        ExceptionOr&lt;float&gt; result = length.value() * (viewportSize.width() + viewportSize.height()) / 200.0f;
+        if (result.hasException())
+            return 0;
+        return result.releaseReturnValue();
+    }
+    
+    if (length.isAuto() || !length.isSpecified())
+        return 0;
+    
+    return floatValueForLength(length, viewportSize.width());
+}
+
+bool RenderStyle::hasPositiveStrokeWidth() const
+{
+    if (!hasExplicitlySetStrokeWidth())
+        return textStrokeWidth() &gt; 0;
+
+    return strokeWidth().isPositive();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -1257,7 +1257,12 @@
</span><span class="cx">     void setStrokeWidth(Length&amp;&amp; w) { SET_VAR(m_rareInheritedData, strokeWidth, WTFMove(w)); }
</span><span class="cx">     bool hasVisibleStroke() const { return svgStyle().hasStroke() &amp;&amp; !strokeWidth().isZero(); }
</span><span class="cx"> 
</span><ins>+    float computedStrokeWidth(const IntSize&amp; viewportSize) const;
+    void setHasExplicitlySetStrokeWidth(bool v) { SET_VAR(m_rareInheritedData, hasSetStrokeWidth, static_cast&lt;unsigned&gt;(v)); }
+    bool hasExplicitlySetStrokeWidth() const { return m_rareInheritedData-&gt;hasSetStrokeWidth; };
+    bool hasPositiveStrokeWidth() const;
</ins><span class="cx">     
</span><ins>+    
</ins><span class="cx">     const SVGRenderStyle&amp; svgStyle() const { return m_svgStyle; }
</span><span class="cx">     SVGRenderStyle&amp; accessSVGStyle() { return m_svgStyle.access(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">     , paintOrder(static_cast&lt;unsigned&gt;(RenderStyle::initialPaintOrder()))
</span><span class="cx">     , capStyle(RenderStyle::initialCapStyle())
</span><span class="cx">     , joinStyle(RenderStyle::initialJoinStyle())
</span><ins>+    , hasSetStrokeWidth(false)
</ins><span class="cx">     , strokeWidth(RenderStyle::initialOneLength())
</span><span class="cx">     , hyphenationLimitBefore(-1)
</span><span class="cx">     , hyphenationLimitAfter(-1)
</span><span class="lines">@@ -214,6 +215,7 @@
</span><span class="cx">     , paintOrder(o.paintOrder)
</span><span class="cx">     , capStyle(o.capStyle)
</span><span class="cx">     , joinStyle(o.joinStyle)
</span><ins>+    , hasSetStrokeWidth(o.hasSetStrokeWidth)
</ins><span class="cx">     , strokeWidth(o.strokeWidth)
</span><span class="cx">     , hyphenationString(o.hyphenationString)
</span><span class="cx">     , hyphenationLimitBefore(o.hyphenationLimitBefore)
</span><span class="lines">@@ -324,6 +326,7 @@
</span><span class="cx">         &amp;&amp; paintOrder == o.paintOrder
</span><span class="cx">         &amp;&amp; capStyle == o.capStyle
</span><span class="cx">         &amp;&amp; joinStyle == o.joinStyle
</span><ins>+        &amp;&amp; hasSetStrokeWidth == o.hasSetStrokeWidth
</ins><span class="cx">         &amp;&amp; strokeWidth == o.strokeWidth
</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 (213633 => 213634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2017-03-09 09:07:08 UTC (rev 213633)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2017-03-09 09:51:04 UTC (rev 213634)
</span><span class="lines">@@ -139,8 +139,9 @@
</span><span class="cx">     unsigned paintOrder : 3; // PaintOrder
</span><span class="cx">     unsigned capStyle : 2; // LineCap
</span><span class="cx">     unsigned joinStyle : 2; // LineJoin
</span><del>-    Length strokeWidth;
-    
</del><ins>+    unsigned hasSetStrokeWidth : 1;
+    Length strokeWidth;    
+
</ins><span class="cx">     AtomicString hyphenationString;
</span><span class="cx">     short hyphenationLimitBefore;
</span><span class="cx">     short hyphenationLimitAfter;
</span></span></pre>
</div>
</div>

</body>
</html>