<!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>[171046] 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/171046">171046</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-12 23:35:21 -0700 (Sat, 12 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Elements with rendering disabled due to dimensions should not contribute to parent bounding box
https://bugs.webkit.org/show_bug.cgi?id=134184

Patch by Nikos Andronikos &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt; on 2014-07-12
Reviewed by Dirk Schulze.

Source/WebCore:
SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
Examples of elements with rendering disabled:
- basic shape with width &lt;= 0 or height &lt;= 0
- path with no path data (d attribute missing or empty)
- polyline or polygon element with no point data (points attribute missing or empty)

To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
This is used to determine if an element is included when creating the union of child bounding boxes
in a container element.

Tests: svg/custom/GetBBox-path-nodata.html
       svg/custom/GetBBox-polygon-nodata.html
       svg/custom/GetBBox-polyline-nodata.html
       svg/custom/getBBox-container-hiddenchild.html

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::isRenderingDisabled):
New method added. Always returns false so that derived classes that do not
implement this method retain the existing behaviour.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
For each element potentially being included in the unioned bounding box of
a container, check isRenderingDisabled and skip that element if true.

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::isRenderingDisabled):
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::isRenderingDisabled):
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::isRenderingDisabled):
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::computeContainerBoundingBoxes):

LayoutTests:
Test, for each element type, that when rendering is disabled, that element does not contribute
to the bounding box for an ancestor element.

Added test to ensure zero width/height polyline and polygon do contribute to ancestor bounding box.

Updated expected results for 1 existing test (shapes-rect-02-t) as this test included zero
width and zero height rects and these were previously included in the repaint rect.

* platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt:
* svg/custom/GetBBox-path-nodata-expected.txt: Added.
* svg/custom/GetBBox-path-nodata.html: Added.
* svg/custom/GetBBox-polygon-nodata-expected.txt: Added.
* svg/custom/GetBBox-polygon-nodata.html: Added.
* svg/custom/GetBBox-polyline-nodata-expected.txt: Added.
* svg/custom/GetBBox-polyline-nodata.html: Added.
* svg/custom/getBBox-container-hiddenchild-expected.txt: Added.
* svg/custom/getBBox-container-hiddenchild.html: Added.
* svg/custom/getBBox-perpendicular-polygon-expected.txt: Added.
* svg/custom/getBBox-perpendicular-polygon.svg: Added.
* svg/custom/getBBox-perpendicular-polyline-expected.txt: Added.
* svg/custom/getBBox-perpendicular-polyline.svg: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11shapesrect02texpectedtxt">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGEllipsecpp">trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGEllipseh">trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGPathcpp">trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGPathh">trunk/Source/WebCore/rendering/svg/RenderSVGPath.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRectcpp">trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRecth">trunk/Source/WebCore/rendering/svg/RenderSVGRect.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGShapeh">trunk/Source/WebCore/rendering/svg/RenderSVGShape.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderSupportcpp">trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpathnodataexpectedtxt">trunk/LayoutTests/svg/custom/GetBBox-path-nodata-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpathnodatahtml">trunk/LayoutTests/svg/custom/GetBBox-path-nodata.html</a></li>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpolygonnodataexpectedtxt">trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpolygonnodatahtml">trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata.html</a></li>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpolylinenodataexpectedtxt">trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomGetBBoxpolylinenodatahtml">trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata.html</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxcontainerhiddenchildexpectedtxt">trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxcontainerhiddenchildhtml">trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild.html</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxperpendicularpolygonexpectedtxt">trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxperpendicularpolygonsvg">trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon.svg</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxperpendicularpolylineexpectedtxt">trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomgetBBoxperpendicularpolylinesvg">trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/LayoutTests/ChangeLog        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-07-12  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        Elements with rendering disabled due to dimensions should not contribute to parent bounding box
+        https://bugs.webkit.org/show_bug.cgi?id=134184
+
+        Reviewed by Dirk Schulze.
+
+        Test, for each element type, that when rendering is disabled, that element does not contribute
+        to the bounding box for an ancestor element.
+
+        Added test to ensure zero width/height polyline and polygon do contribute to ancestor bounding box.
+
+        Updated expected results for 1 existing test (shapes-rect-02-t) as this test included zero
+        width and zero height rects and these were previously included in the repaint rect.
+
+        * platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt:
+        * svg/custom/GetBBox-path-nodata-expected.txt: Added.
+        * svg/custom/GetBBox-path-nodata.html: Added.
+        * svg/custom/GetBBox-polygon-nodata-expected.txt: Added.
+        * svg/custom/GetBBox-polygon-nodata.html: Added.
+        * svg/custom/GetBBox-polyline-nodata-expected.txt: Added.
+        * svg/custom/GetBBox-polyline-nodata.html: Added.
+        * svg/custom/getBBox-container-hiddenchild-expected.txt: Added.
+        * svg/custom/getBBox-container-hiddenchild.html: Added.
+        * svg/custom/getBBox-perpendicular-polygon-expected.txt: Added.
+        * svg/custom/getBBox-perpendicular-polygon.svg: Added.
+        * svg/custom/getBBox-perpendicular-polyline-expected.txt: Added.
+        * svg/custom/getBBox-perpendicular-polyline.svg: Added.
+
</ins><span class="cx"> 2014-07-11  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [MSE] http/tests/media/media-source/mediasource-duration.html is failing.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11shapesrect02texpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">   RenderView at (0,0) size 480x360
</span><span class="cx"> layer at (0,0) size 480x360
</span><span class="cx">   RenderSVGRoot {svg} at (0,0) size 480x360
</span><del>-    RenderSVGContainer {g} at (0,0) size 401x277
</del><ins>+    RenderSVGContainer {g} at (0,0) size 181x277
</ins><span class="cx">       RenderSVGRect {rect} at (0,45) size 51x82 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=46.00] [width=50.00] [height=80.00]
</span><span class="cx">       RenderSVGRect {rect} at (129,0) size 52x81 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [x=130.00] [y=0.00] [width=50.00] [height=80.00]
</span><span class="cx">       RenderSVGRect {rect} at (249,45) size 2x82 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [x=250.00] [y=46.00] [width=0.00] [height=80.00]
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpathnodataexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-path-nodata-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-path-nodata-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-path-nodata-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Bug 134184: getBBox on path with no d attribute should return (0,0,0,0) and should not contribute to parent bbox
+
+For this test to pass, you should see 'Passed' twice below.
+
+Passed; Passed;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpathnodatahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-path-nodata.html (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-path-nodata.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-path-nodata.html        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;script&gt;
+    function check_rect_bbox(bbox, expected_bbox, test_name)
+    {
+        var result = true;
+        var result_str = &quot;&quot;;
+
+        if (bbox.x == expected_bbox.x &amp;&amp; bbox.y == expected_bbox.y &amp;&amp; bbox.width == expected_bbox.width &amp;&amp; bbox.height == expected_bbox.height) {                           
+            result_str = &quot;Passed&quot;;
+            } else {
+            result_str += test_name + &quot;: Failed&quot;;
+            result_str += &quot;(&quot;+bbox.x+&quot;,&quot;+bbox.y+&quot;:&quot;+bbox.width + &quot;,&quot; + bbox.height+&quot;)&quot;;
+            result = false;
+        }
+        
+        var p_result = document.querySelector(&quot;#result&quot;);
+        p_result.appendChild(document.createTextNode(result_str + &quot;; &quot;));
+        return result;
+    }
+  
+    function run()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        
+        var p_bbox = document.querySelector(&quot;#p1&quot;).getBBox();
+        var g_bbox = document.querySelector(&quot;g&quot;).getBBox();
+        
+        var result = true;
+
+        result &amp;= check_rect_bbox(p_bbox, {&quot;x&quot;:0, &quot;y&quot;:0, &quot;width&quot;:0, &quot;height&quot;:0}, &quot;getBBox on path with no d attribute&quot;)
+        result &amp;= check_rect_bbox(g_bbox, document.querySelector(&quot;#r1&quot;).getBBox(),&quot;path doesn't contribute to parent bbox&quot;)
+        
+        if (!result) {
+            var visible_rect = document.querySelector(&quot;#r1&quot;);
+            visible_rect.setAttribute(&quot;fill&quot;, &quot;red&quot;);
+        }
+   }
+  &lt;/script&gt;
+
+&lt;body onload=&quot;run()&quot;&gt;
+&lt;p&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=134184&quot;&gt;134184&lt;/a&gt;: getBBox on path with no d attribute should return (0,0,0,0) and should not contribute to parent bbox&lt;/p&gt;
+&lt;p&gt;For this test to pass, you should see 'Passed' twice below.&lt;/a&gt;
+&lt;p id=&quot;result&quot;&gt;&lt;/p&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+&lt;g&gt;
+    &lt;path id=&quot;p1&quot; fill=&quot;none&quot; stroke=&quot;red&quot; /&gt;
+    &lt;rect id=&quot;r1&quot; x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; fill=&quot;green&quot; /&gt;
+&lt;/g&gt;
+&lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpolygonnodataexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Bug 134184: getBBox on polygon with no points attribute should return (0,0,0,0) and should not contribute to parent bbox
+
+For this test to pass, you should see 'Passed' twice below.
+
+Passed; Passed;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpolygonnodatahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata.html (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-polygon-nodata.html        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;script&gt;
+    function check_rect_bbox(bbox, expected_bbox, test_name)
+    {
+        var result = true;
+        var result_str = &quot;&quot;;
+
+        if (bbox.x == expected_bbox.x &amp;&amp; bbox.y == expected_bbox.y &amp;&amp; bbox.width == expected_bbox.width &amp;&amp; bbox.height == expected_bbox.height) {                           
+            result_str = &quot;Passed&quot;;
+            } else {
+            result_str += test_name + &quot;: Failed&quot;;
+            result_str += &quot;(&quot;+bbox.x+&quot;,&quot;+bbox.y+&quot;:&quot;+bbox.width + &quot;,&quot; + bbox.height+&quot;)&quot;;
+            result = false;
+        }
+        
+        var p_result = document.querySelector(&quot;#result&quot;);
+        p_result.appendChild(document.createTextNode(result_str + &quot;; &quot;));
+        return result;
+    }
+  
+    function run()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        
+        var p_bbox = document.querySelector(&quot;#p1&quot;).getBBox();
+        var g_bbox = document.querySelector(&quot;g&quot;).getBBox();
+        
+        var result = true;
+
+        result &amp;= check_rect_bbox(p_bbox, {&quot;x&quot;:0, &quot;y&quot;:0, &quot;width&quot;:0, &quot;height&quot;:0}, &quot;getBBox on polygon with no points attribute&quot;)
+        result &amp;= check_rect_bbox(g_bbox, document.querySelector(&quot;#r1&quot;).getBBox(),&quot;polygon doesn't contribute to parent bbox&quot;)
+        
+        if (!result) {
+            var visible_rect = document.querySelector(&quot;#r1&quot;);
+            visible_rect.setAttribute(&quot;fill&quot;, &quot;red&quot;);
+        }
+   }
+  &lt;/script&gt;
+
+&lt;body onload=&quot;run()&quot;&gt;
+&lt;p&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=134184&quot;&gt;134184&lt;/a&gt;: getBBox on polygon with no points attribute should return (0,0,0,0) and should not contribute to parent bbox&lt;/p&gt;
+&lt;p&gt;For this test to pass, you should see 'Passed' twice below.&lt;/a&gt;
+&lt;p id=&quot;result&quot;&gt;&lt;/p&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+&lt;g&gt;
+    &lt;polygon id=&quot;p1&quot; fill=&quot;none&quot; stroke=&quot;red&quot; /&gt;
+    &lt;rect id=&quot;r1&quot; x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; fill=&quot;green&quot; /&gt;
+&lt;/g&gt;
+&lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpolylinenodataexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Bug 134184: getBBox on polyline with no points attribute should return (0,0,0,0) and should not contribute to parent bbox
+
+For this test to pass, you should see 'Passed' twice below.
+
+Passed; Passed;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomGetBBoxpolylinenodatahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata.html (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/GetBBox-polyline-nodata.html        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;script&gt;
+    function check_rect_bbox(bbox, expected_bbox, test_name)
+    {
+        var result = true;
+        var result_str = &quot;&quot;;
+
+        if (bbox.x == expected_bbox.x &amp;&amp; bbox.y == expected_bbox.y &amp;&amp; bbox.width == expected_bbox.width &amp;&amp; bbox.height == expected_bbox.height) {                           
+            result_str = &quot;Passed&quot;;
+            } else {
+            result_str += test_name + &quot;: Failed&quot;;
+            result_str += &quot;(&quot;+bbox.x+&quot;,&quot;+bbox.y+&quot;:&quot;+bbox.width + &quot;,&quot; + bbox.height+&quot;)&quot;;
+            result = false;
+        }
+        
+        var p_result = document.querySelector(&quot;#result&quot;);
+        p_result.appendChild(document.createTextNode(result_str + &quot;; &quot;));
+        return result;
+    }
+  
+    function run()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        
+        var p_bbox = document.querySelector(&quot;#p1&quot;).getBBox();
+        var g_bbox = document.querySelector(&quot;g&quot;).getBBox();
+        
+        var result = true;
+
+        result &amp;= check_rect_bbox(p_bbox, {&quot;x&quot;:0, &quot;y&quot;:0, &quot;width&quot;:0, &quot;height&quot;:0}, &quot;getBBox on polyline with no points attribute&quot;)
+        result &amp;= check_rect_bbox(g_bbox, document.querySelector(&quot;#r1&quot;).getBBox(),&quot;polyline doesn't contribute to parent bbox&quot;)
+        
+        if (!result) {
+            var visible_rect = document.querySelector(&quot;#r1&quot;);
+            visible_rect.setAttribute(&quot;fill&quot;, &quot;red&quot;);
+        }
+   }
+  &lt;/script&gt;
+
+&lt;body onload=&quot;run()&quot;&gt;
+&lt;p&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=134184&quot;&gt;134184&lt;/a&gt;: getBBox on polyline with no points attribute should return (0,0,0,0) and should not contribute to parent bbox&lt;/p&gt;
+&lt;p&gt;For this test to pass, you should see 'Passed' twice below.&lt;/a&gt;
+&lt;p id=&quot;result&quot;&gt;&lt;/p&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+&lt;g&gt;
+    &lt;path id=&quot;p1&quot; fill=&quot;none&quot; stroke=&quot;red&quot; /&gt;
+    &lt;rect id=&quot;r1&quot; x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; fill=&quot;green&quot; /&gt;
+&lt;/g&gt;
+&lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxcontainerhiddenchildexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 56: Error: Invalid negative value for &lt;rect&gt; attribute width=&quot;-1&quot;
+Bug 134184: Bounding box of hidden child is unioned with other elements of group
+
+For this test to pass, you should see 'Passed' below.
+
+Passed;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxcontainerhiddenchildhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild.html (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-container-hiddenchild.html        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;script&gt;
+    function check_rect_bbox(bbox, test_name)
+    {
+        var result_str = &quot;&quot;;
+        var visible_rect = document.querySelector(&quot;#r1&quot;);
+        var expected_bbox = visible_rect.getBBox();
+
+        if (bbox.x == expected_bbox.x &amp;&amp; bbox.y == expected_bbox.y &amp;&amp; bbox.width == expected_bbox.width &amp;&amp; bbox.height == expected_bbox.height) {                           
+            result_str = &quot;Passed&quot;;
+            } else {
+            result_str += test_name + &quot;: Failed&quot;;
+            result_str += &quot;(&quot;+bbox.x+&quot;,&quot;+bbox.y+&quot;:&quot;+bbox.width + &quot;,&quot; + bbox.height+&quot;)&quot;;
+            visible_rect.setAttribute(&quot;fill&quot;, &quot;red&quot;);
+     
+            var bbox_rect = document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;, &quot;rect&quot;);
+            bbox_rect.setAttribute(&quot;x&quot;, bbox.x);
+            bbox_rect.setAttribute(&quot;y&quot;, bbox.y);
+            bbox_rect.setAttribute(&quot;width&quot;, bbox.width);
+            bbox_rect.setAttribute(&quot;height&quot;, bbox.height);
+            bbox_rect.setAttribute(&quot;fill&quot;, &quot;none&quot;);
+            bbox_rect.setAttribute(&quot;stroke&quot;, &quot;red&quot;);
+            bbox_rect.setAttribute(&quot;stroke-dasharray&quot;, &quot;5 5&quot;);
+            document.querySelector(&quot;svg&quot;).appendChild(bbox_rect);
+        }
+        
+        var p_result = document.querySelector(&quot;#result&quot;);
+        p_result.appendChild(document.createTextNode(result_str + &quot;; &quot;));
+    }
+  
+    function run()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        
+        var g_bbox = document.querySelector(&quot;#g1&quot;).getBBox();
+        check_rect_bbox(g_bbox, &quot;Group with hidden child&quot;);
+    }
+  &lt;/script&gt;
+
+&lt;body onload=&quot;run()&quot;&gt;
+&lt;p&gt;Bug &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=134184&quot;&gt;134184&lt;/a&gt;: Bounding box of hidden child is unioned with other elements of group&lt;/p&gt;
+&lt;p&gt;For this test to pass, you should see 'Passed' below.&lt;/a&gt;
+&lt;p id=&quot;result&quot;&gt;&lt;/p&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
+&lt;g id=&quot;g1&quot;&gt;
+    &lt;rect id=&quot;r1&quot; x=&quot;50&quot; y=&quot;50&quot; width=&quot;50&quot; height=&quot;50&quot; fill=&quot;green&quot; /&gt;
+    &lt;rect id=&quot;r2&quot; x=&quot;20&quot; y=&quot;20&quot; width=&quot;20&quot; height=&quot;0&quot; fill=&quot;red&quot; /&gt;
+    &lt;rect id=&quot;r3&quot; x=&quot;120&quot; y=&quot;20&quot; width=&quot;20&quot; height=&quot;20&quot; fill=&quot;blue&quot; style=&quot;display:none&quot; /&gt;
+    &lt;ellipse id=&quot;c1&quot; cx=&quot;20&quot; cy=&quot;120&quot; rx=&quot;0&quot; ry=&quot;20&quot; fill=&quot;black&quot; /&gt;
+    &lt;!-- test the fall-back case as well as the normal case --&gt;
+    &lt;ellipse id=&quot;c2&quot; cx=&quot;120&quot; cy=&quot;20&quot; rx=&quot;0&quot; ry=&quot;20&quot; stroke=&quot;black&quot; vector-effect=&quot;non-scaling-stroke&quot; /&gt;
+    &lt;rect id=&quot;r4&quot; x=&quot;20&quot; y=&quot;120&quot; width=&quot;20&quot; height=&quot;0&quot; fill=&quot;none&quot; stroke=&quot;black&quot; vector-effect=&quot;non-scaling-stroke&quot; /&gt;
+    &lt;g&gt;
+        &lt;rect id=&quot;r4&quot; x=&quot;120&quot; y=&quot;120&quot; width=&quot;-1&quot; height=&quot;100&quot; fill=&quot;cyan&quot; /&gt;
+    &lt;/g&gt;
+&lt;/g&gt;
+&lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxperpendicularpolygonexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+100 100 PASS
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxperpendicularpolygonsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon.svg (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon.svg                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-perpendicular-polygon.svg        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!-- Test the bounding box calculated for two perpendicular lines of length 100px created with the polygon element --&gt;
+&lt;!-- If the bounding box is 100x100, we consider this test passing. --&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; onload=&quot;init()&quot;&gt;
+  &lt;script type=&quot;text/javascript&quot;&gt;
+  &lt;![CDATA[
+    function init()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        var txt = document.getElementById(&quot;text&quot;);
+        size = document.getElementById(&quot;shape&quot;).getBBox();
+        var passState = &quot;FAIL&quot;;
+        if(size.width == 100 &amp;&amp; size.height == 100)
+            passState = &quot;PASS&quot;;
+        var textNode = document.createTextNode(size.width + &quot; &quot; + size.height + &quot; &quot; + passState);
+        txt.appendChild(textNode);
+    }
+  ]]&gt;
+  &lt;/script&gt;
+  &lt;g id=&quot;shape&quot;&gt;
+    &lt;polygon stroke=&quot;#666666&quot; stroke-width=&quot;2.0&quot; stroke-linejoin=&quot;round&quot; stroke-linecap=&quot;butt&quot; points=&quot;5,5 5,105&quot; fill-rule=&quot;nonzero&quot; /&gt;
+    &lt;polygon stroke=&quot;#666666&quot; stroke-width=&quot;2.0&quot; stroke-linejoin=&quot;round&quot; stroke-linecap=&quot;butt&quot; points=&quot;5,5 105,5&quot; fill-rule=&quot;nonzero&quot; /&gt;
+  &lt;/g&gt;
+  &lt;text id=&quot;text&quot; x=&quot;50&quot; y=&quot;50&quot; /&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxperpendicularpolylineexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline-expected.txt (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline-expected.txt        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+100 100 PASS
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomgetBBoxperpendicularpolylinesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline.svg (0 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline.svg                                (rev 0)
+++ trunk/LayoutTests/svg/custom/getBBox-perpendicular-polyline.svg        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!-- Test the bounding box calculated for two perpendicular lines of length 100px created with the polyline element --&gt;
+&lt;!-- If the bounding box is 100x100, we consider this test passing. --&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; onload=&quot;init()&quot;&gt;
+  &lt;script type=&quot;text/javascript&quot;&gt;
+  &lt;![CDATA[
+    function init()
+    {
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        var txt = document.getElementById(&quot;text&quot;);
+        size = document.getElementById(&quot;shape&quot;).getBBox();
+        var passState = &quot;FAIL&quot;;
+        if(size.width == 100 &amp;&amp; size.height == 100)
+            passState = &quot;PASS&quot;;
+        var textNode = document.createTextNode(size.width + &quot; &quot; + size.height + &quot; &quot; + passState);
+        txt.appendChild(textNode);
+    }
+  ]]&gt;
+  &lt;/script&gt;
+  &lt;g id=&quot;shape&quot;&gt;
+    &lt;polyline stroke=&quot;#666666&quot; stroke-width=&quot;2.0&quot; stroke-linejoin=&quot;round&quot; stroke-linecap=&quot;butt&quot; points=&quot;5,5 5,105&quot; fill-rule=&quot;nonzero&quot; /&gt;
+    &lt;polyline stroke=&quot;#666666&quot; stroke-width=&quot;2.0&quot; stroke-linejoin=&quot;round&quot; stroke-linecap=&quot;butt&quot; points=&quot;5,5 105,5&quot; fill-rule=&quot;nonzero&quot; /&gt;
+  &lt;/g&gt;
+  &lt;text id=&quot;text&quot; x=&quot;50&quot; y=&quot;50&quot; /&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/ChangeLog        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2014-07-12  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        Elements with rendering disabled due to dimensions should not contribute to parent bounding box
+        https://bugs.webkit.org/show_bug.cgi?id=134184
+
+        Reviewed by Dirk Schulze.
+
+        SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
+        Examples of elements with rendering disabled:
+        - basic shape with width &lt;= 0 or height &lt;= 0
+        - path with no path data (d attribute missing or empty)
+        - polyline or polygon element with no point data (points attribute missing or empty)
+
+        To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
+        This is used to determine if an element is included when creating the union of child bounding boxes
+        in a container element.
+
+        Tests: svg/custom/GetBBox-path-nodata.html
+               svg/custom/GetBBox-polygon-nodata.html
+               svg/custom/GetBBox-polyline-nodata.html
+               svg/custom/getBBox-container-hiddenchild.html
+
+        * rendering/svg/RenderSVGEllipse.cpp:
+        (WebCore::RenderSVGEllipse::isRenderingDisabled):
+        New method added. Checks bounding box to determine if rendering is disabled.
+        * rendering/svg/RenderSVGEllipse.h:
+        * rendering/svg/RenderSVGPath.cpp:
+        (WebCore::RenderSVGPath::isRenderingDisabled):
+        New method added. Checks bounding box to determine if rendering is disabled.
+        * rendering/svg/RenderSVGPath.h:
+        * rendering/svg/RenderSVGRect.cpp:
+        (WebCore::RenderSVGRect::isRenderingDisabled):
+        New method added. Checks bounding box to determine if rendering is disabled.
+        * rendering/svg/RenderSVGRect.h:
+        * rendering/svg/RenderSVGShape.h:
+        (WebCore::RenderSVGShape::isRenderingDisabled):
+        New method added. Always returns false so that derived classes that do not
+        implement this method retain the existing behaviour.
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
+        For each element potentially being included in the unioned bounding box of
+        a container, check isRenderingDisabled and skip that element if true.
+
+        * rendering/svg/RenderSVGEllipse.cpp:
+        (WebCore::RenderSVGEllipse::isRenderingDisabled):
+        * rendering/svg/RenderSVGEllipse.h:
+        * rendering/svg/RenderSVGPath.cpp:
+        (WebCore::RenderSVGPath::isRenderingDisabled):
+        * rendering/svg/RenderSVGPath.h:
+        * rendering/svg/RenderSVGRect.cpp:
+        (WebCore::RenderSVGRect::isRenderingDisabled):
+        * rendering/svg/RenderSVGRect.h:
+        * rendering/svg/RenderSVGShape.h:
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
+
</ins><span class="cx"> 2014-07-12  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttributeSelector()
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGEllipsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -153,4 +153,10 @@
</span><span class="cx">     return xrX * xrX + yrY * yrY &lt;= 1.0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderSVGEllipse::isRenderingDisabled() const
+{
+    // A radius of zero disables rendering of the element, and results in an empty bounding box.
+    return m_fillBoundingBox.isEmpty();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGEllipseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.h (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.h        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.h        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void updateShapeFromElement();
</span><span class="cx">     virtual bool isEmpty() const { return m_usePathFallback ? RenderSVGShape::isEmpty() : m_fillBoundingBox.isEmpty(); };
</span><ins>+    virtual bool isRenderingDisabled() const override;
</ins><span class="cx">     virtual void fillShape(GraphicsContext*) const;
</span><span class="cx">     virtual void strokeShape(GraphicsContext*) const;
</span><span class="cx">     virtual bool shapeDependentStrokeContains(const FloatPoint&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -159,4 +159,11 @@
</span><span class="cx">     subpathData.pathIsDone();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderSVGPath::isRenderingDisabled() const
+{
+    // For a polygon, polyline or path, rendering is disabled if there is no path data.
+    // No path data is possible in the case of a missing or empty 'd' or 'points' attribute.
+    return path().isEmpty();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGPathh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGPath.h (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGPath.h        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGPath.h        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx">     FloatRect zeroLengthSubpathRect(const FloatPoint&amp;, float) const;
</span><span class="cx">     void updateZeroLengthSubpaths();
</span><span class="cx"> 
</span><ins>+    virtual bool isRenderingDisabled() const override;
+
</ins><span class="cx">     Vector&lt;FloatPoint&gt; m_zeroLengthLinecapLocations;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -151,4 +151,10 @@
</span><span class="cx">     return m_fillBoundingBox.contains(point.x(), point.y());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderSVGRect::isRenderingDisabled() const
+{
+    // A width or height of zero disables rendering for the element, and results in an empty bounding box.
+    return m_fillBoundingBox.isEmpty();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRect.h (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRect.h        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRect.h        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void updateShapeFromElement();
</span><span class="cx">     virtual bool isEmpty() const { return m_usePathFallback ? RenderSVGShape::isEmpty() : m_fillBoundingBox.isEmpty(); };
</span><ins>+    virtual bool isRenderingDisabled() const override;
</ins><span class="cx">     virtual void fillShape(GraphicsContext*) const;
</span><span class="cx">     virtual void strokeShape(GraphicsContext*) const;
</span><span class="cx">     virtual bool shapeDependentStrokeContains(const FloatPoint&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.h (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.h        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.h        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     virtual void setNeedsTransformUpdate() override final { m_needsTransformUpdate = true; }
</span><span class="cx">     virtual void fillShape(GraphicsContext*) const;
</span><span class="cx">     virtual void strokeShape(GraphicsContext*) const;
</span><ins>+    virtual bool isRenderingDisabled() const = 0;
</ins><span class="cx"> 
</span><span class="cx">     bool hasPath() const { return m_path.get(); }
</span><span class="cx">     Path&amp; path() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (171045 => 171046)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-07-13 05:51:20 UTC (rev 171045)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-07-13 06:35:21 UTC (rev 171046)
</span><span class="lines">@@ -157,6 +157,10 @@
</span><span class="cx">         if (current-&gt;isSVGHiddenContainer())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><ins>+        // Don't include elements in the union that do not render.
+        if (current-&gt;isSVGShape() &amp;&amp; toRenderSVGShape(current)-&gt;isRenderingDisabled())
+            continue;
+
</ins><span class="cx">         const AffineTransform&amp; transform = current-&gt;localToParentTransform();
</span><span class="cx">         if (transform.isIdentity()) {
</span><span class="cx">             updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, current-&gt;objectBoundingBox());
</span></span></pre>
</div>
</div>

</body>
</html>