Bug 621598 - Don't try to get covered region of parts of markers r+a=roc
authorRobert Longson <longsonr@gmail.com>
Wed, 29 Dec 2010 10:29:54 +0000
changeset 59725 fc1ca73d597894fe3067cb013c9257119f54c1b4
parent 59724 759b0cf2e6ebef2bf527aae47ede4fbdde00ddc4
child 59726 c59ea33927d71666a7e4203393f3791c22230a02
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
bugs621598
milestone2.0b9pre
Bug 621598 - Don't try to get covered region of parts of markers r+a=roc
layout/svg/base/src/nsSVGUtils.cpp
layout/svg/crashtests/621598-1.svg
layout/svg/crashtests/crashtests.list
--- a/layout/svg/base/src/nsSVGUtils.cpp
+++ b/layout/svg/base/src/nsSVGUtils.cpp
@@ -764,17 +764,18 @@ nsSVGUtils::GetOuterSVGFrame(nsIFrame *a
 }
 
 nsIFrame*
 nsSVGUtils::GetOuterSVGFrameAndCoveredRegion(nsIFrame* aFrame, nsRect* aRect)
 {
   nsISVGChildFrame* svg = do_QueryFrame(aFrame);
   if (!svg)
     return nsnull;
-  *aRect = svg->GetCoveredRegion();
+  *aRect = (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) ?
+             nsRect(0, 0, 0, 0) : svg->GetCoveredRegion();
   return GetOuterSVGFrame(aFrame);
 }
 
 gfxMatrix
 nsSVGUtils::GetViewBoxTransform(nsSVGElement* aElement,
                                 float aViewportWidth, float aViewportHeight,
                                 float aViewboxX, float aViewboxY,
                                 float aViewboxWidth, float aViewboxHeight,
new file mode 100644
--- /dev/null
+++ b/layout/svg/crashtests/621598-1.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <marker id="m1">
+    <rect/>
+    <marker>
+      <line id="z" marker-end="url(#m1)"/>
+    </marker>
+  </marker>
+  <script>
+    function boom()
+    {
+      document.getElementById("z").getBoundingClientRect();
+    }
+    window.addEventListener("load", boom, false);
+  </script>
+
+</svg>
--- a/layout/svg/crashtests/crashtests.list
+++ b/layout/svg/crashtests/crashtests.list
@@ -95,8 +95,9 @@ load extref-test-1.xhtml
 load 566216-1.svg
 load 587336-1.html
 load 590291-1.svg
 load 601999-1.html
 load 605626-1.svg
 load 610954-1.html
 load 612662-1.svg
 load 612662-2.svg
+load 621598-1.svg