Bug 1032613 part 2: Make RestyleManager::AddSubtreeToOverflowTracker skip frames that don't maintain overflow areas. r=dbaron
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 01 Oct 2015 20:05:26 -0700
changeset 298310 24ded1d0386af4fb23a2b4331be5316e519b077a
parent 298309 812aac13e8abf7611829d290ee15ba45b210a3fa
child 298311 009f9286101b1331fc9652743d7b702adc80b86d
push id6068
push userkcambridge@mozilla.com
push dateFri, 02 Oct 2015 20:37:20 +0000
reviewersdbaron
bugs1032613
milestone44.0a1
Bug 1032613 part 2: Make RestyleManager::AddSubtreeToOverflowTracker skip frames that don't maintain overflow areas. r=dbaron
layout/base/RestyleManager.cpp
layout/generic/crashtests/1032613-1.svg
layout/generic/crashtests/1032613-2.html
layout/generic/crashtests/crashtests.list
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -625,19 +625,20 @@ RestyleManager::StyleChangeReflow(nsIFra
                                                 rootHandling);
     aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);
   } while (aFrame);
 }
 
 void
 RestyleManager::AddSubtreeToOverflowTracker(nsIFrame* aFrame) 
 {
-  mOverflowChangedTracker.AddFrame(
-      aFrame,
-      OverflowChangedTracker::CHILDREN_CHANGED);
+  if (aFrame->FrameMaintainsOverflow()) {
+    mOverflowChangedTracker.AddFrame(aFrame,
+                                     OverflowChangedTracker::CHILDREN_CHANGED);
+  }
   nsIFrame::ChildListIterator lists(aFrame);
   for (; !lists.IsDone(); lists.Next()) {
     for (nsIFrame* child : lists.CurrentList()) {
       AddSubtreeToOverflowTracker(child);
     }
   }
 }
 
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1032613-1.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" onload="tweak()">
+    <pattern>
+        <rect id="r" />
+    </pattern>
+    <script>
+      function tweak() {
+        document.getElementById("r").style.textDecoration = "underline";
+      }
+    </script>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1032613-2.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+  <script>
+    function tweak() {
+      document.getElementById("c").style.textShadow = "3px 3px gray";
+    }
+  </script>
+  <body onload="tweak()">
+    <div id="c">hello
+      <svg height="0">
+        <clipPath>
+          <path d=""/>
+        </clipPath>
+      </svg>
+    </div>
+  </body>
+</html>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -561,16 +561,18 @@ load 1001233.html
 load 1001258-1.html
 load 1003441.xul
 pref(layout.css.grid.enabled,true) load 1015562.html
 asserts(1-2) load 1015563-1.html
 asserts(1-2) load 1015563-2.html
 asserts(0-300) load 1015844.html # bug 574889
 load outline-on-frameset.xhtml
 pref(font.size.inflation.minTwips,200) load 1032450.html
+load 1032613-1.svg
+load 1032613-2.html
 load 1037903.html
 load 1039454-1.html
 load 1042489.html
 load 1054010-1.html
 load 1058954-1.html
 load 1134531.html
 load 1134667.html
 load 1137723-1.html