Bug 1217715 - Don't limit the system scroll override to the root content. r=botond,masayuki

MozReview-Commit-ID: EH94OR5rEsX
This commit is contained in:
Kartikaya Gupta 2016-08-19 06:52:25 -04:00
parent 1dd98c7608
commit 14a899b828
4 changed files with 14 additions and 15 deletions

View File

@ -413,12 +413,6 @@ WheelTransaction::OverrideSystemScrollSpeed(WidgetWheelEvent* aEvent)
return DeltaValues(aEvent);
}
// We shouldn't override the scrolling speed on non root scroll frame.
if (sTargetFrame !=
sTargetFrame->PresContext()->PresShell()->GetRootScrollFrame()) {
return DeltaValues(aEvent);
}
return DeltaValues(aEvent->OverriddenDeltaX(),
aEvent->OverriddenDeltaY());
}

View File

@ -16,9 +16,16 @@
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
SpecialPowers.pushPrefEnv({"set": [
["mousewheel.system_scroll_override_on_root_content.enabled", false]
]}, runTest);
var subWin = window.open("window_wheel_default_action.html", "_blank",
"width=500,height=500,scrollbars=yes");
var subWin = null;
function runTest() {
subWin = window.open("window_wheel_default_action.html", "_blank",
"width=500,height=500,scrollbars=yes");
}
function finish()
{

View File

@ -1497,14 +1497,12 @@ AsyncPanZoomController::GetScrollWheelDelta(const ScrollWheelInput& aEvent) cons
{
ParentLayerSize scrollAmount;
ParentLayerSize pageScrollSize;
bool isRootContent = false;
{
// Grab the lock to access the frame metrics.
ReentrantMonitorAutoEnter lock(mMonitor);
LayoutDeviceIntSize scrollAmountLD = mScrollMetadata.GetLineScrollAmount();
LayoutDeviceIntSize pageScrollSizeLD = mScrollMetadata.GetPageScrollAmount();
isRootContent = mFrameMetrics.IsRootContent();
scrollAmount = scrollAmountLD /
mFrameMetrics.GetDevPixelsPerCSSPixel() * mFrameMetrics.GetZoom();
pageScrollSize = pageScrollSizeLD /
@ -1537,9 +1535,9 @@ AsyncPanZoomController::GetScrollWheelDelta(const ScrollWheelInput& aEvent) cons
// For the conditions under which we allow system scroll overrides, see
// EventStateManager::DeltaAccumulator::ComputeScrollAmountForDefaultAction
// and WheelTransaction::OverrideSystemScrollSpeed.
if (isRootContent &&
gfxPrefs::MouseWheelHasRootScrollDeltaOverride() &&
// and WheelTransaction::OverrideSystemScrollSpeed. Note that we do *not*
// restrict this to the root content, see bug 1217715 for discussion on this.
if (gfxPrefs::MouseWheelHasRootScrollDeltaOverride() &&
!aEvent.IsCustomizedByUserPrefs() &&
aEvent.mDeltaType == ScrollWheelInput::SCROLLDELTA_LINE &&
aEvent.mAllowToOverrideSystemScrollSpeed) {

View File

@ -2219,10 +2219,10 @@ pref("mousewheel.acceleration.start", -1);
// factor to be multiplied for constant acceleration
pref("mousewheel.acceleration.factor", 10);
// Prefs for override the system mouse wheel scrolling speed on the root
// Prefs for override the system mouse wheel scrolling speed on
// content of the web pages. When
// "mousewheel.system_scroll_override_on_root_content.enabled" is true and the system
// scrolling speed isn't customized by the user, the root content scrolling
// scrolling speed isn't customized by the user, the content scrolling
// speed is multiplied by the following factors. The value will be used as
// 1/100. E.g., 200 means 2.00.
// NOTE: Even if "mousewheel.system_scroll_override_on_root_content.enabled" is