Bug 1193930 - Allow the user to start a pinch while an overscroll animation is still in progress. r=kats

This commit is contained in:
Botond Ballo 2015-08-14 13:11:32 -04:00
parent f1d325cb3b
commit b2f0d74a1a
4 changed files with 13 additions and 6 deletions

View File

@ -716,11 +716,14 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
uint64_t* aOutInputBlockId)
{
if (aInput.mType == MultiTouchInput::MULTITOUCH_START) {
// If we are in an overscrolled state and a second finger goes down,
// If we are panned into overscroll and a second finger goes down,
// ignore that second touch point completely. The touch-start for it is
// dropped completely; subsequent touch events until the touch-end for it
// will have this touch point filtered out.
if (mApzcForInputBlock && BuildOverscrollHandoffChain(mApzcForInputBlock)->HasOverscrolledApzc()) {
// (By contrast, if we're in overscroll but not panning, such as after
// putting two fingers down during an overscroll animation, we process the
// second touch and proceed to pinch.)
if (mApzcForInputBlock && BuildOverscrollHandoffChain(mApzcForInputBlock)->HasApzcPannedIntoOverscroll()) {
if (mRetainedTouchIdentifier == -1) {
mRetainedTouchIdentifier = mApzcForInputBlock->GetLastTouchIdentifier();
}

View File

@ -1042,6 +1042,10 @@ public:
return mX.IsOverscrolled() || mY.IsOverscrolled();
}
bool IsPannedIntoOverscroll() const {
return IsOverscrolled() && IsInPanningState();
}
private:
/* This is the cumulative CSS transform for all the layers from (and including)
* the parent APZC down to (but excluding) this one. */

View File

@ -162,9 +162,9 @@ OverscrollHandoffChain::CanScrollInDirection(const AsyncPanZoomController* aApzc
}
bool
OverscrollHandoffChain::HasOverscrolledApzc() const
OverscrollHandoffChain::HasApzcPannedIntoOverscroll() const
{
return AnyApzc(&AsyncPanZoomController::IsOverscrolled);
return AnyApzc(&AsyncPanZoomController::IsPannedIntoOverscroll);
}
bool

View File

@ -80,8 +80,8 @@ public:
bool CanScrollInDirection(const AsyncPanZoomController* aApzc,
Layer::ScrollDirection aDirection) const;
// Determine whether any APZC along this handoff chain is overscrolled.
bool HasOverscrolledApzc() const;
// Determine whether any APZC along this handoff chain is panned into overscroll.
bool HasApzcPannedIntoOverscroll() const;
// Determine whether any APZC along this handoff chain has been flung fast.
bool HasFastFlungApzc() const;