mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 795567 - Part 5: Add zoom prevention based on the touch-action value. r=kats
This commit is contained in:
parent
d4749b9941
commit
fdd089b63d
@ -758,6 +758,11 @@ nsEventStatus AsyncPanZoomController::OnTouchCancel(const MultiTouchInput& aEven
|
||||
|
||||
nsEventStatus AsyncPanZoomController::OnScaleBegin(const PinchGestureInput& aEvent) {
|
||||
APZC_LOG("%p got a scale-begin in state %d\n", this, mState);
|
||||
|
||||
if (!TouchActionAllowZoom()) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
if (!mZoomConstraints.mAllowZoom) {
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
@ -1726,6 +1731,22 @@ void AsyncPanZoomController::CheckContentResponse() {
|
||||
}
|
||||
}
|
||||
|
||||
bool AsyncPanZoomController::TouchActionAllowZoom() {
|
||||
if (!mTouchActionPropertyEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Pointer events specification implies all touch points to allow zoom
|
||||
// to perform it.
|
||||
for (size_t i = 0; i < mAllowedTouchBehaviors.Length(); i++) {
|
||||
if (!(mAllowedTouchBehaviors[i] & AllowedTouchBehavior::ZOOM)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
AsyncPanZoomController::TouchBehaviorFlags
|
||||
AsyncPanZoomController::GetTouchBehavior(uint32_t touchIndex) {
|
||||
if (touchIndex < mAllowedTouchBehaviors.Length()) {
|
||||
|
@ -538,6 +538,11 @@ private:
|
||||
was not set yet. we still need to abort animations. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns whether current touch behavior values allow zooming.
|
||||
*/
|
||||
bool TouchActionAllowZoom();
|
||||
|
||||
/*
|
||||
* Returns allowed touch behavior from the mAllowedTouchBehavior array.
|
||||
* In case apzc didn't receive touch behavior values within the timeout
|
||||
|
Loading…
Reference in New Issue
Block a user