Bug 1403712: Clear the restyle root at the end of UnbindFromTree too. r?bholley draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 28 Sep 2017 14:18:36 +0200
changeset 672165 e6a4b0b9adc3f1c25f84c93f49607566f96c8b2c
parent 672164 477d000e7532b414a6031c5513191fdec69e963b
child 672166 c982c4a702cc80d5f08ca90795c6ba210167d9da
push id82174
push userbmo:emilio@crisal.io
push dateThu, 28 Sep 2017 20:25:49 +0000
reviewersbholley
bugs1403712
milestone58.0a1
Bug 1403712: Clear the restyle root at the end of UnbindFromTree too. r?bholley MozReview-Commit-ID: 7swfspMWUe6 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
dom/base/Element.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2000,16 +2000,19 @@ Element::UnbindFromTree(bool aDeep, bool
   //
   // This can happen when the element changes the state of some ancestor up in
   // the tree, for example.
   //
   // Note that clearing the data itself here would have its own set of problems,
   // since the invariant we'd be breaking in that case is "HasServoData()
   // implies InComposedDoc()", which we rely on in various places.
   UnsetFlags(kAllServoDescendantBits);
+  if (document && document->GetServoRestyleRoot() == this) {
+    document->ClearServoRestyleRoot();
+  }
 }
 
 nsICSSDeclaration*
 Element::GetSMILOverrideStyle()
 {
   Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots();
 
   if (!slots->mSMILOverrideStyle) {