Bug 944521 - Scroll-grabbing elements shouldn't grab tap gestures. r=Cwiiis

This commit is contained in:
Botond Ballo
2013-11-29 16:40:21 -05:00
parent 084e8a0ca1
commit 073e9f89fc
5 changed files with 129 additions and 71 deletions

View File

@@ -924,15 +924,21 @@ void AsyncPanZoomController::AttemptScroll(const ScreenPoint& aStartPoint,
}
if (fabs(overscroll.x) > EPSILON || fabs(overscroll.y) > EPSILON) {
// Make a local copy of the tree manager pointer and check if it's not
// null before calling HandleOverscroll(). This is necessary because
// Destroy(), which nulls out mTreeManager, could be called concurrently.
APZCTreeManager* treeManagerLocal = mTreeManager;
if (treeManagerLocal) {
// "+ overscroll" rather than "- overscroll" for the same reason as above.
treeManagerLocal->HandleOverscroll(this, aEndPoint + overscroll, aEndPoint,
aOverscrollHandoffChainIndex);
}
// "+ overscroll" rather than "- overscroll" because "overscroll" is what's
// left of "displacement", and "displacement" is "start - end".
CallDispatchScroll(aEndPoint + overscroll, aEndPoint, aOverscrollHandoffChainIndex + 1);
}
}
void AsyncPanZoomController::CallDispatchScroll(const ScreenPoint& aStartPoint, const ScreenPoint& aEndPoint,
uint32_t aOverscrollHandoffChainIndex) {
// Make a local copy of the tree manager pointer and check if it's not
// null before calling HandleOverscroll(). This is necessary because
// Destroy(), which nulls out mTreeManager, could be called concurrently.
APZCTreeManager* treeManagerLocal = mTreeManager;
if (treeManagerLocal) {
treeManagerLocal->DispatchScroll(this, aStartPoint, aEndPoint,
aOverscrollHandoffChainIndex);
}
}
@@ -974,7 +980,7 @@ void AsyncPanZoomController::TrackTouch(const MultiTouchInput& aEvent) {
UpdateWithTouchAtDevicePoint(aEvent);
AttemptScroll(prevTouchPoint, touchPoint);
CallDispatchScroll(prevTouchPoint, touchPoint, 0);
}
ScreenIntPoint& AsyncPanZoomController::GetFirstTouchScreenPoint(const MultiTouchInput& aEvent) {