Bug 1136010 - Don't coalesce style contexts added to RestyleManager::mContextsToClear. r=dbaron
☠☠ backed out by 69e80cc95763 ☠ ☠
authorCameron McCormack <cam@mcc.id.au>
Wed, 04 Mar 2015 21:57:46 +1100
changeset 231856 bc9e6089b8e18c415753510a7ee2a6bf0944d039
parent 231855 caea9f8b038e81c7a896654f17a9f7489ba179d3
child 231857 73bddae4f2660b8f757b7ecc2bf237afc58288f6
push id28362
push userryanvm@gmail.com
push dateWed, 04 Mar 2015 21:35:51 +0000
treeherdermozilla-central@56492f7244a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1136010
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1136010 - Don't coalesce style contexts added to RestyleManager::mContextsToClear. r=dbaron
layout/base/RestyleManager.cpp
layout/generic/crashtests/crashtests.list
layout/style/crashtests/1136010-1.html
layout/style/crashtests/crashtests.list
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2876,30 +2876,19 @@ ElementRestyler::Restyle(nsRestyleHint a
     // structs that were swapped out.
     //
     // Much of the time we will not get in here; we do for example when the
     // style context is shared with a later IB split sibling (which we won't
     // restyle until a bit later) or if other code is holding a strong reference
     // to the style context (as is done by nsTransformedTextRun objects, which
     // can be referenced by a text frame's mTextRun longer than the frame's
     // mStyleContext).
-    //
-    // We coalesce entries in mContextsToClear when we detect that the last
-    // style context appended has oldContext as its parent, as
-    // ClearCachedInheritedStyleDataOnDescendants handles a whole subtree
-    // of style contexts.
-    if (!mContextsToClear.IsEmpty() &&
-        mContextsToClear.LastElement().mStyleContext->GetParent() == oldContext &&
-        mContextsToClear.LastElement().mStructs == swappedStructs) {
-      mContextsToClear.LastElement().mStyleContext = Move(oldContext);
-    } else {
-      ContextToClear* toClear = mContextsToClear.AppendElement();
-      toClear->mStyleContext = Move(oldContext);
-      toClear->mStructs = swappedStructs;
-    }
+    ContextToClear* toClear = mContextsToClear.AppendElement();
+    toClear->mStyleContext = Move(oldContext);
+    toClear->mStructs = swappedStructs;
   }
 
   mRestyleTracker.AddRestyleRootsIfAwaitingRestyle(descendants);
 }
 
 /**
  * Depending on the details of the frame we are restyling or its old style
  * context, we may or may not be able to stop restyling after this frame if
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -567,15 +567,15 @@ load outline-on-frameset.xhtml
 pref(font.size.inflation.minTwips,200) load 1032450.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
-asserts(3) load 1137723-1.html # bug 1019192
+asserts(3-4) load 1137723-1.html # bug 1019192
 asserts(3-6) load 1137723-2.html # bug 1019192, bug 1138133
 # The tests for bug 1137723 above causes delayed assertions too,
 # the next 3 lines can be removed once that is fixed.
 asserts(0-3) load 1134667.html
 asserts(0-3) load 1134667.html
 asserts(0-3) load 1134667.html
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1136010-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+body { text-transform: uppercase; width: 200px; height: 200px; background-color: white; }
+#a, #b { font-size: 24px; }
+</style>
+<div id=a><div id=b><span>x</span><span>y</span></div></div>
+<script>
+document.body.offsetTop;
+var a = document.getElementById("a");
+var b = document.getElementById("b");
+a.style.fontSize = "24px";
+b.style.fontSize = "24px";
+document.body.offsetTop;
+b.style.fontSize = "36px";
+document.body.offsetTop;
+</script>
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -106,10 +106,11 @@ load 945048-1.html
 pref(layers.offmainthreadcomposition.async-animations,true) load 972199-1.html
 load 989965-1.html
 load 992333-1.html
 pref(dom.webcomponents.enabled,true) load 1017798-1.html
 load 1028514-1.html
 load 1066089-1.html
 load 1074651-1.html
 pref(dom.webcomponents.enabled,true) load 1089463-1.html
+load 1136010-1.html
 load large_border_image_width.html
 load border-image-visited-link.html