author | Zhang Junzhi <zjz@zjz.name> |
Mon, 19 Mar 2018 13:50:49 +0800 | |
changeset 462281 | 38f424da56206f0946ddd01b3c9b1ce5bf195739 |
parent 462280 | c8f111ec6150e7628ca1686cdf1293f8a6c9322e |
child 462299 | 4f1014eb5039bdfdd7a39fb7785d102df1994a6f |
child 462302 | 7b801fbf9bc4f4d6c3c1928d88d58ea4322e27bc |
push id | 9165 |
push user | asasaki@mozilla.com |
push date | Thu, 26 Apr 2018 21:04:54 +0000 |
treeherder | mozilla-beta@064c3804de2e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | masayuki |
bugs | 1446724 |
milestone | 61.0a1 |
first release with | nightly linux32
38f424da5620
/
61.0a1
/
20180319100039
/
files
nightly linux64
38f424da5620
/
61.0a1
/
20180319100039
/
files
nightly mac
38f424da5620
/
61.0a1
/
20180319100039
/
files
nightly win32
38f424da5620
/
61.0a1
/
20180319100039
/
files
nightly win64
38f424da5620
/
61.0a1
/
20180319100039
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
61.0a1
/
20180319100039
/
pushlog to previous
nightly linux64
61.0a1
/
20180319100039
/
pushlog to previous
nightly mac
61.0a1
/
20180319100039
/
pushlog to previous
nightly win32
61.0a1
/
20180319100039
/
pushlog to previous
nightly win64
61.0a1
/
20180319100039
/
pushlog to previous
|
--- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3374,16 +3374,18 @@ EventStateManager::PostHandleEvent(nsPre // because if the scroll target is a plugin, the default action should be // chosen by the plugin rather than by our prefs. nsIFrame* frameToScroll = ComputeScrollTarget(mCurrentTarget, wheelEvent, COMPUTE_DEFAULT_ACTION_TARGET); nsPluginFrame* pluginFrame = do_QueryFrame(frameToScroll); if (pluginFrame) { MOZ_ASSERT(pluginFrame->WantsToHandleWheelEventAsDefaultAction()); + // Plugins should receive original values instead of adjusted values. + adjuster.CancelAdjustment(); action = WheelPrefs::ACTION_SEND_TO_PLUGIN; } switch (action) { case WheelPrefs::ACTION_SCROLL: case WheelPrefs::ACTION_HORIZONTAL_SCROLL: { // For scrolling of default action, we should honor the mouse wheel // transaction.
--- a/dom/events/WheelHandlingHelper.cpp +++ b/dom/events/WheelHandlingHelper.cpp @@ -605,24 +605,30 @@ AutoWheelDeltaAdjuster::AutoWheelDeltaAd mWheelEvent.mOverflowDeltaY = 0.0; mWheelEvent.mLineOrPageDeltaX = mWheelEvent.mLineOrPageDeltaY; mWheelEvent.mLineOrPageDeltaY = 0; mWheelEvent.mDeltaValuesAdjustedForDefaultHandler = true; mTreatedVerticalWheelAsHorizontalScroll = true; } } -AutoWheelDeltaAdjuster::~AutoWheelDeltaAdjuster() +void AutoWheelDeltaAdjuster::CancelAdjustment() { if (mTreatedVerticalWheelAsHorizontalScroll && mWheelEvent.mDeltaValuesAdjustedForDefaultHandler) { mWheelEvent.mDeltaY = mWheelEvent.mDeltaX; mWheelEvent.mDeltaX = mOldDeltaX; mWheelEvent.mDeltaZ = mOldDeltaZ; mWheelEvent.mOverflowDeltaY = mWheelEvent.mOverflowDeltaX; mWheelEvent.mOverflowDeltaX = mOldOverflowDeltaX; mWheelEvent.mLineOrPageDeltaY = mWheelEvent.mLineOrPageDeltaX; mWheelEvent.mLineOrPageDeltaX = mOldLineOrPageDeltaX; mWheelEvent.mDeltaValuesAdjustedForDefaultHandler = false; + mTreatedVerticalWheelAsHorizontalScroll = false; } } +AutoWheelDeltaAdjuster::~AutoWheelDeltaAdjuster() +{ + CancelAdjustment(); +} + } // namespace mozilla
--- a/dom/events/WheelHandlingHelper.h +++ b/dom/events/WheelHandlingHelper.h @@ -224,16 +224,17 @@ public: * modified for default handler. * Its mDeltaValuesAdjustedForDefaultHandler * must not be true because if it's true, * the event has already been adjusted the * delta values for default handler. */ explicit AutoWheelDeltaAdjuster(WidgetWheelEvent& aWheelEvent); ~AutoWheelDeltaAdjuster(); + void CancelAdjustment(); private: WidgetWheelEvent& mWheelEvent; double mOldDeltaX; double mOldDeltaZ; double mOldOverflowDeltaX; int32_t mOldLineOrPageDeltaX; bool mTreatedVerticalWheelAsHorizontalScroll;