Bug 1329919 - Skip repaint frame hint if there is no frame. r?heycam draft
authorShing Lyu <slyu@mozilla.com>
Fri, 03 Feb 2017 10:37:08 +0800
changeset 479139 688a27e1aaa9f46df003798f64c8074abfbc16f6
parent 462942 00d66078583f4c8e82c356ab8e7b497660ca4bac
child 544593 2672fd98c868de4ba0f74425545fb02500aad867
push id44154
push userbmo:slyu@mozilla.com
push dateMon, 06 Feb 2017 02:26:32 +0000
reviewersheycam
bugs1329919
milestone53.0a1
Bug 1329919 - Skip repaint frame hint if there is no frame. r?heycam MozReview-Commit-ID: F46VpEBJqvU
layout/base/ServoRestyleManager.cpp
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -144,19 +144,21 @@ ServoRestyleManager::RecreateStyleContex
                                            ServoStyleSet* aStyleSet,
                                            nsStyleChangeList& aChangeListToProcess)
 {
   nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
 
   // FIXME(bholley): Once we transfer ownership of the styles to the frame, we
   // can fast-reject without the FFI call by checking mServoData for null.
   nsChangeHint changeHint = Servo_TakeChangeHint(aElement);
-  if (changeHint & ~nsChangeHint_NeutralChange) {
-    aChangeListToProcess.AppendChange(
-      primaryFrame, aElement, changeHint & ~nsChangeHint_NeutralChange);
+  if (primaryFrame) { // If there is no frame we should skip this
+    if (changeHint & ~nsChangeHint_NeutralChange) {
+      aChangeListToProcess.AppendChange(
+        primaryFrame, aElement, changeHint & ~nsChangeHint_NeutralChange);
+    }
   }
 
   // If our change hint is reconstruct, we delegate to the frame constructor,
   // which consumes the new style and expects the old style to be on the frame.
   //
   // XXXbholley: We should teach the frame constructor how to clear the dirty
   // descendants bit to avoid the traversal here.
   if (changeHint & nsChangeHint_ReconstructFrame) {