mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Don't route wheel events through APZ if they require custom deltas. (bug 1146674, r=kats)
This commit is contained in:
parent
763f6a896e
commit
0edd0b1707
@ -5514,12 +5514,28 @@ EventStateManager::WheelPrefs::NeedToComputeLineOrPageDelta(
|
||||
(mMultiplierY[index] != 1.0 && mMultiplierY[index] != -1.0);
|
||||
}
|
||||
|
||||
bool
|
||||
EventStateManager::WheelPrefs::HasUserPrefsForDelta(WidgetWheelEvent* aEvent)
|
||||
{
|
||||
Index index = GetIndexFor(aEvent);
|
||||
Init(index);
|
||||
|
||||
return mMultiplierX[index] != 1.0 ||
|
||||
mMultiplierY[index] != 1.0;
|
||||
}
|
||||
|
||||
bool
|
||||
EventStateManager::WheelEventIsScrollAction(WidgetWheelEvent* aEvent)
|
||||
{
|
||||
return WheelPrefs::GetInstance()->ComputeActionFor(aEvent) == WheelPrefs::ACTION_SCROLL;
|
||||
}
|
||||
|
||||
bool
|
||||
EventStateManager::WheelEventNeedsDeltaMultipliers(WidgetWheelEvent* aEvent)
|
||||
{
|
||||
return WheelPrefs::GetInstance()->HasUserPrefsForDelta(aEvent);
|
||||
}
|
||||
|
||||
bool
|
||||
EventStateManager::WheelPrefs::IsOverOnePageScrollAllowedX(
|
||||
WidgetWheelEvent* aEvent)
|
||||
|
@ -225,6 +225,10 @@ public:
|
||||
// Returns true if the given WidgetWheelEvent will resolve to a scroll action.
|
||||
static bool WheelEventIsScrollAction(WidgetWheelEvent* aEvent);
|
||||
|
||||
// Returns true if user prefs for wheel deltas apply to the given
|
||||
// WidgetWheelEvent.
|
||||
static bool WheelEventNeedsDeltaMultipliers(WidgetWheelEvent* aEvent);
|
||||
|
||||
// Returns whether or not a frame can be vertically scrolled with a mouse
|
||||
// wheel (as opposed to, say, a selection or touch scroll).
|
||||
static bool CanVerticallyScrollFrameWithWheel(nsIFrame* aFrame);
|
||||
@ -423,6 +427,12 @@ protected:
|
||||
*/
|
||||
void ApplyUserPrefsToDelta(WidgetWheelEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Returns whether or not ApplyUserPrefsToDelta() would change the delta
|
||||
* values of an event.
|
||||
*/
|
||||
bool HasUserPrefsForDelta(WidgetWheelEvent* aEvent);
|
||||
|
||||
/**
|
||||
* If ApplyUserPrefsToDelta() changed the delta values with customized
|
||||
* prefs, the overflowDelta values would be inflated.
|
||||
|
@ -903,7 +903,8 @@ APZCTreeManager::WillHandleWheelEvent(WidgetWheelEvent* aEvent)
|
||||
{
|
||||
return EventStateManager::WheelEventIsScrollAction(aEvent) &&
|
||||
aEvent->deltaMode == nsIDOMWheelEvent::DOM_DELTA_LINE &&
|
||||
!gfxPrefs::MouseWheelHasScrollDeltaOverride();
|
||||
!gfxPrefs::MouseWheelHasScrollDeltaOverride() &&
|
||||
!EventStateManager::WheelEventNeedsDeltaMultipliers(aEvent);
|
||||
}
|
||||
|
||||
nsEventStatus
|
||||
|
Loading…
x
Reference in New Issue
Block a user