Bug 1136010 - Don't coalesce style contexts added to RestyleManager::mContextsToClear. r=dbaron, a=lmandel
authorCameron McCormack <cam@mcc.id.au>
Wed, 04 Mar 2015 18:06:29 +1100
changeset 250263 be7287dc2c9a
parent 250262 00bad6e2ffbc
child 250264 a38e1a8b5b7d
push id4528
push userryanvm@gmail.com
push date2015-03-05 22:37 +0000
treeherdermozilla-beta@3146d4299a62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, lmandel
bugs1136010
milestone37.0
Bug 1136010 - Don't coalesce style contexts added to RestyleManager::mContextsToClear. r=dbaron, a=lmandel
layout/base/RestyleManager.cpp
layout/reftests/printing/reftest.list
layout/style/crashtests/1136010-1.html
layout/style/crashtests/crashtests.list
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2790,30 +2790,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/reftests/printing/reftest.list
+++ b/layout/reftests/printing/reftest.list
@@ -27,9 +27,9 @@ fails-if(B2G) == 115199-1.html 115199-1-
 skip-if(B2G) fuzzy-if(cocoaWidget,1,5000) == 745025-1.html 745025-1-ref.html # reftest-print doesn't work on B2G
 == 820496-1.html 820496-1-ref.html
 
 # NOTE: These tests don't yet rigorously test what they're
 # trying to test (shrink-to-fit behavior), due to bug 967311.
 random-if(B2G&&browserIsRemote) == 960822.html 960822-ref.html # reftest-print doesn't work on B2G (scrollbar difference only)
 == 966419-1.html 966419-1-ref.html
 == 966419-2.html 966419-2-ref.html
-skip-if(B2G) asserts(2) HTTP(..) == 1108104.html 1108104-ref.html # bug 1067755
+skip-if(B2G) asserts(4) HTTP(..) == 1108104.html 1108104-ref.html # bug 1067755
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