зеркало из https://github.com/mozilla/gecko-dev.git
Bug 881832 - Specify whether the height has changed when calling PresShell::ResizeReflow, since the PresContext size might have already been updated. r=dbaron
This commit is contained in:
Родитель
88ae853d40
Коммит
58b82b3f90
|
@ -374,6 +374,8 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
|
|||
UpdateDisplayPortMargins();
|
||||
}
|
||||
|
||||
CSSSize oldSize = mMobileViewportSize;
|
||||
|
||||
// Update internal state.
|
||||
mIsFirstPaint = false;
|
||||
mMobileViewportSize = viewport;
|
||||
|
@ -381,5 +383,7 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
|
|||
// Kick off a reflow.
|
||||
mPresShell->ResizeReflowIgnoreOverride(
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.width),
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.height));
|
||||
nsPresContext::CSSPixelsToAppUnits(viewport.height),
|
||||
nsPresContext::CSSPixelsToAppUnits(oldSize.width),
|
||||
nsPresContext::CSSPixelsToAppUnits(oldSize.height));
|
||||
}
|
||||
|
|
|
@ -418,12 +418,12 @@ public:
|
|||
* Reflow the frame model into a new width and height. The
|
||||
* coordinates for aWidth and aHeight must be in standard nscoord's.
|
||||
*/
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) = 0;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) = 0;
|
||||
/**
|
||||
* Do the same thing as ResizeReflow but even if ResizeReflowOverride was
|
||||
* called previously.
|
||||
*/
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) = 0;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) = 0;
|
||||
|
||||
/**
|
||||
* Returns true if ResizeReflowOverride has been called.
|
||||
|
|
|
@ -1801,7 +1801,7 @@ PresShell::AsyncResizeEventCallback(nsITimer* aTimer, void* aPresShell)
|
|||
}
|
||||
|
||||
nsresult
|
||||
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
|
||||
{
|
||||
if (mZoomConstraintsClient) {
|
||||
// If we have a ZoomConstraintsClient and the available screen area
|
||||
|
@ -1817,11 +1817,11 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
return ResizeReflowIgnoreOverride(aWidth, aHeight);
|
||||
return ResizeReflowIgnoreOverride(aWidth, aHeight, aOldWidth, aOldHeight);
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
|
||||
{
|
||||
NS_PRECONDITION(!mIsReflowing, "Shouldn't be in reflow here!");
|
||||
|
||||
|
@ -1835,7 +1835,6 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsSize oldVisibleSize = mPresContext->GetVisibleArea().Size();
|
||||
mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
|
||||
|
||||
// There isn't anything useful we can do if the initial reflow hasn't happened.
|
||||
|
@ -1848,8 +1847,8 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
|||
"shouldn't use unconstrained isize anymore");
|
||||
|
||||
const bool isBSizeChanging = wm.IsVertical()
|
||||
? oldVisibleSize.width != aWidth
|
||||
: oldVisibleSize.height != aHeight;
|
||||
? aOldWidth != aWidth
|
||||
: aOldHeight != aHeight;
|
||||
|
||||
RefPtr<nsViewManager> viewManagerDeathGrip = mViewManager;
|
||||
// Take this ref after viewManager so it'll make sure to go away first.
|
||||
|
|
|
@ -118,8 +118,8 @@ public:
|
|||
virtual void BeginObservingDocument() override;
|
||||
virtual void EndObservingDocument() override;
|
||||
virtual nsresult Initialize(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) override;
|
||||
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) override;
|
||||
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) override;
|
||||
virtual nsIPageSequenceFrame* GetPageSequenceFrame() const override;
|
||||
virtual nsCanvasFrame* GetCanvasFrame() const override;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight)
|
|||
// Don't resize the widget. It is already being set elsewhere.
|
||||
mRootView->SetDimensions(newDim, true, false);
|
||||
if (mPresShell)
|
||||
mPresShell->ResizeReflow(aWidth, aHeight);
|
||||
mPresShell->ResizeReflow(aWidth, aHeight, oldDim.width, oldDim.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче