зеркало из https://github.com/mozilla/gecko-dev.git
Bug 973619 - Pick up the zoom from layout when the viewport dimensions change. r=botond
This commit is contained in:
Родитель
1951f0649d
Коммит
6ad061c59b
|
@ -2696,6 +2696,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
|||
|
||||
mPaintThrottler.TaskComplete(GetFrameTime());
|
||||
bool needContentRepaint = false;
|
||||
bool viewportUpdated = false;
|
||||
if (FuzzyEqualsAdditive(aLayerMetrics.mCompositionBounds.width, mFrameMetrics.mCompositionBounds.width) &&
|
||||
FuzzyEqualsAdditive(aLayerMetrics.mCompositionBounds.height, mFrameMetrics.mCompositionBounds.height)) {
|
||||
// Remote content has sync'd up to the composition geometry
|
||||
|
@ -2703,6 +2704,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
|||
if (mFrameMetrics.GetViewport().width != aLayerMetrics.GetViewport().width ||
|
||||
mFrameMetrics.GetViewport().height != aLayerMetrics.GetViewport().height) {
|
||||
needContentRepaint = true;
|
||||
viewportUpdated = true;
|
||||
}
|
||||
mFrameMetrics.SetViewport(aLayerMetrics.GetViewport());
|
||||
}
|
||||
|
@ -2743,7 +2745,8 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
|||
// determined by Gecko and our copy in mFrameMetrics may be stale.
|
||||
|
||||
if (FuzzyEqualsAdditive(mFrameMetrics.mCompositionBounds.width, aLayerMetrics.mCompositionBounds.width) &&
|
||||
mFrameMetrics.GetDevPixelsPerCSSPixel() == aLayerMetrics.GetDevPixelsPerCSSPixel()) {
|
||||
mFrameMetrics.GetDevPixelsPerCSSPixel() == aLayerMetrics.GetDevPixelsPerCSSPixel() &&
|
||||
!viewportUpdated) {
|
||||
// Any change to the pres shell resolution was requested by APZ and is
|
||||
// already included in our zoom; however, other components of the
|
||||
// cumulative resolution (a parent document's pres-shell resolution, or
|
||||
|
@ -2757,8 +2760,9 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
|||
/ mFrameMetrics.mPresShellResolution;
|
||||
mFrameMetrics.ZoomBy(totalResolutionChange / presShellResolutionChange);
|
||||
} else {
|
||||
// Take the new zoom as either device scale or composition width or both
|
||||
// got changed (e.g. due to orientation change).
|
||||
// Take the new zoom as either device scale or composition width or
|
||||
// viewport size got changed (e.g. due to orientation change, or content
|
||||
// changing the meta-viewport tag).
|
||||
mFrameMetrics.SetZoom(aLayerMetrics.GetZoom());
|
||||
mFrameMetrics.SetDevPixelsPerCSSPixel(aLayerMetrics.GetDevPixelsPerCSSPixel());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче