зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337990 - Support cross-apz axis lock with touch-action enabled, and add a gtest for it. r=kats
MozReview-Commit-ID: AwPgwyYw2fV --HG-- extra : rebase_source : 1b81771499bf74b9feaa5bd530234f643d0267c3
This commit is contained in:
Родитель
86233b8e5e
Коммит
4638f16b5d
|
@ -2210,8 +2210,14 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
|
|||
// Handling of cross sliding will need to be added in this method after touch-action released
|
||||
// enabled by default.
|
||||
MOZ_ASSERT(GetCurrentTouchBlock());
|
||||
RefPtr<const OverscrollHandoffChain> overscrollHandoffChain =
|
||||
GetCurrentInputBlock()->GetOverscrollHandoffChain();
|
||||
bool canScrollHorizontal = !mX.IsAxisLocked() &&
|
||||
overscrollHandoffChain->CanScrollInDirection(this, ScrollDirection::HORIZONTAL);
|
||||
bool canScrollVertical = !mY.IsAxisLocked() &&
|
||||
overscrollHandoffChain->CanScrollInDirection(this, ScrollDirection::VERTICAL);
|
||||
if (GetCurrentTouchBlock()->TouchActionAllowsPanningXY()) {
|
||||
if (mX.CanScrollNow() && mY.CanScrollNow()) {
|
||||
if (canScrollHorizontal && canScrollVertical) {
|
||||
if (IsCloseToHorizontal(aAngle, gfxPrefs::APZAxisLockAngle())) {
|
||||
mY.SetAxisLocked(true);
|
||||
SetState(PANNING_LOCKED_X);
|
||||
|
@ -2221,7 +2227,7 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
|
|||
} else {
|
||||
SetState(PANNING);
|
||||
}
|
||||
} else if (mX.CanScrollNow() || mY.CanScrollNow()) {
|
||||
} else if (canScrollHorizontal || canScrollVertical) {
|
||||
SetState(PANNING);
|
||||
} else {
|
||||
SetState(NOTHING);
|
||||
|
|
|
@ -536,3 +536,8 @@ TEST_F(APZScrollHandoffTester, CrossApzcAxisLock_NoTouchAction) {
|
|||
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
|
||||
TestCrossApzcAxisLock();
|
||||
}
|
||||
|
||||
TEST_F(APZScrollHandoffTester, CrossApzcAxisLock_TouchAction) {
|
||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
||||
TestCrossApzcAxisLock();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче