mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-24 00:24:14 +00:00
Bug 957790 - Initialize the APZC with zooming disabled until we know for sure if it is allowed. r=botond,jimm
On Metro we don't support the meta-viewport tag yet, so we need to re-enable zooming there.
This commit is contained in:
parent
592f1133b6
commit
3961cc600f
@ -393,7 +393,7 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
|
||||
mTouchListenerTimeoutTask(nullptr),
|
||||
mX(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
mY(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
mZoomConstraints(true, MIN_ZOOM, MAX_ZOOM),
|
||||
mZoomConstraints(false, MIN_ZOOM, MAX_ZOOM),
|
||||
mLastSampleTime(GetFrameTime()),
|
||||
mState(NOTHING),
|
||||
mLastAsyncScrollTime(GetFrameTime()),
|
||||
@ -1643,6 +1643,8 @@ void AsyncPanZoomController::TimeoutTouchListeners() {
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::UpdateZoomConstraints(const ZoomConstraints& aConstraints) {
|
||||
APZC_LOG("%p updating zoom constraints to %d %f %f\n", this, aConstraints.mAllowZoom,
|
||||
aConstraints.mMinZoom.scale, aConstraints.mMaxZoom.scale);
|
||||
mZoomConstraints.mAllowZoom = aConstraints.mAllowZoom;
|
||||
mZoomConstraints.mMinZoom = (MIN_ZOOM > aConstraints.mMinZoom ? MIN_ZOOM : aConstraints.mMinZoom);
|
||||
mZoomConstraints.mMaxZoom = (MAX_ZOOM > aConstraints.mMaxZoom ? aConstraints.mMaxZoom : MAX_ZOOM);
|
||||
|
@ -266,6 +266,20 @@ APZController::PostDelayedTask(Task* aTask, int aDelayMs)
|
||||
MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
|
||||
}
|
||||
|
||||
bool
|
||||
APZController::GetRootZoomConstraints(ZoomConstraints* aOutConstraints)
|
||||
{
|
||||
if (aOutConstraints) {
|
||||
// Until we support the meta-viewport tag properly allow zooming
|
||||
// from 1/4 to 4x by default.
|
||||
aOutConstraints->mAllowZoom = true;
|
||||
aOutConstraints->mMinZoom = CSSToScreenScale(0.25f);
|
||||
aOutConstraints->mMaxZoom = CSSToScreenScale(4.0f);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// apzc notifications
|
||||
|
||||
class TransformedStartEvent : public nsRunnable
|
||||
|
@ -23,6 +23,7 @@ class APZController :
|
||||
{
|
||||
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
||||
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
|
||||
typedef mozilla::layers::ZoomConstraints ZoomConstraints;
|
||||
|
||||
public:
|
||||
APZController() :
|
||||
@ -38,6 +39,7 @@ public:
|
||||
virtual void HandleLongTapUp(const mozilla::CSSIntPoint& aPoint, int32_t aModifiers);
|
||||
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
|
||||
virtual void PostDelayedTask(Task* aTask, int aDelayMs);
|
||||
virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);
|
||||
virtual void NotifyTransformBegin(const ScrollableLayerGuid& aGuid);
|
||||
virtual void NotifyTransformEnd(const ScrollableLayerGuid& aGuid);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user