<!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>[160774] 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/160774">160774</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-18 10:14:12 -0800 (Wed, 18 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix ASSERTION FAILED in WebCore::SVGLengthContext::determineViewport
https://bugs.webkit.org/show_bug.cgi?id=120284

Patch by Tamas Gergely &lt;tgergely.u-szeged@partner.samsung.com&gt; on 2013-12-18
Reviewed by Philip Rogers.

Source/WebCore:

Added handling of root &lt;svg&gt; elements.
Blink merge: https://chromium.googlesource.com/chromium/blink/+/a7dedf81eb7008276bb6854f0e46465e039788f8

SVGLengthContext::determineViewport() currently asserts that we're not
resolving lengths for the topmost element, but there's nothing to
prevent such calls.

The patch updates determineViewport() to handle root elements geracefully
(using their current viewport). It also changes the signature slightly
to operate directly on a FloatSize, reducing some of the boiler-plate
client code.

Tests: svg/custom/svg-length-value-handled.svg
       svg/dom/svg-root-lengths.html

* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage):
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
(WebCore::SVGLengthContext::determineViewport):
* svg/SVGLengthContext.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):

LayoutTests:

Added tests of handling root &lt;svg&gt; elements.
Blink merge: https://chromium.googlesource.com/chromium/blink/+/a7dedf81eb7008276bb6854f0e46465e039788f8

* svg/custom/svg-length-value-handled-expected.txt: Added.
* svg/custom/svg-length-value-handled.svg: Added.
    Tests whether root svg elements sizes are handled.
* svg/dom/svg-root-lengths-expected.txt: Added.
* svg/dom/svg-root-lengths.html: Added.
    Tests the correct handling of root svg elements sizes.</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="#trunkSourceWebCoresvgSVGLengthContextcpp">trunk/Source/WebCore/svg/SVGLengthContext.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContexth">trunk/Source/WebCore/svg/SVGLengthContext.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFEImagecpp">trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcustomsvglengthvaluehandledexpectedtxt">trunk/LayoutTests/svg/custom/svg-length-value-handled-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomsvglengthvaluehandledsvg">trunk/LayoutTests/svg/custom/svg-length-value-handled.svg</a></li>
<li><a href="#trunkLayoutTestssvgdomsvgrootlengthsexpectedtxt">trunk/LayoutTests/svg/dom/svg-root-lengths-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomsvgrootlengthshtml">trunk/LayoutTests/svg/dom/svg-root-lengths.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160773 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-18 18:07:01 UTC (rev 160773)
+++ trunk/LayoutTests/ChangeLog        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-12-18  Tamas Gergely  &lt;tgergely.u-szeged@partner.samsung.com&gt;
+
+        Fix ASSERTION FAILED in WebCore::SVGLengthContext::determineViewport
+        https://bugs.webkit.org/show_bug.cgi?id=120284
+
+        Reviewed by Philip Rogers.
+
+        Added tests of handling root &lt;svg&gt; elements.
+        Blink merge: https://chromium.googlesource.com/chromium/blink/+/a7dedf81eb7008276bb6854f0e46465e039788f8
+
+        * svg/custom/svg-length-value-handled-expected.txt: Added.
+        * svg/custom/svg-length-value-handled.svg: Added.
+            Tests whether root svg elements sizes are handled.
+        * svg/dom/svg-root-lengths-expected.txt: Added.
+        * svg/dom/svg-root-lengths.html: Added.
+            Tests the correct handling of root svg elements sizes.
+
</ins><span class="cx"> 2013-12-18  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Additional refinement in MathMLSelectElement toggle implementation
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomsvglengthvaluehandledexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/svg-length-value-handled-expected.txt (0 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/svg-length-value-handled-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/svg-length-value-handled-expected.txt        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS: root svg element size handled (0x0)
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomsvglengthvaluehandledsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/svg-length-value-handled.svg (0 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/svg-length-value-handled.svg                                (rev 0)
+++ trunk/LayoutTests/svg/custom/svg-length-value-handled.svg        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+  &lt;rect width=&quot;100&quot; height=&quot;100&quot; fill=&quot;green&quot;/&gt;
+  &lt;text id=&quot;label&quot; y=&quot;200&quot;/&gt;
+    &lt;script&gt;
+      if (window.testRunner)
+        testRunner.dumpAsText();
+
+      document.getElementById(&quot;label&quot;).textContent =
+        &quot;PASS: root svg element size handled (&quot; +
+        document.rootElement.width.baseVal.value + &quot;x&quot; +
+        document.rootElement.height.baseVal.value + &quot;)&quot;;
+    &lt;/script&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgdomsvgrootlengthsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/dom/svg-root-lengths-expected.txt (0 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/svg-root-lengths-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/dom/svg-root-lengths-expected.txt        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+This tests the behavior of root SVG length value resolution
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+ PASS successfullyParsed is true
+
+TEST COMPLETE
+Initial/default values:
+PASS svg.width.baseVal.value is 200
+PASS svg.height.baseVal.value is 200
+
+Updated relative values:
+PASS svg.width.baseVal.value is 100
+PASS svg.height.baseVal.value is 20
+
+Updated fixed values:
+PASS svg.width.baseVal.value is 150
+PASS svg.height.baseVal.value is 50
+
+viewBox has no effect on top level length resolution.
+PASS svg.width.baseVal.value is 200
+PASS svg.height.baseVal.value is 100
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgdomsvgrootlengthshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/dom/svg-root-lengths.html (0 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/svg-root-lengths.html                                (rev 0)
+++ trunk/LayoutTests/svg/dom/svg-root-lengths.html        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+    &lt;div id=&quot;div&quot; style=&quot;width: 200px; height: 200px; border: 1px solid red;&quot;&gt;
+      &lt;svg id=&quot;svg&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; style=&quot;border: 1px solid blue;&quot;&gt;
+        &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;green&quot;/&gt;
+      &lt;/svg&gt;
+    &lt;/div&gt;
+    &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+    &lt;script&gt;
+      if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+      }
+
+      setTimeout(function () {
+        var div = document.getElementById('div');
+        var svg = document.getElementById('svg');
+
+        description('This tests the behavior of root SVG length value resolution');
+
+        debug('Initial/default values:');
+        shouldBe('svg.width.baseVal.value', '200');
+        shouldBe('svg.height.baseVal.value', '200');
+
+        svg.setAttribute('width', '50%');
+        svg.setAttribute('height', '10%');
+        debug('');
+        debug('Updated relative values:');
+        shouldBe('svg.width.baseVal.value', '100');
+        shouldBe('svg.height.baseVal.value', '20');
+
+        svg.setAttribute('width', '150');
+        svg.setAttribute('height', '50');
+        debug('');
+        debug('Updated fixed values:');
+        shouldBe('svg.width.baseVal.value', '150');
+        shouldBe('svg.height.baseVal.value', '50');
+
+        svg.setAttribute('width', '100%');
+        svg.setAttribute('height', '50%');
+        svg.setAttribute('viewBox', '0 0 800 600');
+        debug('');
+        debug('viewBox has no effect on top level length resolution.');
+        shouldBe('svg.width.baseVal.value', '200');
+        shouldBe('svg.height.baseVal.value', '100');
+
+        if (window.testRunner)
+          testRunner.notifyDone();
+      }, 0);
+    &lt;/script&gt;
+    &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160773 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-18 18:07:01 UTC (rev 160773)
+++ trunk/Source/WebCore/ChangeLog        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2013-12-18  Tamas Gergely  &lt;tgergely.u-szeged@partner.samsung.com&gt;
+
+        Fix ASSERTION FAILED in WebCore::SVGLengthContext::determineViewport
+        https://bugs.webkit.org/show_bug.cgi?id=120284
+
+        Reviewed by Philip Rogers.
+
+        Added handling of root &lt;svg&gt; elements.
+        Blink merge: https://chromium.googlesource.com/chromium/blink/+/a7dedf81eb7008276bb6854f0e46465e039788f8
+
+        SVGLengthContext::determineViewport() currently asserts that we're not
+        resolving lengths for the topmost element, but there's nothing to
+        prevent such calls.
+
+        The patch updates determineViewport() to handle root elements geracefully
+        (using their current viewport). It also changes the signature slightly
+        to operate directly on a FloatSize, reducing some of the boiler-plate
+        client code.
+
+        Tests: svg/custom/svg-length-value-handled.svg
+               svg/dom/svg-root-lengths.html
+
+        * svg/SVGLengthContext.cpp:
+        (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage):
+        (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
+        (WebCore::SVGLengthContext::determineViewport):
+        * svg/SVGLengthContext.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::platformApplySoftware):
+
</ins><span class="cx"> 2013-12-18  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Additional refinement in MathMLSelectElement toggle implementation
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (160773 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.cpp        2013-12-18 18:07:01 UTC (rev 160773)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -161,20 +161,19 @@
</span><span class="cx"> 
</span><span class="cx"> float SVGLengthContext::convertValueFromUserUnitsToPercentage(float value, SVGLengthMode mode, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><del>-    float width = 0;
-    float height = 0;
-    if (!determineViewport(width, height)) {
</del><ins>+    FloatSize viewportSize;
+    if (!determineViewport(viewportSize)) {
</ins><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     switch (mode) {
</span><span class="cx">     case LengthModeWidth:
</span><del>-        return value / width * 100;
</del><ins>+        return value / viewportSize.width() * 100;
</ins><span class="cx">     case LengthModeHeight:
</span><del>-        return value / height * 100;
</del><ins>+        return value / viewportSize.height() * 100;
</ins><span class="cx">     case LengthModeOther:
</span><del>-        return value / (sqrtf((width * width + height * height) / 2)) * 100;
</del><ins>+        return value / (sqrtf(viewportSize.diagonalLengthSquared() / 2)) * 100;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -183,20 +182,19 @@
</span><span class="cx"> 
</span><span class="cx"> float SVGLengthContext::convertValueFromPercentageToUserUnits(float value, SVGLengthMode mode, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><del>-    float width = 0;
-    float height = 0;
-    if (!determineViewport(width, height)) {
</del><ins>+    FloatSize viewportSize;
+    if (!determineViewport(viewportSize)) {
</ins><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     switch (mode) {
</span><span class="cx">     case LengthModeWidth:
</span><del>-        return value * width;
</del><ins>+        return value * viewportSize.width();
</ins><span class="cx">     case LengthModeHeight:
</span><del>-        return value * height;
</del><ins>+        return value * viewportSize.height();
</ins><span class="cx">     case LengthModeOther:
</span><del>-        return value * sqrtf((width * width + height * height) / 2);
</del><ins>+        return value * sqrtf(viewportSize.diagonalLengthSquared() / 2);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -280,34 +278,33 @@
</span><span class="cx">     return value * ceilf(style-&gt;fontMetrics().xHeight());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGLengthContext::determineViewport(float&amp; width, float&amp; height) const
</del><ins>+bool SVGLengthContext::determineViewport(FloatSize&amp; viewportSize) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_context)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // If an overriden viewport is given, it has precedence.
</span><span class="cx">     if (!m_overridenViewport.isEmpty()) {
</span><del>-        width = m_overridenViewport.width();
-        height = m_overridenViewport.height();
</del><ins>+        viewportSize = m_overridenViewport.size();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // SVGLengthContext should NEVER be used to resolve width/height values for &lt;svg&gt; elements,
-    // as they require special treatment, due the relationship with the CSS width/height properties.
-    ASSERT(m_context-&gt;document().documentElement() != m_context);
</del><ins>+    // Root &lt;svg&gt; element lengths are resolved against the top level viewport.
+    if (m_context-&gt;isOutermostSVGSVGElement()) {
+        viewportSize = toSVGSVGElement(m_context)-&gt;currentViewportSize();
+        return true;
+    }
</ins><span class="cx"> 
</span><span class="cx">     // Take size from nearest viewport element.
</span><span class="cx">     SVGElement* viewportElement = m_context-&gt;viewportElement();
</span><span class="cx">     if (!viewportElement || !isSVGSVGElement(viewportElement))
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
</ins><span class="cx">     const SVGSVGElement* svg = toSVGSVGElement(viewportElement);
</span><del>-    FloatSize viewportSize = svg-&gt;currentViewBoxRect().size();
</del><ins>+    viewportSize = svg-&gt;currentViewBoxRect().size();
</ins><span class="cx">     if (viewportSize.isEmpty())
</span><span class="cx">         viewportSize = svg-&gt;currentViewportSize();
</span><span class="cx"> 
</span><del>-    width = viewportSize.width();
-    height = viewportSize.height();
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.h (160773 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.h        2013-12-18 18:07:01 UTC (rev 160773)
+++ trunk/Source/WebCore/svg/SVGLengthContext.h        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     float convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit, ExceptionCode&amp;) const;
</span><span class="cx">     float convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit, ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><del>-    bool determineViewport(float&amp; width, float&amp; height) const;
</del><ins>+    bool determineViewport(FloatSize&amp;) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     SVGLengthContext(const SVGElement*, const FloatRect&amp; viewport);
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFEImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp (160773 => 160774)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp        2013-12-18 18:07:01 UTC (rev 160773)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp        2013-12-18 18:14:12 UTC (rev 160774)
</span><span class="lines">@@ -128,13 +128,12 @@
</span><span class="cx">         SVGElement* contextNode = toSVGElement(renderer-&gt;element());
</span><span class="cx">         if (contextNode-&gt;hasRelativeLengths()) {
</span><span class="cx">             SVGLengthContext lengthContext(contextNode);
</span><del>-            float width = 0;
-            float height = 0;
</del><ins>+            FloatSize viewportSize;
</ins><span class="cx"> 
</span><span class="cx">             // If we're referencing an element with percentage units, eg. &lt;rect with=&quot;30%&quot;&gt; those values were resolved against the viewport.
</span><span class="cx">             // Build up a transformation that maps from the viewport space to the filter primitive subregion.
</span><del>-            if (lengthContext.determineViewport(width, height))
-                resultImage-&gt;context()-&gt;concatCTM(makeMapBetweenRects(FloatRect(0, 0, width, height), destRect));
</del><ins>+            if (lengthContext.determineViewport(viewportSize))
+                resultImage-&gt;context()-&gt;concatCTM(makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize), destRect));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         AffineTransform contentTransformation;
</span></span></pre>
</div>
</div>

</body>
</html>