Backed out changeset e29b0fbf77f1 (bug 1786513) for causing mochitest failures on /browser_unified_extensions.js CLOSED TREE

This commit is contained in:
Cristian Tuns 2022-08-26 11:11:46 -04:00
parent 68b47cd3fd
commit 24652e5425
13 changed files with 121 additions and 56 deletions

View file

@ -470,7 +470,33 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX,
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
MOZ_ASSERT_UNREACHABLE("This is unimplemented, API should be cleaned up"); NS_ENSURE_TRUE(aShellItem, NS_ERROR_FAILURE);
RefPtr<Document> document = aShellItem->GetDocument();
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(document->GetDocumentElement(), NS_ERROR_FAILURE);
// Set the preferred Size
// XXX
NS_ERROR("Implement this");
/*
Set the preferred size on the aShellItem.
*/
RefPtr<nsPresContext> presContext = mWebBrowser->mDocShell->GetPresContext();
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
RefPtr<PresShell> presShell = presContext->GetPresShell();
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(
presShell->ResizeReflow(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE),
NS_ERROR_FAILURE);
// XXX: this is weird, but we used to call a method here
// (webBrowserChrome->SizeBrowserTo()) whose implementations all failed like
// this, so...
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }

View file

@ -1031,8 +1031,9 @@ nsRect Element::GetClientAreaRect() {
doc->IsScrollingElement(this)) { doc->IsScrollingElement(this)) {
if (PresShell* presShell = doc->GetPresShell()) { if (PresShell* presShell = doc->GetPresShell()) {
// Ensure up to date dimensions, but don't reflow // Ensure up to date dimensions, but don't reflow
if (RefPtr<nsViewManager> viewManager = presShell->GetViewManager()) { RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
viewManager->FlushDelayedResize(); if (viewManager) {
viewManager->FlushDelayedResize(false);
} }
return nsRect(nsPoint(), presContext->GetVisibleArea().Size()); return nsRect(nsPoint(), presContext->GetVisibleArea().Size());
} }

View file

@ -3496,8 +3496,9 @@ nsresult nsGlobalWindowOuter::GetInnerSize(CSSSize& aSize) {
// Whether or not the css viewport has been overridden, we can get the // Whether or not the css viewport has been overridden, we can get the
// correct value by looking at the visible area of the presContext. // correct value by looking at the visible area of the presContext.
if (RefPtr<nsViewManager> viewManager = presShell->GetViewManager()) { RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
viewManager->FlushDelayedResize(); if (viewManager) {
viewManager->FlushDelayedResize(false);
} }
// FIXME: Bug 1598487 - Return the layout viewport instead of the ICB. // FIXME: Bug 1598487 - Return the layout viewport instead of the ICB.

View file

@ -194,16 +194,12 @@ void GeckoMVMContext::UpdateDisplayPortMargins() {
} }
void GeckoMVMContext::Reflow(const CSSSize& aNewSize) { void GeckoMVMContext::Reflow(const CSSSize& aNewSize) {
RefPtr doc = mDocument; MOZ_ASSERT(mPresShell);
RefPtr ps = mPresShell;
MOZ_ASSERT(doc); RefPtr<PresShell> presShell = mPresShell;
MOZ_ASSERT(ps); presShell->ResizeReflowIgnoreOverride(CSSPixel::ToAppUnits(aNewSize.width),
CSSPixel::ToAppUnits(aNewSize.height),
if (ps->ResizeReflowIgnoreOverride(CSSPixel::ToAppUnits(aNewSize.width), ResizeReflowOptions::NoOption);
CSSPixel::ToAppUnits(aNewSize.height))) {
doc->FlushPendingNotifications(FlushType::InterruptibleLayout);
}
} }
} // namespace mozilla } // namespace mozilla

View file

@ -1967,8 +1967,8 @@ void PresShell::RefreshZoomConstraintsForScreenSizeChange() {
} }
} }
void PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight, nsresult PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight,
ResizeReflowOptions aOptions) { ResizeReflowOptions aOptions) {
if (mZoomConstraintsClient) { if (mZoomConstraintsClient) {
// If we have a ZoomConstraintsClient and the available screen area // If we have a ZoomConstraintsClient and the available screen area
// changed, then we might need to disable double-tap-to-zoom, so notify // changed, then we might need to disable double-tap-to-zoom, so notify
@ -1983,19 +1983,21 @@ void PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight,
// the MVM. // the MVM.
MOZ_ASSERT(mMobileViewportManager); MOZ_ASSERT(mMobileViewportManager);
mMobileViewportManager->RequestReflow(false); mMobileViewportManager->RequestReflow(false);
return; return NS_OK;
} }
ResizeReflowIgnoreOverride(aWidth, aHeight, aOptions);
return ResizeReflowIgnoreOverride(aWidth, aHeight, aOptions);
} }
bool PresShell::SimpleResizeReflow(nscoord aWidth, nscoord aHeight) { void PresShell::SimpleResizeReflow(nscoord aWidth, nscoord aHeight,
ResizeReflowOptions aOptions) {
MOZ_ASSERT(aWidth != NS_UNCONSTRAINEDSIZE); MOZ_ASSERT(aWidth != NS_UNCONSTRAINEDSIZE);
MOZ_ASSERT(aHeight != NS_UNCONSTRAINEDSIZE); MOZ_ASSERT(aHeight != NS_UNCONSTRAINEDSIZE);
nsSize oldSize = mPresContext->GetVisibleArea().Size(); nsSize oldSize = mPresContext->GetVisibleArea().Size();
mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight)); mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
nsIFrame* rootFrame = GetRootFrame(); nsIFrame* rootFrame = GetRootFrame();
if (!rootFrame) { if (!rootFrame) {
return false; return;
} }
WritingMode wm = rootFrame->GetWritingMode(); WritingMode wm = rootFrame->GetWritingMode();
bool isBSizeChanging = bool isBSizeChanging =
@ -2009,7 +2011,14 @@ bool PresShell::SimpleResizeReflow(nscoord aWidth, nscoord aHeight) {
if (mMobileViewportManager) { if (mMobileViewportManager) {
mMobileViewportManager->UpdateSizesBeforeReflow(); mMobileViewportManager->UpdateSizesBeforeReflow();
} }
return true;
// For compat with the old code path which always reflowed as long as there
// was a root frame.
bool suppressReflow = (aOptions & ResizeReflowOptions::SuppressReflow) ||
mPresContext->SuppressingResizeReflow();
if (!suppressReflow) {
mDocument->FlushPendingNotifications(FlushType::InterruptibleLayout);
}
} }
void PresShell::AddResizeEventFlushObserverIfNeeded() { void PresShell::AddResizeEventFlushObserverIfNeeded() {
@ -2020,8 +2029,8 @@ void PresShell::AddResizeEventFlushObserverIfNeeded() {
} }
} }
bool PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nsresult PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
ResizeReflowOptions aOptions) { ResizeReflowOptions aOptions) {
MOZ_ASSERT(!mIsReflowing, "Shouldn't be in reflow here!"); MOZ_ASSERT(!mIsReflowing, "Shouldn't be in reflow here!");
// Historically we never fired resize events if there was no root frame by the // Historically we never fired resize events if there was no root frame by the
@ -2038,14 +2047,18 @@ bool PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
if (!(aOptions & ResizeReflowOptions::BSizeLimit)) { if (!(aOptions & ResizeReflowOptions::BSizeLimit)) {
nsSize oldSize = mPresContext->GetVisibleArea().Size(); nsSize oldSize = mPresContext->GetVisibleArea().Size();
if (oldSize == nsSize(aWidth, aHeight)) { if (oldSize == nsSize(aWidth, aHeight)) {
return false; return NS_OK;
} }
bool changed = SimpleResizeReflow(aWidth, aHeight); SimpleResizeReflow(aWidth, aHeight, aOptions);
postResizeEventIfNeeded(); postResizeEventIfNeeded();
return changed; return NS_OK;
} }
MOZ_ASSERT(!mPresContext->SuppressingResizeReflow() &&
!(aOptions & ResizeReflowOptions::SuppressReflow),
"Can't suppress resize reflow and shrink-wrap at the same time");
// Make sure that style is flushed before setting the pres context // Make sure that style is flushed before setting the pres context
// VisibleArea. // VisibleArea.
// //
@ -2062,13 +2075,13 @@ bool PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
if (aHeight == NS_UNCONSTRAINEDSIZE || aWidth == NS_UNCONSTRAINEDSIZE) { if (aHeight == NS_UNCONSTRAINEDSIZE || aWidth == NS_UNCONSTRAINEDSIZE) {
// We can't do the work needed for SizeToContent without a root // We can't do the work needed for SizeToContent without a root
// frame, and we want to return before setting the visible area. // frame, and we want to return before setting the visible area.
return false; return NS_ERROR_NOT_AVAILABLE;
} }
mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight)); mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
// There isn't anything useful we can do if the initial reflow hasn't // There isn't anything useful we can do if the initial reflow hasn't
// happened. // happened.
return true; return NS_OK;
} }
WritingMode wm = rootFrame->GetWritingMode(); WritingMode wm = rootFrame->GetWritingMode();
@ -2128,7 +2141,7 @@ bool PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
"height should not be NS_UNCONSTRAINEDSIZE after reflow"); "height should not be NS_UNCONSTRAINEDSIZE after reflow");
postResizeEventIfNeeded(); postResizeEventIfNeeded();
return true; return NS_OK; // XXX this needs to be real. MMP
} }
void PresShell::FireResizeEvent() { void PresShell::FireResizeEvent() {
@ -4316,7 +4329,7 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
// Process pending restyles, since any flush of the presshell wants // Process pending restyles, since any flush of the presshell wants
// up-to-date style data. // up-to-date style data.
if (MOZ_LIKELY(!mIsDestroying)) { if (MOZ_LIKELY(!mIsDestroying)) {
viewManager->FlushDelayedResize(); viewManager->FlushDelayedResize(false);
mPresContext->FlushPendingMediaFeatureValuesChanged(); mPresContext->FlushPendingMediaFeatureValuesChanged();
} }

View file

@ -346,17 +346,15 @@ class PresShell final : public nsStubDocumentObserver,
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult Initialize(); MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult Initialize();
/** /**
* Schedule a reflow for the frame model into a new width and height. The * Reflow the frame model into a new width and height. The
* coordinates for aWidth and aHeight must be in standard nscoord's. * coordinates for aWidth and aHeight must be in standard nscoord's.
*
* Returns whether layout might have changed.
*/ */
MOZ_CAN_RUN_SCRIPT void ResizeReflow( MOZ_CAN_RUN_SCRIPT nsresult
nscoord aWidth, nscoord aHeight, ResizeReflow(nscoord aWidth, nscoord aHeight,
ResizeReflowOptions = ResizeReflowOptions::NoOption); ResizeReflowOptions = ResizeReflowOptions::NoOption);
MOZ_CAN_RUN_SCRIPT bool ResizeReflowIgnoreOverride( MOZ_CAN_RUN_SCRIPT nsresult ResizeReflowIgnoreOverride(nscoord aWidth,
nscoord aWidth, nscoord aHeight, nscoord aHeight,
ResizeReflowOptions = ResizeReflowOptions::NoOption); ResizeReflowOptions);
/** /**
* Add this pres shell to the refresh driver to be observed for resize * Add this pres shell to the refresh driver to be observed for resize
@ -384,7 +382,7 @@ class PresShell final : public nsStubDocumentObserver,
* This is what ResizeReflowIgnoreOverride does when not shrink-wrapping (that * This is what ResizeReflowIgnoreOverride does when not shrink-wrapping (that
* is, when ResizeReflowOptions::BSizeLimit is not specified). * is, when ResizeReflowOptions::BSizeLimit is not specified).
*/ */
bool SimpleResizeReflow(nscoord aWidth, nscoord aHeight); void SimpleResizeReflow(nscoord aWidth, nscoord aHeight, ResizeReflowOptions);
public: public:
/** /**

View file

@ -36,6 +36,12 @@ enum class ResizeReflowOptions : uint32_t {
// the resulting BSize can be less than the given one, producing // the resulting BSize can be less than the given one, producing
// shrink-to-fit sizing in the block dimension // shrink-to-fit sizing in the block dimension
BSizeLimit = 1 << 0, BSizeLimit = 1 << 0,
// Invalidate layout, but don't reflow.
//
// TODO(emilio): Ideally this should just become the default, or we should
// unconditionally not reflow and rely on the caller to do so, having a
// separate API for shrink-to-fit.
SuppressReflow = 1 << 1,
}; };
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ResizeReflowOptions) MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ResizeReflowOptions)

View file

@ -2634,8 +2634,9 @@ nsresult nsDocumentViewer::GetContentSizeInternal(int32_t* aWidth,
nscoord height = wm.IsVertical() ? prefISize : aMaxHeight; nscoord height = wm.IsVertical() ? prefISize : aMaxHeight;
nscoord width = wm.IsVertical() ? aMaxWidth : prefISize; nscoord width = wm.IsVertical() ? aMaxWidth : prefISize;
nsresult rv =
presShell->ResizeReflow(width, height, ResizeReflowOptions::BSizeLimit); presShell->ResizeReflow(width, height, ResizeReflowOptions::BSizeLimit);
NS_ENSURE_SUCCESS(rv, rv);
RefPtr<nsPresContext> presContext = GetPresContext(); RefPtr<nsPresContext> presContext = GetPresContext();
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE); NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);

View file

@ -278,6 +278,7 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType)
mUsesFontMetricDependentFontUnits(false), mUsesFontMetricDependentFontUnits(false),
mCounterStylesDirty(true), mCounterStylesDirty(true),
mFontFeatureValuesDirty(true), mFontFeatureValuesDirty(true),
mSuppressResizeReflow(false),
mIsVisual(false), mIsVisual(false),
mHasWarnedAboutPositionedTableParts(false), mHasWarnedAboutPositionedTableParts(false),
mHasWarnedAboutTooLargeDashedOrDottedRadius(false), mHasWarnedAboutTooLargeDashedOrDottedRadius(false),
@ -1284,6 +1285,15 @@ void nsPresContext::SetFullZoom(float aZoom) {
float oldHeightDevPixels = oldHeightAppUnits / float(mCurAppUnitsPerDevPixel); float oldHeightDevPixels = oldHeightAppUnits / float(mCurAppUnitsPerDevPixel);
mDeviceContext->SetFullZoom(aZoom); mDeviceContext->SetFullZoom(aZoom);
NS_ASSERTION(!mSuppressResizeReflow,
"two zooms happening at the same time? Impossible!");
// We can't suppress the resize reflow if we support APZ zooming, as MVM
// relies on ResizeReflowIgnoreOverride() actually updating layout to update
// the viewport based on that.
RefPtr<MobileViewportManager> mvm = mPresShell->GetMobileViewportManager();
mSuppressResizeReflow = !mvm;
mFullZoom = aZoom; mFullZoom = aZoom;
AppUnitsPerDevPixelChanged(); AppUnitsPerDevPixelChanged();
@ -1291,6 +1301,8 @@ void nsPresContext::SetFullZoom(float aZoom) {
mPresShell->GetViewManager()->SetWindowDimensions( mPresShell->GetViewManager()->SetWindowDimensions(
NSToCoordRound(oldWidthDevPixels * AppUnitsPerDevPixel()), NSToCoordRound(oldWidthDevPixels * AppUnitsPerDevPixel()),
NSToCoordRound(oldHeightDevPixels * AppUnitsPerDevPixel())); NSToCoordRound(oldHeightDevPixels * AppUnitsPerDevPixel()));
mSuppressResizeReflow = false;
} }
void nsPresContext::SetOverrideDPPX(float aDPPX) { void nsPresContext::SetOverrideDPPX(float aDPPX) {
@ -2824,7 +2836,8 @@ void nsPresContext::SetDynamicToolbarMaxHeight(ScreenIntCoord aHeight) {
nscoord currentWidth, currentHeight; nscoord currentWidth, currentHeight;
presShell->GetViewManager()->GetWindowDimensions(&currentWidth, presShell->GetViewManager()->GetWindowDimensions(&currentWidth,
&currentHeight); &currentHeight);
presShell->ResizeReflow(currentWidth, currentHeight); presShell->ResizeReflow(currentWidth, currentHeight,
ResizeReflowOptions::NoOption);
} }
} }

View file

@ -906,6 +906,8 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
// Is this presentation in a chrome docshell? // Is this presentation in a chrome docshell?
bool IsChrome() const; bool IsChrome() const;
bool SuppressingResizeReflow() const { return mSuppressResizeReflow; }
gfxUserFontSet* GetUserFontSet(); gfxUserFontSet* GetUserFontSet();
// Should be called whenever the set of fonts available in the user // Should be called whenever the set of fonts available in the user
@ -1362,6 +1364,10 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
// Is the current mFontFeatureValuesLookup valid? // Is the current mFontFeatureValuesLookup valid?
unsigned mFontFeatureValuesDirty : 1; unsigned mFontFeatureValuesDirty : 1;
// resize reflow is suppressed when the only change has been to zoom
// the document rather than to change the document's dimensions
unsigned mSuppressResizeReflow : 1;
unsigned mIsVisual : 1; unsigned mIsVisual : 1;
unsigned mHasWarnedAboutPositionedTableParts : 1; unsigned mHasWarnedAboutPositionedTableParts : 1;

View file

@ -9,7 +9,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1067345
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head> </head>
<body> <body>
<script>
<script type="text/javascript">
// Ensure srcset/picture are enabled, re-run the test at different DPI // Ensure srcset/picture are enabled, re-run the test at different DPI
// levels to ensure preload step does the right responsive image selection // levels to ensure preload step does the right responsive image selection
@ -66,9 +67,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1067345
iframe.addEventListener("load", function() { iframe.addEventListener("load", function() {
SpecialPowers.pushPrefEnv({"set": [ [ "layout.css.devPixelsPerPx", currentDPI ]] }, SpecialPowers.pushPrefEnv({"set": [ [ "layout.css.devPixelsPerPx", currentDPI ]] },
function() { function() {
// Make sure we trigger a layout flush so that the frame is sized
// appropriately after the DPI changes.
iframe.getBoundingClientRect();
// Clear image cache for next run (we don't try to validate cached items // Clear image cache for next run (we don't try to validate cached items
// in preload). // in preload).
SpecialPowers.Cc["@mozilla.org/image/tools;1"] SpecialPowers.Cc["@mozilla.org/image/tools;1"]

View file

@ -165,7 +165,8 @@ void nsViewManager::GetWindowDimensions(nscoord* aWidth, nscoord* aHeight) {
} }
} }
void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight) { void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight,
bool aDoReflow) {
nsRect oldDim = mRootView->GetDimensions(); nsRect oldDim = mRootView->GetDimensions();
nsRect newDim(0, 0, aWidth, aHeight); nsRect newDim(0, 0, aWidth, aHeight);
// We care about resizes even when one dimension is already zero. // We care about resizes even when one dimension is already zero.
@ -175,7 +176,11 @@ void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight) {
// Don't resize the widget. It is already being set elsewhere. // Don't resize the widget. It is already being set elsewhere.
mRootView->SetDimensions(newDim, true, false); mRootView->SetDimensions(newDim, true, false);
if (RefPtr<PresShell> presShell = mPresShell) { if (RefPtr<PresShell> presShell = mPresShell) {
presShell->ResizeReflow(aWidth, aHeight); auto options = ResizeReflowOptions::NoOption;
if (!aDoReflow) {
options |= ResizeReflowOptions::SuppressReflow;
}
presShell->ResizeReflow(aWidth, aHeight, options);
} }
} }
@ -205,10 +210,10 @@ void nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight,
// root view's current size then DoSetWindowDimensions will not // root view's current size then DoSetWindowDimensions will not
// request a resize reflow (which would correct it). See bug 617076. // request a resize reflow (which would correct it). See bug 617076.
mDelayedResize = nsSize(aWidth, aHeight); mDelayedResize = nsSize(aWidth, aHeight);
FlushDelayedResize(); FlushDelayedResize(false);
} }
mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE); mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE);
DoSetWindowDimensions(aWidth, aHeight); DoSetWindowDimensions(aWidth, aHeight, /* aDoReflow = */ true);
} else { } else {
mDelayedResize.SizeTo(aWidth, aHeight); mDelayedResize.SizeTo(aWidth, aHeight);
if (mPresShell) { if (mPresShell) {
@ -219,9 +224,10 @@ void nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight,
} }
} }
void nsViewManager::FlushDelayedResize() { void nsViewManager::FlushDelayedResize(bool aDoReflow) {
if (mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE)) { if (mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE)) {
DoSetWindowDimensions(mDelayedResize.width, mDelayedResize.height); DoSetWindowDimensions(mDelayedResize.width, mDelayedResize.height,
aDoReflow);
mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE); mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE);
} }
} }
@ -404,7 +410,7 @@ void nsViewManager::ProcessPendingUpdatesPaint(nsIWidget* aWidget) {
if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) && if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
vm->mRootView->IsEffectivelyVisible() && vm->mPresShell && vm->mRootView->IsEffectivelyVisible() && vm->mPresShell &&
vm->mPresShell->IsVisible()) { vm->mPresShell->IsVisible()) {
vm->FlushDelayedResize(); vm->FlushDelayedResize(true);
} }
} }
nsView* view = nsView::GetViewFor(aWidget); nsView* view = nsView::GetViewFor(aWidget);

View file

@ -99,7 +99,7 @@ class nsViewManager final {
/** /**
* Do any resizes that are pending. * Do any resizes that are pending.
*/ */
void FlushDelayedResize(); void FlushDelayedResize(bool aDoReflow);
/** /**
* Called to inform the view manager that the entire area of a view * Called to inform the view manager that the entire area of a view
@ -365,7 +365,7 @@ class nsViewManager final {
LayoutDeviceIntRect ViewToWidget(nsView* aView, const nsRect& aRect) const; LayoutDeviceIntRect ViewToWidget(nsView* aView, const nsRect& aRect) const;
MOZ_CAN_RUN_SCRIPT_BOUNDARY MOZ_CAN_RUN_SCRIPT_BOUNDARY
void DoSetWindowDimensions(nscoord aWidth, nscoord aHeight); void DoSetWindowDimensions(nscoord aWidth, nscoord aHeight, bool aDoReflow);
bool ShouldDelayResize() const; bool ShouldDelayResize() const;
bool IsPainting() const { return RootViewManager()->mPainting; } bool IsPainting() const { return RootViewManager()->mPainting; }