Bug 1431474: Try to assert nice things about what's going on on our flushes. r?bz
This is green on try... Let's see on the wild.
MozReview-Commit-ID: C9Gam0s42pO
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -4097,16 +4097,18 @@ PresShell::DoFlushPendingNotifications(m
/**
* VERY IMPORTANT: If you add some sort of new flushing to this
* method, make sure to add the relevant SetNeedLayoutFlush or
* SetNeedStyleFlush calls on the shell.
*/
FlushType flushType = aFlush.mFlushType;
MOZ_ASSERT(NeedFlush(flushType), "Why did we get called?");
+ MOZ_DIAGNOSTIC_ASSERT(mDocument->HasShellOrBFCacheEntry());
+ MOZ_DIAGNOSTIC_ASSERT(mDocument->GetShell() == this);
#ifdef MOZ_GECKO_PROFILER
static const EnumeratedArray<FlushType,
FlushType::Count,
const char*> flushTypeNames = {
"",
"Event",
"Content",
@@ -4118,20 +4120,20 @@ PresShell::DoFlushPendingNotifications(m
"InterruptibleLayout",
"Layout",
"Display"
};
AUTO_PROFILER_LABEL_DYNAMIC_CSTR("PresShell::DoFlushPendingNotifications",
GRAPHICS, flushTypeNames[flushType]);
#endif
+
#ifdef ACCESSIBILITY
#ifdef DEBUG
- nsAccessibilityService* accService = GetAccService();
- if (accService) {
+ if (nsAccessibilityService* accService = GetAccService()) {
NS_ASSERTION(!accService->IsProcessingRefreshDriverNotification(),
"Flush during accessible tree update!");
}
#endif
#endif
NS_ASSERTION(flushType >= FlushType::Frames, "Why did we get called?");