Bug 1358017 - Part 4: Implements the auto-dir scrolling feature(without the "honour root" functionality) in APZ r=kats

This commit implements the auto-dir scrolling functionality in APZ, based on
part 1 to part 3. However, the functionality of mousewheel.autodir.honourroot
will be implemented in a future.

MozReview-Commit-ID: 9xai99x71gh
This commit is contained in:
Zhang Junzhi
2018-03-16 19:23:53 +08:00
parent 8d0bc8ab55
commit 4e076672d1
16 changed files with 378 additions and 27 deletions

View File

@@ -14,6 +14,7 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/WheelHandlingHelper.h" // for WheelDeltaAdjustmentStrategy
#include "mozilla/dom/Selection.h"
#include "InputData.h"
@@ -1352,6 +1353,14 @@ struct ParamTraits<mozilla::ScrollWheelInput::ScrollMode>
mozilla::ScrollWheelInput::sHighestScrollMode>
{};
template<>
struct ParamTraits<mozilla::WheelDeltaAdjustmentStrategy> :
public ContiguousEnumSerializer<
mozilla::WheelDeltaAdjustmentStrategy,
mozilla::WheelDeltaAdjustmentStrategy(0),
mozilla::WheelDeltaAdjustmentStrategy::eSentinel>
{};
template<>
struct ParamTraits<mozilla::ScrollWheelInput>
{
@@ -1375,6 +1384,7 @@ struct ParamTraits<mozilla::ScrollWheelInput>
WriteParam(aMsg, aParam.mMayHaveMomentum);
WriteParam(aMsg, aParam.mIsMomentum);
WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
WriteParam(aMsg, aParam.mWheelDeltaAdjustmentStrategy);
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
@@ -1394,7 +1404,9 @@ struct ParamTraits<mozilla::ScrollWheelInput>
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) &&
ReadParam(aMsg, aIter, &aResult->mIsMomentum) &&
ReadParam(aMsg, aIter, &aResult->mAllowToOverrideSystemScrollSpeed);
ReadParam(aMsg, aIter,
&aResult->mAllowToOverrideSystemScrollSpeed) &&
ReadParam(aMsg, aIter, &aResult->mWheelDeltaAdjustmentStrategy);
}
};