зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1523844 Part 2: Make MVMContext::SetResolutionAndScaleTo accept a ResolutionChangeOrigin. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D41631 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
be668ed4e1
Коммит
c9e9805838
|
@ -61,7 +61,10 @@ class MockMVMContext : public MVMContext {
|
|||
}
|
||||
bool AllowZoomingForDocument() const { return true; }
|
||||
|
||||
void SetResolutionAndScaleTo(float aResolution) { mResolution = aResolution; }
|
||||
void SetResolutionAndScaleTo(float aResolution,
|
||||
ResolutionChangeOrigin aOrigin) {
|
||||
mResolution = aResolution;
|
||||
}
|
||||
void Reflow(const CSSSize& aNewSize, const CSSSize& aOldSize,
|
||||
ResizeEventFlag aResizeEventFlag) {
|
||||
mICBSize = aNewSize;
|
||||
|
|
|
@ -124,10 +124,10 @@ bool GeckoMVMContext::AllowZoomingForDocument() const {
|
|||
return nsLayoutUtils::AllowZoomingForDocument(mDocument);
|
||||
}
|
||||
|
||||
void GeckoMVMContext::SetResolutionAndScaleTo(float aResolution) {
|
||||
void GeckoMVMContext::SetResolutionAndScaleTo(float aResolution,
|
||||
ResolutionChangeOrigin aOrigin) {
|
||||
MOZ_ASSERT(mPresShell);
|
||||
mPresShell->SetResolutionAndScaleTo(
|
||||
aResolution, ResolutionChangeOrigin::MainThreadRestore);
|
||||
mPresShell->SetResolutionAndScaleTo(aResolution, aOrigin);
|
||||
}
|
||||
|
||||
void GeckoMVMContext::SetVisualViewportSize(const CSSSize& aSize) {
|
||||
|
|
|
@ -48,7 +48,8 @@ class GeckoMVMContext : public MVMContext {
|
|||
Maybe<LayoutDeviceIntSize> GetContentViewerSize() const override;
|
||||
bool AllowZoomingForDocument() const override;
|
||||
|
||||
void SetResolutionAndScaleTo(float aResolution) override;
|
||||
void SetResolutionAndScaleTo(float aResolution,
|
||||
ResolutionChangeOrigin aOrigin) override;
|
||||
void SetVisualViewportSize(const CSSSize& aSize) override;
|
||||
void UpdateDisplayPortMargins() override;
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "nsISupportsImpl.h"
|
||||
#include "nsStringFwd.h"
|
||||
#include "nsViewportInfo.h"
|
||||
#include "PresShell.h"
|
||||
|
||||
class nsIDOMEventListener;
|
||||
class nsIObserver;
|
||||
|
@ -51,7 +52,8 @@ class MVMContext {
|
|||
virtual Maybe<LayoutDeviceIntSize> GetContentViewerSize() const = 0;
|
||||
virtual bool AllowZoomingForDocument() const = 0;
|
||||
|
||||
virtual void SetResolutionAndScaleTo(float aResolution) = 0;
|
||||
virtual void SetResolutionAndScaleTo(float aResolution,
|
||||
ResolutionChangeOrigin aOrigin) = 0;
|
||||
virtual void SetVisualViewportSize(const CSSSize& aSize) = 0;
|
||||
virtual void UpdateDisplayPortMargins() = 0;
|
||||
|
||||
|
|
|
@ -417,7 +417,8 @@ void MobileViewportManager::UpdateResolution(
|
|||
"zoom factor must be positive");
|
||||
LayoutDeviceToLayerScale resolution = ZoomToResolution(*newZoom, cssToDev);
|
||||
MVM_LOG("%p: setting resolution %f\n", this, resolution.scale);
|
||||
mContext->SetResolutionAndScaleTo(resolution.scale);
|
||||
mContext->SetResolutionAndScaleTo(
|
||||
resolution.scale, ResolutionChangeOrigin::MainThreadRestore);
|
||||
|
||||
MVM_LOG("%p: New zoom is %f\n", this, newZoom->scale);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче