Bug 1488910 - Rename remaining uses of "SPCSPS" to "visual viewport size". r=botond

--HG--
extra : rebase_source : 8272c090e436d42926bf0e0584ad8f1b402011bb
This commit is contained in:
Arika Arnzen 2018-09-14 15:23:28 -04:00
Родитель 67932714b4
Коммит 29454d7afb
3 изменённых файлов: 14 добавлений и 15 удалений

Просмотреть файл

@ -293,8 +293,8 @@ APZCCallbackHelper::UpdateRootFrame(FrameMetrics& aMetrics)
if (gfxPrefs::APZAllowZooming() && aMetrics.GetScrollOffsetUpdated()) {
// 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
// no-op, but setting the SPCSPS is bad because it can cause a stale value
// to be returned by window.innerWidth/innerHeight (see bug 1187792).
// no-op, but setting the visual viewport size is bad because it can cause a
// 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
// type other eNone, because eNone just means that this repaint request

Просмотреть файл

@ -118,7 +118,7 @@ MobileViewportManager::ResolutionUpdated()
// can take it into account later on.
SetRestoreResolution(mPresShell->GetResolution());
}
RefreshSPCSPS();
RefreshVisualViewportSize();
}
NS_IMETHODIMP
@ -285,8 +285,8 @@ MobileViewportManager::UpdateResolution(const nsViewportInfo& aViewportInfo,
}
void
MobileViewportManager::UpdateSPCSPS(const ScreenIntSize& aDisplaySize,
const CSSToScreenScale& aZoom)
MobileViewportManager::UpdateVisualViewportSize(const ScreenIntSize& aDisplaySize,
const CSSToScreenScale& aZoom)
{
ScreenSize compositionSize(aDisplaySize);
ScreenMargin scrollbars =
@ -332,10 +332,10 @@ MobileViewportManager::UpdateDisplayPortMargins()
}
void
MobileViewportManager::RefreshSPCSPS()
MobileViewportManager::RefreshVisualViewportSize()
{
// This function is a subset of RefreshViewportSize, and only updates the
// SPCSPS.
// visual viewport size.
if (!gfxPrefs::APZAllowZooming()) {
return;
@ -350,7 +350,7 @@ MobileViewportManager::RefreshSPCSPS()
CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(cssToDev * res / ParentLayerToLayerScale(1),
PixelCastJustification::ScreenIsParentLayerForRoot);
UpdateSPCSPS(displaySize, zoom);
UpdateVisualViewportSize(displaySize, zoom);
}
void
@ -414,7 +414,7 @@ MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution)
CSSToScreenScale zoom = UpdateResolution(viewportInfo, displaySize, viewport,
displayWidthChangeRatio);
MVM_LOG("%p: New zoom is %f\n", this, zoom.scale);
UpdateSPCSPS(displaySize, zoom);
UpdateVisualViewportSize(displaySize, zoom);
}
if (gfxPlatform::AsyncPanZoomEnabled()) {
UpdateDisplayPortMargins();

Просмотреть файл

@ -53,7 +53,7 @@ public:
void RequestReflow();
/* 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();
private:
@ -67,8 +67,8 @@ private:
* need updating. */
void RefreshViewportSize(bool aForceAdjustResolution);
/* Secondary main helper method to update just the SPCSPS. */
void RefreshSPCSPS();
/* Secondary main helper method to update just the visual viewport size. */
void RefreshVisualViewportSize();
/* Helper to clamp the given zoom by the min/max in the viewport info. */
mozilla::CSSToScreenScale ClampZoom(const mozilla::CSSToScreenScale& aZoom,
@ -87,9 +87,8 @@ private:
const mozilla::CSSSize& aViewport,
const mozilla::Maybe<float>& aDisplayWidthChangeRatio);
/* Updates the scroll-position-clamping scrollport size */
void UpdateSPCSPS(const mozilla::ScreenIntSize& aDisplaySize,
const mozilla::CSSToScreenScale& aZoom);
void UpdateVisualViewportSize(const mozilla::ScreenIntSize& aDisplaySize,
const mozilla::CSSToScreenScale& aZoom);
/* Updates the displayport margins for the presShell's root scrollable frame */
void UpdateDisplayPortMargins();