Bug 1357869 - Don't assert when we restyle a child provider frame when an ancestor already handled nsChangeHint_ReconstructFrame. r?dbaron draft
authorCameron McCormack <cam@mcc.id.au>
Thu, 20 Apr 2017 17:51:41 +1000
changeset 565675 ab7473dadd499502d02a8792e1e6ba9705cc9eee
parent 563802 a374c35469935a874fefe64d3e07003fc5bc8884
child 625070 7e8138717e2e720c466f033ff936612ad08d7caf
push id54954
push userbmo:cam@mcc.id.au
push dateThu, 20 Apr 2017 07:51:54 +0000
reviewersdbaron
bugs1357869
milestone55.0a1
Bug 1357869 - Don't assert when we restyle a child provider frame when an ancestor already handled nsChangeHint_ReconstructFrame. r?dbaron MozReview-Commit-ID: D6mQeyo9zNl
layout/base/GeckoRestyleManager.cpp
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -1169,19 +1169,26 @@ ElementRestyler::ElementRestyler(ParentC
   , mOurA11yNotification(eDontNotify)
   , mVisibleKidsOfHiddenElement(aParentRestyler.mVisibleKidsOfHiddenElement)
 #endif
 #ifdef RESTYLE_LOGGING
   , mLoggingDepth(aParentRestyler.mLoggingDepth + 1)
 #endif
 {
   MOZ_ASSERT_IF(mContent, !mContent->IsStyledByServo());
-  MOZ_ASSERT(!(mHintsHandledByAncestors & nsChangeHint_ReconstructFrame),
-             "why restyle descendants if we are reconstructing the frame for "
-             "an ancestor?");
+
+  // We would assert here that we're not restyling a child provider frame if
+  // mHintsHandledByAncestors includes nsChangeHint_ReconstructFrame, but
+  // we do actually do this if the ReconstructFrame hint came from the
+  // RestyleTracker, rather than generated from CalcDifference.  (We could
+  // even try to avoid restyling the child provider frame, by returning
+  // early in ElementRestyler::Restyle if we grab out a ReconstructFrame
+  // hint from the RestyleTracker, but it's trickier to verify its correctness
+  // with all of the tree patching that happens currently, so for now we just
+  // skip the assertion.)
 }
 
 ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
                                  nsIContent* aContent,
                                  nsStyleChangeList* aChangeList,
                                  nsChangeHint aHintsHandledByAncestors,
                                  RestyleTracker& aRestyleTracker,
                                  nsTArray<nsCSSSelector*>& aSelectorsForDescendants,