Bug 1458063 - Propagate the APZWheelAction to APZCTreeManager. r=kats

MozReview-Commit-ID: Kpr7NGLV7J5

--HG--
extra : rebase_source : 6e42ce08841c44b7c637ddbd878b5372d5d1225b
This commit is contained in:
Botond Ballo 2018-05-02 12:57:23 -04:00
parent 2add094650
commit ad612541e7
4 changed files with 11 additions and 0 deletions

View File

@ -1268,6 +1268,8 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
return result;
}
MOZ_ASSERT(wheelInput.mAPZAction == APZWheelAction::Scroll);
RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(wheelInput.mOrigin,
&hitResult);
if (apzc) {

View File

@ -144,6 +144,7 @@ APZInputBridge::ReceiveInputEvent(
wheelEvent.mDeltaX, wheelEvent.mDeltaY,
wheelEvent.mAllowToOverrideSystemScrollSpeed,
strategy);
input.mAPZAction = action.value();
// We add the user multiplier as a separate field, rather than premultiplying
// it, because if the input is converted back to a WidgetWheelEvent, then

View File

@ -665,6 +665,7 @@ ScrollWheelInput::ScrollWheelInput()
, mUserDeltaMultiplierY(1.0)
, mMayHaveMomentum(false)
, mIsMomentum(false)
, mAPZAction(APZWheelAction::Scroll)
{
}
@ -692,6 +693,7 @@ ScrollWheelInput::ScrollWheelInput(uint32_t aTime, TimeStamp aTimeStamp,
, mIsMomentum(false)
, mAllowToOverrideSystemScrollSpeed(aAllowToOverrideSystemScrollSpeed)
, mWheelDeltaAdjustmentStrategy(aWheelDeltaAdjustmentStrategy)
, mAPZAction(APZWheelAction::Scroll)
{
}
@ -713,6 +715,7 @@ ScrollWheelInput::ScrollWheelInput(const WidgetWheelEvent& aWheelEvent)
, mAllowToOverrideSystemScrollSpeed(
aWheelEvent.mAllowToOverrideSystemScrollSpeed)
, mWheelDeltaAdjustmentStrategy(WheelDeltaAdjustmentStrategy::eNone)
, mAPZAction(APZWheelAction::Scroll)
{
mOrigin =
ScreenPoint(ViewAs<ScreenPixel>(aWheelEvent.mRefPoint,

View File

@ -16,6 +16,7 @@
#include "mozilla/TimeStamp.h"
#include "mozilla/WheelHandlingHelper.h" // for WheelDeltaAdjustmentStrategy
#include "mozilla/gfx/MatrixFwd.h"
#include "mozilla/layers/APZUtils.h"
#include "mozilla/layers/KeyboardScrollAction.h"
template<class E> struct already_AddRefed;
@ -511,6 +512,8 @@ protected:
friend mozilla::layers::APZInputBridgeChild;
friend mozilla::layers::PAPZInputBridgeParent;
typedef mozilla::layers::APZWheelAction APZWheelAction;
ScrollWheelInput();
public:
@ -616,6 +619,8 @@ public:
// Sometimes a wheel event input's wheel delta should be adjusted. This member
// specifies how to adjust the wheel delta.
WheelDeltaAdjustmentStrategy mWheelDeltaAdjustmentStrategy;
APZWheelAction mAPZAction;
};
class KeyboardInput : public InputData