<!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>[172711] 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/172711">172711</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-18 11:18:16 -0700 (Mon, 18 Aug 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>calc() doesn't work for SVG CSS properties
https://bugs.webkit.org/show_bug.cgi?id=136026
Reviewed by Andreas Kling.
Source/WebCore:
Make calc() work on SVG CSS properties as well. stroke-width and
stroke-dashoffset used SVGLength. SVGLength doesn't work together with
cross units length arguments like % and px (just returns 0 in these
cases). I moved these properties over to Length. All modified files
beside to SVGCSSParser are related to this switch.
Test: svg/css/parse-calc-length.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setStrokeWidth):
(WebCore::SVGRenderStyle::setStrokeDashOffset):
(WebCore::SVGRenderStyle::strokeWidth):
(WebCore::SVGRenderStyle::strokeDashOffset):
(WebCore::SVGRenderStyle::initialStrokeDashOffset): Deleted.
(WebCore::SVGRenderStyle::initialStrokeWidth): Deleted.
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleStrokeData::StyleStrokeData):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::strokeWidth):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::strokeBoundingBox):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength):
LayoutTests:
Test calc() on length properties for SVG.
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/parse-calc-length-expected.txt: Added.
* svg/css/parse-calc-length.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylecomputedstyleexpectedtxt">trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgetComputedStylecomputedstylewithoutrendererexpectedtxt">trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt">trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt</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="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSParsercpp">trunk/Source/WebCore/css/SVGCSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSStyleSelectorcpp">trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleSVGRenderStyleh">trunk/Source/WebCore/rendering/style/SVGRenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleSVGRenderStyleDefscpp">trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleSVGRenderStyleDefsh">trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGShapecpp">trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderSupportcpp">trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContextcpp">trunk/Source/WebCore/svg/SVGLengthContext.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcssparsecalclengthexpectedtxt">trunk/LayoutTests/svg/css/parse-calc-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcssparsecalclengthhtml">trunk/LayoutTests/svg/css/parse-calc-length.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/LayoutTests/ChangeLog        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-08-18 Dirk Schulze <krit@webkit.org>
+
+ calc() doesn't work for SVG CSS properties
+ https://bugs.webkit.org/show_bug.cgi?id=136026
+
+ Reviewed by Andreas Kling.
+
+ Test calc() on length properties for SVG.
+
+ * svg/css/getComputedStyle-basic-expected.txt:
+ * svg/css/parse-calc-length-expected.txt: Added.
+ * svg/css/parse-calc-length.html: Added.
+
</ins><span class="cx"> 2014-08-18 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylecomputedstyleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -240,12 +240,12 @@
</span><span class="cx"> shape-rendering: auto;
</span><span class="cx"> stroke: none;
</span><span class="cx"> stroke-dasharray: none;
</span><del>-stroke-dashoffset: 0;
</del><ins>+stroke-dashoffset: 0px;
</ins><span class="cx"> stroke-linecap: butt;
</span><span class="cx"> stroke-linejoin: miter;
</span><span class="cx"> stroke-miterlimit: 4;
</span><span class="cx"> stroke-opacity: 1;
</span><del>-stroke-width: 1;
</del><ins>+stroke-width: 1px;
</ins><span class="cx"> alignment-baseline: auto;
</span><span class="cx"> baseline-shift: baseline;
</span><span class="cx"> dominant-baseline: auto;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetComputedStylecomputedstylewithoutrendererexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -239,12 +239,12 @@
</span><span class="cx"> shape-rendering: auto
</span><span class="cx"> stroke: none
</span><span class="cx"> stroke-dasharray: none
</span><del>-stroke-dashoffset: 0
</del><ins>+stroke-dashoffset: 0px
</ins><span class="cx"> stroke-linecap: butt
</span><span class="cx"> stroke-linejoin: miter
</span><span class="cx"> stroke-miterlimit: 4
</span><span class="cx"> stroke-opacity: 1
</span><del>-stroke-width: 1
</del><ins>+stroke-width: 1px
</ins><span class="cx"> alignment-baseline: auto
</span><span class="cx"> baseline-shift: baseline
</span><span class="cx"> dominant-baseline: auto
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -478,7 +478,7 @@
</span><span class="cx"> rect: style.getPropertyCSSValue(stroke) : [object SVGPaint]
</span><span class="cx"> rect: style.getPropertyValue(stroke-dasharray) : none
</span><span class="cx"> rect: style.getPropertyCSSValue(stroke-dasharray) : [object CSSPrimitiveValue]
</span><del>-rect: style.getPropertyValue(stroke-dashoffset) : 0
</del><ins>+rect: style.getPropertyValue(stroke-dashoffset) : 0px
</ins><span class="cx"> rect: style.getPropertyCSSValue(stroke-dashoffset) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(stroke-linecap) : butt
</span><span class="cx"> rect: style.getPropertyCSSValue(stroke-linecap) : [object CSSPrimitiveValue]
</span><span class="lines">@@ -990,7 +990,7 @@
</span><span class="cx"> g: style.getPropertyCSSValue(stroke) : [object SVGPaint]
</span><span class="cx"> g: style.getPropertyValue(stroke-dasharray) : none
</span><span class="cx"> g: style.getPropertyCSSValue(stroke-dasharray) : [object CSSPrimitiveValue]
</span><del>-g: style.getPropertyValue(stroke-dashoffset) : 0
</del><ins>+g: style.getPropertyValue(stroke-dashoffset) : 0px
</ins><span class="cx"> g: style.getPropertyCSSValue(stroke-dashoffset) : [object CSSPrimitiveValue]
</span><span class="cx"> g: style.getPropertyValue(stroke-linecap) : butt
</span><span class="cx"> g: style.getPropertyCSSValue(stroke-linecap) : [object CSSPrimitiveValue]
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssparsecalclengthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-calc-length-expected.txt (0 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-calc-length-expected.txt         (rev 0)
+++ trunk/LayoutTests/svg/css/parse-calc-length-expected.txt        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute height="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute rx="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute ry="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute width="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute x="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute y="calc(500px - 400px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute height="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute rx="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute ry="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute width="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute x="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute y="calc(40px + 60px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute height="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute rx="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute ry="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute width="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute x="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute y="calc(0% + 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute height="calc(100% - 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute rx="calc(100% - 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute ry="calc(100% - 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute width="calc(100% - 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute x="calc(100% - 100px)"
+CONSOLE MESSAGE: Error: Invalid value for <rect> attribute y="calc(100% - 100px)"
+Test that length values for presentation attribute accept calc.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS computedStyle("baseline-shift", "calc(500px - 400px)") is "100px"
+PASS computedStyle("cx", "calc(500px - 400px)") is "100px"
+PASS computedStyle("cy", "calc(500px - 400px)") is "100px"
+PASS computedStyle("height", "calc(500px - 400px)") is "100px"
+PASS computedStyle("kerning", "calc(500px - 400px)") is "100px"
+PASS computedStyle("r", "calc(500px - 400px)") is "100px"
+PASS computedStyle("rx", "calc(500px - 400px)") is "100px"
+PASS computedStyle("ry", "calc(500px - 400px)") is "100px"
+PASS computedStyle("stroke-width", "calc(500px - 400px)") is "100px"
+PASS computedStyle("stroke-dashoffset", "calc(500px - 400px)") is "100px"
+PASS computedStyle("width", "calc(500px - 400px)") is "100px"
+PASS computedStyle("x", "calc(500px - 400px)") is "100px"
+PASS computedStyle("y", "calc(500px - 400px)") is "100px"
+PASS computedStyle("baseline-shift", "calc(40px + 60px)") is "100px"
+PASS computedStyle("cx", "calc(40px + 60px)") is "100px"
+PASS computedStyle("cy", "calc(40px + 60px)") is "100px"
+PASS computedStyle("height", "calc(40px + 60px)") is "100px"
+PASS computedStyle("kerning", "calc(40px + 60px)") is "100px"
+PASS computedStyle("r", "calc(40px + 60px)") is "100px"
+PASS computedStyle("rx", "calc(40px + 60px)") is "100px"
+PASS computedStyle("ry", "calc(40px + 60px)") is "100px"
+PASS computedStyle("stroke-width", "calc(40px + 60px)") is "100px"
+PASS computedStyle("stroke-dashoffset", "calc(40px + 60px)") is "100px"
+PASS computedStyle("width", "calc(40px + 60px)") is "100px"
+PASS computedStyle("x", "calc(40px + 60px)") is "100px"
+PASS computedStyle("y", "calc(40px + 60px)") is "100px"
+PASS computedStyle("baseline-shift", "calc(0% + 100px)") is "0"
+PASS computedStyle("cx", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("cy", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("height", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("kerning", "calc(0% + 100px)") is "0"
+PASS computedStyle("r", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("rx", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("ry", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("stroke-width", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("stroke-dashoffset", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("width", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("x", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("y", "calc(0% + 100px)") is "calc(0% + 100px)"
+PASS computedStyle("baseline-shift", "calc(100% - 100px)") is "0"
+PASS computedStyle("cx", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("cy", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("height", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("kerning", "calc(100% - 100px)") is "0"
+PASS computedStyle("r", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("rx", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("ry", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("stroke-width", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("stroke-dashoffset", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("width", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("x", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("y", "calc(100% - 100px)") is "calc(100% - 100px)"
+PASS computedStyle("stroke-miterlimit", "calc(500 - 400)") is "100"
+PASS computedStyle("flood-opacity", "calc(500 - 400)") is "100"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcssparsecalclengthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-calc-length.html (0 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-calc-length.html         (rev 0)
+++ trunk/LayoutTests/svg/css/parse-calc-length.html        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<style>
+* { font-size: 16px; }
+svg, rect { font-family: 'Ahem'; }
+div { font-size: 8px; }
+</style>
+<html>
+<svg id="svg" width="0" height="0"></svg>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Test that length values for presentation attribute accept calc.");
+
+function computedStyle(property, value) {
+ var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+ document.getElementById('svg').appendChild(rect);
+ rect.setAttribute(property, value);
+ var computedValue = getComputedStyle(rect).getPropertyValue(property);
+ document.getElementById('svg').removeChild(rect);
+ return computedValue;
+}
+
+function testComputed(property, value, expected) {
+ shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
+}
+
+function negativeTest(property, value) {
+ testComputed(property, value, "auto");
+}
+
+function negativeTestZero(property, value) {
+ testComputed(property, value, "0px");
+}
+
+// Test 'calc(500px - 400px)'.
+testComputed("baseline-shift", "calc(500px - 400px)", "100px");
+testComputed("cx", "calc(500px - 400px)", "100px");
+testComputed("cy", "calc(500px - 400px)", "100px");
+testComputed("height", "calc(500px - 400px)", "100px");
+testComputed("kerning", "calc(500px - 400px)", "100px");
+testComputed("r", "calc(500px - 400px)", "100px");
+testComputed("rx", "calc(500px - 400px)", "100px");
+testComputed("ry", "calc(500px - 400px)", "100px");
+testComputed("stroke-width", "calc(500px - 400px)", "100px");
+testComputed("stroke-dashoffset", "calc(500px - 400px)", "100px");
+testComputed("width", "calc(500px - 400px)", "100px")
+testComputed("x", "calc(500px - 400px)", "100px");
+testComputed("y", "calc(500px - 400px)", "100px");
+
+// Test 'calc(40px + 60px)'.
+testComputed("baseline-shift", "calc(40px + 60px)", "100px");
+testComputed("cx", "calc(40px + 60px)", "100px");
+testComputed("cy", "calc(40px + 60px)", "100px");
+testComputed("height", "calc(40px + 60px)", "100px");
+testComputed("kerning", "calc(40px + 60px)", "100px");
+testComputed("r", "calc(40px + 60px)", "100px");
+testComputed("rx", "calc(40px + 60px)", "100px");
+testComputed("ry", "calc(40px + 60px)", "100px");
+testComputed("stroke-width", "calc(40px + 60px)", "100px");
+testComputed("stroke-dashoffset", "calc(40px + 60px)", "100px");
+testComputed("width", "calc(40px + 60px)", "100px")
+testComputed("x", "calc(40px + 60px)", "100px");
+testComputed("y", "calc(40px + 60px)", "100px");
+
+// Test 'calc(0% + 100px)'.
+testComputed("baseline-shift", "calc(0% + 100px)", "0");
+testComputed("cx", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("cy", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("height", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("kerning", "calc(0% + 100px)", "0");
+testComputed("r", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("rx", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("ry", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("stroke-width", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("stroke-dashoffset", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("width", "calc(0% + 100px)", "calc(0% + 100px)")
+testComputed("x", "calc(0% + 100px)", "calc(0% + 100px)");
+testComputed("y", "calc(0% + 100px)", "calc(0% + 100px)");
+
+// Test 'calc(100% - 100px)'.
+testComputed("baseline-shift", "calc(100% - 100px)", "0");
+testComputed("cx", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("cy", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("height", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("kerning", "calc(100% - 100px)", "0");
+testComputed("r", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("rx", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("ry", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("stroke-width", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("stroke-dashoffset", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("width", "calc(100% - 100px)", "calc(100% - 100px)")
+testComputed("x", "calc(100% - 100px)", "calc(100% - 100px)");
+testComputed("y", "calc(100% - 100px)", "calc(100% - 100px)");
+
+// Number value properties.
+testComputed("stroke-miterlimit", "calc(500 - 400)", "100");
+testComputed("flood-opacity", "calc(500 - 400)", "100");
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/ChangeLog        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-08-18 Dirk Schulze <krit@webkit.org>
+
+ calc() doesn't work for SVG CSS properties
+ https://bugs.webkit.org/show_bug.cgi?id=136026
+
+ Reviewed by Andreas Kling.
+
+ Make calc() work on SVG CSS properties as well. stroke-width and
+ stroke-dashoffset used SVGLength. SVGLength doesn't work together with
+ cross units length arguments like % and px (just returns 0 in these
+ cases). I moved these properties over to Length. All modified files
+ beside to SVGCSSParser are related to this switch.
+
+ Test: svg/css/parse-calc-length.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+ * css/SVGCSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::svgPropertyValue):
+ * css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGValue):
+ * css/SVGCSSStyleSelector.cpp:
+ (WebCore::StyleResolver::applySVGProperty):
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/SVGRenderStyle.h:
+ (WebCore::SVGRenderStyle::setStrokeWidth):
+ (WebCore::SVGRenderStyle::setStrokeDashOffset):
+ (WebCore::SVGRenderStyle::strokeWidth):
+ (WebCore::SVGRenderStyle::strokeDashOffset):
+ (WebCore::SVGRenderStyle::initialStrokeDashOffset): Deleted.
+ (WebCore::SVGRenderStyle::initialStrokeWidth): Deleted.
+ * rendering/style/SVGRenderStyleDefs.cpp:
+ (WebCore::StyleStrokeData::StyleStrokeData):
+ * rendering/style/SVGRenderStyleDefs.h:
+ * rendering/svg/RenderSVGShape.cpp:
+ (WebCore::RenderSVGShape::strokeWidth):
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::strokeBoundingBox):
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writeStyle):
+ * svg/SVGLengthContext.cpp:
+ (WebCore::SVGLengthContext::valueForLength):
+
</ins><span class="cx"> 2014-08-18 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -2970,7 +2970,7 @@
</span><span class="cx"> case CSSPropertyBackgroundRepeatY:
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- // New positioning properties for SVG.
</del><ins>+ // Length properties for SVG.
</ins><span class="cx"> case CSSPropertyCx:
</span><span class="cx"> return zoomAdjustedPixelValueForLength(style->svgStyle().cx(), style.get());
</span><span class="cx"> case CSSPropertyCy:
</span><span class="lines">@@ -2981,6 +2981,10 @@
</span><span class="cx"> return zoomAdjustedPixelValueForLength(style->svgStyle().rx(), style.get());
</span><span class="cx"> case CSSPropertyRy:
</span><span class="cx"> return zoomAdjustedPixelValueForLength(style->svgStyle().ry(), style.get());
</span><ins>+ case CSSPropertyStrokeWidth:
+ return zoomAdjustedPixelValueForLength(style->svgStyle().strokeWidth(), style.get());
+ case CSSPropertyStrokeDashoffset:
+ return zoomAdjustedPixelValueForLength(style->svgStyle().strokeDashOffset(), style.get());
</ins><span class="cx"> case CSSPropertyX:
</span><span class="cx"> return zoomAdjustedPixelValueForLength(style->svgStyle().x(), style.get());
</span><span class="cx"> case CSSPropertyY:
</span><span class="lines">@@ -3103,12 +3107,10 @@
</span><span class="cx"> case CSSPropertyShapeRendering:
</span><span class="cx"> case CSSPropertyStroke:
</span><span class="cx"> case CSSPropertyStrokeDasharray:
</span><del>- case CSSPropertyStrokeDashoffset:
</del><span class="cx"> case CSSPropertyStrokeLinecap:
</span><span class="cx"> case CSSPropertyStrokeLinejoin:
</span><span class="cx"> case CSSPropertyStrokeMiterlimit:
</span><span class="cx"> case CSSPropertyStrokeOpacity:
</span><del>- case CSSPropertyStrokeWidth:
</del><span class="cx"> case CSSPropertyAlignmentBaseline:
</span><span class="cx"> case CSSPropertyBaselineShift:
</span><span class="cx"> case CSSPropertyDominantBaseline:
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -2599,6 +2599,8 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyR, ApplyPropertyLength<&RenderStyle::r, &RenderStyle::setR, &RenderStyle::initialZeroLength>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyRx, ApplyPropertyLength<&RenderStyle::rx, &RenderStyle::setRx, &RenderStyle::initialZeroLength>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyRy, ApplyPropertyLength<&RenderStyle::ry, &RenderStyle::setRy, &RenderStyle::initialZeroLength>::createHandler());
</span><ins>+ setPropertyHandler(CSSPropertyStrokeWidth, ApplyPropertyLength<&RenderStyle::strokeWidth, &RenderStyle::setStrokeWidth, &RenderStyle::initialOneLength>::createHandler());
+ setPropertyHandler(CSSPropertyStrokeDashoffset, ApplyPropertyLength<&RenderStyle::strokeDashOffset, &RenderStyle::setStrokeDashOffset, &RenderStyle::initialZeroLength>::createHandler());
</ins><span class="cx"> setPropertyHandler(CSSPropertyX, ApplyPropertyLength<&RenderStyle::x, &RenderStyle::setX, &RenderStyle::initialZeroLength>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyY, ApplyPropertyLength<&RenderStyle::y, &RenderStyle::setY, &RenderStyle::initialZeroLength>::createHandler());
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -190,10 +190,6 @@
</span><span class="cx"> return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle.strokePaintType(), svgStyle.strokePaintUri(), svgStyle.strokePaintColor()), style);
</span><span class="cx"> case CSSPropertyStrokeDasharray:
</span><span class="cx"> return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray());
</span><del>- case CSSPropertyStrokeDashoffset:
- return SVGLength::toCSSPrimitiveValue(svgStyle.strokeDashOffset());
- case CSSPropertyStrokeWidth:
- return SVGLength::toCSSPrimitiveValue(svgStyle.strokeWidth());
</del><span class="cx"> case CSSPropertyBaselineShift: {
</span><span class="cx"> switch (svgStyle.baselineShift()) {
</span><span class="cx"> case BS_BASELINE:
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSParser.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -324,12 +324,8 @@
</span><span class="cx"> parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
</span><span class="cx"> else if (value->unit >= CSSParserValue::Q_EMS)
</span><span class="cx"> parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fValue, CSSPrimitiveValue::CSS_EMS);
</span><del>- if (isCalculation(value)) {
- // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPrimitiveValue here, ie
- // parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.release());
- m_parsedCalculation.release();
- parsedValue = 0;
- }
</del><ins>+ if (isCalculation(value))
+ parsedValue = CSSPrimitiveValue::create(m_parsedCalculation.release());
</ins><span class="cx"> m_valueList->next();
</span><span class="cx"> }
</span><span class="cx"> if (!parsedValue || (m_valueList->current() && !inShorthand()))
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSStyleSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -289,13 +289,6 @@
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- case CSSPropertyStrokeWidth:
- {
- HANDLE_INHERIT_AND_INITIAL(strokeWidth, StrokeWidth)
- if (primitiveValue)
- svgStyle.setStrokeWidth(SVGLength::fromCSSPrimitiveValue(primitiveValue));
- break;
- }
</del><span class="cx"> case CSSPropertyStrokeDasharray:
</span><span class="cx"> {
</span><span class="cx"> HANDLE_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
</span><span class="lines">@@ -320,13 +313,6 @@
</span><span class="cx"> svgStyle.setStrokeDashArray(array);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- case CSSPropertyStrokeDashoffset:
- {
- HANDLE_INHERIT_AND_INITIAL(strokeDashOffset, StrokeDashOffset)
- if (primitiveValue)
- svgStyle.setStrokeDashOffset(SVGLength::fromCSSPrimitiveValue(primitiveValue));
- break;
- }
</del><span class="cx"> case CSSPropertyFillOpacity:
</span><span class="cx"> {
</span><span class="cx"> HANDLE_INHERIT_AND_INITIAL(fillOpacity, FillOpacity)
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -1251,9 +1251,7 @@
</span><span class="cx">
</span><span class="cx"> new PropertyWrapperSVGPaint(CSSPropertyStroke, &RenderStyle::strokePaintType, &RenderStyle::strokePaintColor, &RenderStyle::setStrokePaintColor),
</span><span class="cx"> new PropertyWrapper<float>(CSSPropertyStrokeOpacity, &RenderStyle::strokeOpacity, &RenderStyle::setStrokeOpacity),
</span><del>- new PropertyWrapper<SVGLength>(CSSPropertyStrokeWidth, &RenderStyle::strokeWidth, &RenderStyle::setStrokeWidth),
</del><span class="cx"> new PropertyWrapper< Vector<SVGLength>>(CSSPropertyStrokeDasharray, &RenderStyle::strokeDashArray, &RenderStyle::setStrokeDashArray),
</span><del>- new PropertyWrapper<SVGLength>(CSSPropertyStrokeDashoffset, &RenderStyle::strokeDashOffset, &RenderStyle::setStrokeDashOffset),
</del><span class="cx"> new PropertyWrapper<float>(CSSPropertyStrokeMiterlimit, &RenderStyle::strokeMiterLimit, &RenderStyle::setStrokeMiterLimit),
</span><span class="cx">
</span><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyCx, &RenderStyle::cx, &RenderStyle::setCx),
</span><span class="lines">@@ -1261,6 +1259,8 @@
</span><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyR, &RenderStyle::r, &RenderStyle::setR),
</span><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyRx, &RenderStyle::rx, &RenderStyle::setRx),
</span><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyRy, &RenderStyle::ry, &RenderStyle::setRy),
</span><ins>+ new LengthPropertyWrapper<Length>(CSSPropertyStrokeDashoffset, &RenderStyle::strokeDashOffset, &RenderStyle::setStrokeDashOffset),
+ new LengthPropertyWrapper<Length>(CSSPropertyStrokeWidth, &RenderStyle::strokeWidth, &RenderStyle::setStrokeWidth),
</ins><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyX, &RenderStyle::x, &RenderStyle::setX),
</span><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyY, &RenderStyle::y, &RenderStyle::setY),
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -1656,12 +1656,12 @@
</span><span class="cx"> void setStrokePaintColor(const Color& c) { accessSVGStyle().setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
</span><span class="cx"> float strokeOpacity() const { return svgStyle().strokeOpacity(); }
</span><span class="cx"> void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
</span><del>- SVGLength strokeWidth() const { return svgStyle().strokeWidth(); }
- void setStrokeWidth(SVGLength w) { accessSVGStyle().setStrokeWidth(w); }
</del><ins>+ const Length& strokeWidth() const { return svgStyle().strokeWidth(); }
+ void setStrokeWidth(Length w) { accessSVGStyle().setStrokeWidth(w); }
</ins><span class="cx"> Vector<SVGLength> strokeDashArray() const { return svgStyle().strokeDashArray(); }
</span><span class="cx"> void setStrokeDashArray(Vector<SVGLength> array) { accessSVGStyle().setStrokeDashArray(array); }
</span><del>- SVGLength strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
- void setStrokeDashOffset(SVGLength d) { accessSVGStyle().setStrokeDashOffset(d); }
</del><ins>+ const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
+ void setStrokeDashOffset(Length d) { accessSVGStyle().setStrokeDashOffset(d); }
</ins><span class="cx"> float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
</span><span class="cx"> void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
</span><span class="cx">
</span><span class="lines">@@ -1836,6 +1836,7 @@
</span><span class="cx"> static Length initialPadding() { return Length(Fixed); }
</span><span class="cx"> static Length initialTextIndent() { return Length(Fixed); }
</span><span class="cx"> static Length initialZeroLength() { return Length(Fixed); }
</span><ins>+ static Length initialOneLength() { return Length(1, Fixed); }
</ins><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="cx"> static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
</span><span class="cx"> static TextIndentType initialTextIndentType() { return TextIndentNormal; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleSVGRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.h (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.h        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.h        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -112,20 +112,6 @@
</span><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static SVGLength initialStrokeDashOffset()
- {
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
- return length;
- }
-
- static SVGLength initialStrokeWidth()
- {
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 1, ASSERT_NO_EXCEPTION);
- return length;
- }
-
</del><span class="cx"> // SVG CSS Property setters
</span><span class="cx"> void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f._alignmentBaseline = val; }
</span><span class="cx"> void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._dominantBaseline = val; }
</span><span class="lines">@@ -246,13 +232,13 @@
</span><span class="cx"> stroke.access()->miterLimit = obj;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void setStrokeWidth(const SVGLength& obj)
</del><ins>+ void setStrokeWidth(const Length& obj)
</ins><span class="cx"> {
</span><span class="cx"> if (!(stroke->width == obj))
</span><span class="cx"> stroke.access()->width = obj;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void setStrokeDashOffset(const SVGLength& obj)
</del><ins>+ void setStrokeDashOffset(const Length& obj)
</ins><span class="cx"> {
</span><span class="cx"> if (!(stroke->dashOffset == obj))
</span><span class="cx"> stroke.access()->dashOffset = obj;
</span><span class="lines">@@ -368,8 +354,8 @@
</span><span class="cx"> const String& strokePaintUri() const { return stroke->paintUri; }
</span><span class="cx"> Vector<SVGLength> strokeDashArray() const { return stroke->dashArray; }
</span><span class="cx"> float strokeMiterLimit() const { return stroke->miterLimit; }
</span><del>- SVGLength strokeWidth() const { return stroke->width; }
- SVGLength strokeDashOffset() const { return stroke->dashOffset; }
</del><ins>+ const Length& strokeWidth() const { return stroke->width; }
+ const Length& strokeDashOffset() const { return stroke->dashOffset; }
</ins><span class="cx"> SVGLength kerning() const { return text->kerning; }
</span><span class="cx"> float stopOpacity() const { return stops->opacity; }
</span><span class="cx"> const Color& stopColor() const { return stops->color; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleSVGRenderStyleDefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx"> StyleStrokeData::StyleStrokeData()
</span><span class="cx"> : opacity(SVGRenderStyle::initialStrokeOpacity())
</span><span class="cx"> , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
</span><del>- , width(SVGRenderStyle::initialStrokeWidth())
- , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
</del><ins>+ , width(RenderStyle::initialOneLength())
+ , dashOffset(RenderStyle::initialZeroLength())
</ins><span class="cx"> , dashArray(SVGRenderStyle::initialStrokeDashArray())
</span><span class="cx"> , paintType(SVGRenderStyle::initialStrokePaintType())
</span><span class="cx"> , paintColor(SVGRenderStyle::initialStrokePaintColor())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleSVGRenderStyleDefsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -153,8 +153,8 @@
</span><span class="cx"> float opacity;
</span><span class="cx"> float miterLimit;
</span><span class="cx">
</span><del>- SVGLength width;
- SVGLength dashOffset;
</del><ins>+ Length width;
+ Length dashOffset;
</ins><span class="cx"> Vector<SVGLength> dashArray;
</span><span class="cx">
</span><span class="cx"> SVGPaint::SVGPaintType paintType;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx"> float RenderSVGShape::strokeWidth() const
</span><span class="cx"> {
</span><span class="cx"> SVGLengthContext lengthContext(&graphicsElement());
</span><del>- return style().svgStyle().strokeWidth().value(lengthContext);
</del><ins>+ return lengthContext.valueForLength(style().svgStyle().strokeWidth());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RenderSVGShape::hasSmoothStroke() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx"> return strokeBoundaries;
</span><span class="cx">
</span><span class="cx"> SVGLengthContext lengthContext(&textElement());
</span><del>- strokeBoundaries.inflate(svgStyle.strokeWidth().value(lengthContext));
</del><ins>+ strokeBoundaries.inflate(lengthContext.valueForLength(svgStyle.strokeWidth()));
</ins><span class="cx"> return strokeBoundaries;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx"> const SVGRenderStyle& svgStyle = style.svgStyle();
</span><span class="cx">
</span><span class="cx"> SVGLengthContext lengthContext(toSVGElement(renderer.element()));
</span><del>- context->setStrokeThickness(svgStyle.strokeWidth().value(lengthContext));
</del><ins>+ context->setStrokeThickness(lengthContext.valueForLength(svgStyle.strokeWidth()));
</ins><span class="cx"> context->setLineCap(svgStyle.capStyle());
</span><span class="cx"> context->setLineJoin(svgStyle.joinStyle());
</span><span class="cx"> if (svgStyle.joinStyle() == MiterJoin)
</span><span class="lines">@@ -427,7 +427,7 @@
</span><span class="cx"> for (auto& dash : dashes)
</span><span class="cx"> dashArray.uncheckedAppend(dash.value(lengthContext));
</span><span class="cx">
</span><del>- context->setLineDash(dashArray, svgStyle.strokeDashOffset().value(lengthContext));
</del><ins>+ context->setLineDash(dashArray, lengthContext.valueForLength(svgStyle.strokeDashOffset()));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -268,8 +268,8 @@
</span><span class="cx"> writeSVGPaintingResource(ts, strokePaintingResource);
</span><span class="cx">
</span><span class="cx"> SVGLengthContext lengthContext(&shape.graphicsElement());
</span><del>- double dashOffset = svgStyle.strokeDashOffset().value(lengthContext);
- double strokeWidth = svgStyle.strokeWidth().value(lengthContext);
</del><ins>+ double dashOffset = lengthContext.valueForLength(svgStyle.strokeDashOffset());
+ double strokeWidth = lengthContext.valueForLength(svgStyle.strokeWidth());
</ins><span class="cx"> const Vector<SVGLength>& dashes = svgStyle.strokeDashArray();
</span><span class="cx">
</span><span class="cx"> DashArray dashArray;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (172710 => 172711)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.cpp        2014-08-18 17:55:05 UTC (rev 172710)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp        2014-08-18 18:18:16 UTC (rev 172711)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">
</span><span class="cx"> float SVGLengthContext::valueForLength(const Length& length, SVGLengthMode mode)
</span><span class="cx"> {
</span><del>- if (length.isPercent())
</del><ins>+ if (length.isPercent() && !length.isCalculated())
</ins><span class="cx"> return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
</span><span class="cx"> if (length.isAuto())
</span><span class="cx"> return 0;
</span></span></pre>
</div>
</div>
</body>
</html>