Bug 1016035 - Set overscroll information on potential swipe start events that have been processed by APZ. r?masayuki
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3065,16 +3065,27 @@ EventStateManager::PostHandleEvent(nsPre
// When APZ is enabled, the actual scroll animation might be handled by
// the compositor.
WheelPrefs::Action action;
if (wheelEvent->mFlags.mHandledByAPZ) {
action = WheelPrefs::ACTION_NONE;
} else {
action = WheelPrefs::GetInstance()->ComputeActionFor(wheelEvent);
}
+
+ if (wheelEvent->mFlags.mHandledByAPZ && wheelEvent->mFlags.mCanTriggerSwipe &&
+ !ComputeScrollTarget(aTargetFrame, wheelEvent, COMPUTE_DEFAULT_ACTION_TARGET)) {
+ // No scrollframe is available for scrolling in the requested direction.
+ wheelEvent->mViewPortIsOverscrolled = true;
+ wheelEvent->overflowDeltaX = wheelEvent->deltaX;
+ wheelEvent->overflowDeltaY = wheelEvent->deltaY;
+ WheelPrefs::GetInstance()->
+ CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
+ }
+
switch (action) {
case WheelPrefs::ACTION_SCROLL: {
// For scrolling of default action, we should honor the mouse wheel
// transaction.
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
if (aEvent->mMessage != NS_WHEEL_WHEEL ||