Bug 1366142: Ignore reentrant change hints without primary frame. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 20 May 2017 14:35:37 +0200
changeset 581968 16e383b65612854f666f479123cdf671586ac4d4
parent 581961 c8c65c2fd29d8200b62daea192c951bea905e268
child 629633 f36c748d945c98a56231c2cc79569c7e45cceaa3
push id59932
push userbmo:emilio+bugs@crisal.io
push dateSat, 20 May 2017 12:37:19 +0000
reviewersheycam
bugs1366142
milestone55.0a1
Bug 1366142: Ignore reentrant change hints without primary frame. r?heycam MozReview-Commit-ID: 4bF7M0KMhNL
layout/base/ServoRestyleManager.cpp
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -556,16 +556,24 @@ ServoRestyleManager::ProcessPendingResty
     // processing existing ones. We redirect those into a secondary queue and
     // iterate until there's nothing left.
     ReentrantChangeList newChanges;
     mReentrantChanges = &newChanges;
     while (!currentChanges.IsEmpty()) {
       ProcessRestyledFrames(currentChanges);
       MOZ_ASSERT(currentChanges.IsEmpty());
       for (ReentrantChange& change: newChanges)  {
+        if (!(change.mHint & nsChangeHint_ReconstructFrame) &&
+            !change.mContent->GetPrimaryFrame()) {
+          // SVG Elements post change hints without ensuring that the primary
+          // frame will be there after that (see bug 1366142).
+          //
+          // Just ignore those, since we can't really process them.
+          continue;
+        }
         currentChanges.AppendChange(change.mContent->GetPrimaryFrame(),
                                     change.mContent, change.mHint);
       }
       newChanges.Clear();
     }
     mReentrantChanges = nullptr;
 
     IncrementRestyleGeneration();