Fix bug 380516, bug 375342, bug 374293. Patch in bug 380516. r=jwatt, sr=dbaron
authorbzbarsky@mit.edu
Wed, 23 May 2007 13:10:43 -0700
changeset 1797 03a5c5b2746647d5d5c589722ba1d6b9ae021d56
parent 1796 0dc2656e5f08b83dfee3cfe9c1ee6e11c570c8ab
child 1798 0a80ffb1748606bb22ea074648b9288b4e5e2a78
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, dbaron
bugs380516, 375342, 374293
milestone1.9a5pre
Fix bug 380516, bug 375342, bug 374293. Patch in bug 380516. r=jwatt, sr=dbaron
layout/reftests/svg/dynamic-reflow-01-ref.svg
layout/reftests/svg/dynamic-reflow-01.svg
layout/reftests/svg/reftest.list
layout/svg/base/src/nsSVGOuterSVGFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/dynamic-reflow-01-ref.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
+  <rect id="test" x="100" y="100" width="100" height="100"
+        style="width: 200px"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/dynamic-reflow-01.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
+  <rect id="test" x="100" y="100" width="100" height="100"/>
+  <script>
+    window.onload = function() {
+      var node = document.getElementById("test");
+      node.style.width = "200px";      
+    }
+  </script>
+</svg>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -15,8 +15,9 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") ==
 == pseudo-classes-01.svg pass.svg
 skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") == pseudo-classes-02.svg pseudo-classes-02-ref.svg # bug 379600 (crashes linux)
 == rect-with-rx-and-ry-01.svg pass.svg
 == rect-with-rx-or-ry-01.svg rect-with-rx-or-ry-01-ref.svg
 == rootElement-null-01.svg pass.svg
 == stroke-width-percentage-01.svg pass.svg
 skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") == text-in-link-01.svg text-in-link-01-ref.svg # bug 379600 (crashes linux)
 == viewport-percent-graphic-user-01.svg pass.svg
+== dynamic-reflow-01.svg dynamic-reflow-01-ref.svg
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -200,16 +200,18 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext
                            const nsHTMLReflowState& aReflowState,
                            nsReflowStatus&          aStatus)
 {
   if (!aReflowState.ShouldReflowAllKids()) {
     // We're not the target of the incremental reflow, so just bail.
     // This means that something happened to one of our descendants
     // (excluding those inside svg:foreignObject, since
     // nsSVGForeignObjectFrame is a reflow root).
+    aDesiredSize.width = mRect.width;
+    aDesiredSize.height = mRect.height;
     aStatus = NS_FRAME_COMPLETE;
     return NS_OK;
   }
   
   //  SVG CR 20001102: When the SVG content is embedded inline within
   //  a containing document, and that document is styled using CSS,
   //  then if there are CSS positioning properties specified on the
   //  outermost 'svg' element that are sufficient to establish the