зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1488910 - Rename remaining uses of "SPCSPS" to "visual viewport size". r=botond
--HG-- extra : rebase_source : 8272c090e436d42926bf0e0584ad8f1b402011bb
This commit is contained in:
Родитель
67932714b4
Коммит
29454d7afb
|
@ -293,8 +293,8 @@ APZCCallbackHelper::UpdateRootFrame(FrameMetrics& aMetrics)
|
||||||
if (gfxPrefs::APZAllowZooming() && aMetrics.GetScrollOffsetUpdated()) {
|
if (gfxPrefs::APZAllowZooming() && aMetrics.GetScrollOffsetUpdated()) {
|
||||||
// If zooming is disabled then we don't really want to let APZ fiddle
|
// If zooming is disabled then we don't really want to let APZ fiddle
|
||||||
// with these things. In theory setting the resolution here should be a
|
// with these things. In theory setting the resolution here should be a
|
||||||
// no-op, but setting the SPCSPS is bad because it can cause a stale value
|
// no-op, but setting the visual viewport size is bad because it can cause a
|
||||||
// to be returned by window.innerWidth/innerHeight (see bug 1187792).
|
// stale value to be returned by window.innerWidth/innerHeight (see bug 1187792).
|
||||||
//
|
//
|
||||||
// We also skip this codepath unless the metrics has a scroll offset update
|
// We also skip this codepath unless the metrics has a scroll offset update
|
||||||
// type other eNone, because eNone just means that this repaint request
|
// type other eNone, because eNone just means that this repaint request
|
||||||
|
|
|
@ -118,7 +118,7 @@ MobileViewportManager::ResolutionUpdated()
|
||||||
// can take it into account later on.
|
// can take it into account later on.
|
||||||
SetRestoreResolution(mPresShell->GetResolution());
|
SetRestoreResolution(mPresShell->GetResolution());
|
||||||
}
|
}
|
||||||
RefreshSPCSPS();
|
RefreshVisualViewportSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -285,8 +285,8 @@ MobileViewportManager::UpdateResolution(const nsViewportInfo& aViewportInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MobileViewportManager::UpdateSPCSPS(const ScreenIntSize& aDisplaySize,
|
MobileViewportManager::UpdateVisualViewportSize(const ScreenIntSize& aDisplaySize,
|
||||||
const CSSToScreenScale& aZoom)
|
const CSSToScreenScale& aZoom)
|
||||||
{
|
{
|
||||||
ScreenSize compositionSize(aDisplaySize);
|
ScreenSize compositionSize(aDisplaySize);
|
||||||
ScreenMargin scrollbars =
|
ScreenMargin scrollbars =
|
||||||
|
@ -332,10 +332,10 @@ MobileViewportManager::UpdateDisplayPortMargins()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MobileViewportManager::RefreshSPCSPS()
|
MobileViewportManager::RefreshVisualViewportSize()
|
||||||
{
|
{
|
||||||
// This function is a subset of RefreshViewportSize, and only updates the
|
// This function is a subset of RefreshViewportSize, and only updates the
|
||||||
// SPCSPS.
|
// visual viewport size.
|
||||||
|
|
||||||
if (!gfxPrefs::APZAllowZooming()) {
|
if (!gfxPrefs::APZAllowZooming()) {
|
||||||
return;
|
return;
|
||||||
|
@ -350,7 +350,7 @@ MobileViewportManager::RefreshSPCSPS()
|
||||||
CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(cssToDev * res / ParentLayerToLayerScale(1),
|
CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(cssToDev * res / ParentLayerToLayerScale(1),
|
||||||
PixelCastJustification::ScreenIsParentLayerForRoot);
|
PixelCastJustification::ScreenIsParentLayerForRoot);
|
||||||
|
|
||||||
UpdateSPCSPS(displaySize, zoom);
|
UpdateVisualViewportSize(displaySize, zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -414,7 +414,7 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
|
||||||
CSSToScreenScale zoom = UpdateResolution(viewportInfo, displaySize, viewport,
|
CSSToScreenScale zoom = UpdateResolution(viewportInfo, displaySize, viewport,
|
||||||
displayWidthChangeRatio);
|
displayWidthChangeRatio);
|
||||||
MVM_LOG("%p: New zoom is %f\n", this, zoom.scale);
|
MVM_LOG("%p: New zoom is %f\n", this, zoom.scale);
|
||||||
UpdateSPCSPS(displaySize, zoom);
|
UpdateVisualViewportSize(displaySize, zoom);
|
||||||
}
|
}
|
||||||
if (gfxPlatform::AsyncPanZoomEnabled()) {
|
if (gfxPlatform::AsyncPanZoomEnabled()) {
|
||||||
UpdateDisplayPortMargins();
|
UpdateDisplayPortMargins();
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
void RequestReflow();
|
void RequestReflow();
|
||||||
|
|
||||||
/* Notify the MobileViewportManager that the resolution on the presShell was
|
/* Notify the MobileViewportManager that the resolution on the presShell was
|
||||||
* updated, and the SPCSPS needs to be updated. */
|
* updated, and the visual viewport size needs to be updated. */
|
||||||
void ResolutionUpdated();
|
void ResolutionUpdated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -67,8 +67,8 @@ private:
|
||||||
* need updating. */
|
* need updating. */
|
||||||
void RefreshViewportSize(bool aForceAdjustResolution);
|
void RefreshViewportSize(bool aForceAdjustResolution);
|
||||||
|
|
||||||
/* Secondary main helper method to update just the SPCSPS. */
|
/* Secondary main helper method to update just the visual viewport size. */
|
||||||
void RefreshSPCSPS();
|
void RefreshVisualViewportSize();
|
||||||
|
|
||||||
/* Helper to clamp the given zoom by the min/max in the viewport info. */
|
/* Helper to clamp the given zoom by the min/max in the viewport info. */
|
||||||
mozilla::CSSToScreenScale ClampZoom(const mozilla::CSSToScreenScale& aZoom,
|
mozilla::CSSToScreenScale ClampZoom(const mozilla::CSSToScreenScale& aZoom,
|
||||||
|
@ -87,9 +87,8 @@ private:
|
||||||
const mozilla::CSSSize& aViewport,
|
const mozilla::CSSSize& aViewport,
|
||||||
const mozilla::Maybe<float>& aDisplayWidthChangeRatio);
|
const mozilla::Maybe<float>& aDisplayWidthChangeRatio);
|
||||||
|
|
||||||
/* Updates the scroll-position-clamping scrollport size */
|
void UpdateVisualViewportSize(const mozilla::ScreenIntSize& aDisplaySize,
|
||||||
void UpdateSPCSPS(const mozilla::ScreenIntSize& aDisplaySize,
|
const mozilla::CSSToScreenScale& aZoom);
|
||||||
const mozilla::CSSToScreenScale& aZoom);
|
|
||||||
|
|
||||||
/* Updates the displayport margins for the presShell's root scrollable frame */
|
/* Updates the displayport margins for the presShell's root scrollable frame */
|
||||||
void UpdateDisplayPortMargins();
|
void UpdateDisplayPortMargins();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче