Bug 1368251 - Check frame state bit before looking up InvalidationRect() property. r=mats
authorJonathan Kew <jkew@mozilla.com>
Sun, 28 May 2017 11:22:39 +0100
changeset 585757 6414aec048aea01d726832dec33e83f3d8503f0c
parent 585756 2e61d7b8278567b029369b2dca13a26421c945cb
child 585758 dc315bf0beb37b169a427de86bc233f98f06c854
push id61188
push usermaglione.k@gmail.com
push dateSun, 28 May 2017 22:11:50 +0000
reviewersmats
bugs1368251
milestone55.0a1
Bug 1368251 - Check frame state bit before looking up InvalidationRect() property. r=mats
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6555,18 +6555,21 @@ nsIFrame::InvalidateFrameWithRect(const 
   } else {
     alreadyInvalid = true;
   } 
 
   if (!hasDisplayItem) {
     return;
   }
 
-  nsRect* rect = GetProperty(InvalidationRect());
-  if (!rect) {
+  nsRect* rect;
+  if (HasAnyStateBits(NS_FRAME_HAS_INVALID_RECT)) {
+    rect = GetProperty(InvalidationRect());
+    MOZ_ASSERT(rect);
+  } else {
     if (alreadyInvalid) {
       return;
     }
     rect = new nsRect();
     SetProperty(InvalidationRect(), rect);
     AddStateBits(NS_FRAME_HAS_INVALID_RECT);
   }