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 409166 6414aec048aea01d726832dec33e83f3d8503f0c
parent 409165 2e61d7b8278567b029369b2dca13a26421c945cb
child 409167 dc315bf0beb37b169a427de86bc233f98f06c854
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1368251
milestone55.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 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);
   }