Bug 1439793: Handle correctly a reconstruct generated from additional style contexts. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 21 Feb 2018 09:32:53 +0100
changeset 404660 601daa76d78093d7bc2320adf6a615b97db2664d
parent 404659 2e6fed1f75aee8ff76c7ea4d2ba4189b758c0b15
child 404661 9cffcaa222296b920255eb4d74fd999d0057e887
push id100058
push userrgurzau@mozilla.com
push dateWed, 21 Feb 2018 17:32:49 +0000
treeherdermozilla-inbound@fa4bede5ed1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1439793
milestone60.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 1439793: Handle correctly a reconstruct generated from additional style contexts. r=xidorn Much like we do in nsIFrame::UpdateStyleOfOwnedChildFrame. There's also the fact that ::-moz-math-anonymous shouldn't probably be content-exposed... Oh well. MozReview-Commit-ID: 8mthwW7Nivy
layout/base/ServoRestyleManager.cpp
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -651,16 +651,21 @@ UpdateOneAdditionalStyleContext(nsIFrame
     &equalStructs,
     &samePointerStructs);
   if (!aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
     childHint = NS_RemoveSubsumedHints(
         childHint, aRestyleState.ChangesHandledFor(*aFrame));
   }
 
   if (childHint) {
+    if (childHint & nsChangeHint_ReconstructFrame) {
+      // If we generate a reconstruct here, remove any non-reconstruct hints we
+      // may have already generated for this content.
+      aRestyleState.ChangeList().PopChangesForContent(aFrame->GetContent());
+    }
     aRestyleState.ChangeList().AppendChange(
         aFrame, aFrame->GetContent(), childHint);
   }
 
   aFrame->SetAdditionalStyleContext(aIndex, newContext);
 }
 
 static void