Bug 1016035 - Set scroll overflow information on potential swipe start events that have been processed by APZ. r=masayuki

--HG--
extra : commitid : 6mBhLX6HDVv
extra : rebase_source : 4185666bd00b2723cb9d7fbdbc3966a6f429b0fc
This commit is contained in:
Markus Stange 2015-08-28 17:26:41 -04:00
Родитель cb47c7a8c0
Коммит 360a9bf3d5
1 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -3132,12 +3132,31 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
case WheelPrefs::ACTION_NONE:
default:
// If we don't handle the wheel event, all of the delta values must
// be overflown delta values.
bool allDeltaOverflown = false;
if (wheelEvent->mFlags.mHandledByAPZ) {
if (wheelEvent->mCanTriggerSwipe) {
// For events that can trigger swipes, APZ needs to know whether
// scrolling is possible in the requested direction. It does this
// by looking at the scroll overflow values on mCanTriggerSwipe
// events after they have been processed.
allDeltaOverflown =
!ComputeScrollTarget(aTargetFrame, wheelEvent,
COMPUTE_DEFAULT_ACTION_TARGET);
}
} else {
// The event was processed neither by APZ nor by us, so all of the
// delta values must be overflown delta values.
allDeltaOverflown = true;
}
if (!allDeltaOverflown) {
break;
}
wheelEvent->overflowDeltaX = wheelEvent->deltaX;
wheelEvent->overflowDeltaY = wheelEvent->deltaY;
WheelPrefs::GetInstance()->
CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
wheelEvent->mViewPortIsOverscrolled = true;
break;
}
*aStatus = nsEventStatus_eConsumeNoDefault;