Bug 1428491: Make sure that ResizeReflowIgnoreOverride doesn't style a document with a detached shell. r?heycam
We weren't checking mIsDestroying before flushing styles. Use the more general
path instead.
MozReview-Commit-ID: IY2KAVWW9Rt
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -1977,24 +1977,21 @@ PresShell::ResizeReflowIgnoreOverride(ns
mPresContext->SetVisibleArea(nsRect(0, 0, targetWidth, targetHeight));
RefPtr<nsViewManager> viewManager = mViewManager;
nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
if (!GetPresContext()->SuppressingResizeReflow()) {
// Have to make sure that the content notifications are flushed before we
- // start messing with the frame model; otherwise we can get content doubling.
- mDocument->FlushPendingNotifications(FlushType::ContentAndNotify);
-
- // Make sure style is up to date
- {
- nsAutoScriptBlocker scriptBlocker;
- mPresContext->RestyleManager()->ProcessPendingRestyles();
- }
+ // start messing with the frame model; otherwise we can get content
+ // doubling.
+ //
+ // Also, make sure style is up-to-date.
+ mDocument->FlushPendingNotifications(FlushType::Style);
rootFrame = mFrameConstructor->GetRootFrame();
if (!mIsDestroying && rootFrame) {
// XXX Do a full invalidate at the beginning so that invalidates along
// the way don't have region accumulation issues?
if (isBSizeChanging) {
// For BSize changes driven by style, RestyleManager handles this.