From c3725ef355d7cbe55be1aa5869340ad7af1985c6 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Fri, 13 Jan 2012 16:26:34 -0800 Subject: [PATCH] Bug 198964 - Enable smooth scrolling by default. r=gavin --- browser/app/profile/firefox.js | 2 +- content/events/test/test_bug350471.xul | 10 ++++------ content/events/test/test_bug574663.html | 13 +++++-------- docshell/test/navigation/test_bug430723.html | 3 +++ .../base/tests/test_selection_move_commands.xul | 10 ++++++---- editor/libeditor/html/tests/test_bug549262.html | 3 +++ editor/libeditor/html/tests/test_bug620906.html | 8 +++++--- layout/generic/test/test_bug633762.html | 3 +++ toolkit/content/tests/chrome/test_mousescroll.xul | 3 +++ widget/tests/window_bug478536.xul | 4 ++++ widget/tests/window_wheeltransaction.xul | 6 +++++- 11 files changed, 42 insertions(+), 23 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index defc47222f74..98e3a5a2d543 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -237,7 +237,7 @@ pref("keyword.URL", ""); pref("general.useragent.locale", "@AB_CD@"); pref("general.skins.selectedSkin", "classic/1.0"); -pref("general.smoothScroll", false); +pref("general.smoothScroll", true); #ifdef UNIX_BUT_NOT_MAC pref("general.autoScroll", false); #else diff --git a/content/events/test/test_bug350471.xul b/content/events/test/test_bug350471.xul index 5b947073d6b1..adfc0039d37f 100644 --- a/content/events/test/test_bug350471.xul +++ b/content/events/test/test_bug350471.xul @@ -22,8 +22,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=350471 /** Test for Bug 350471 **/ -// This test depends on general.smoothScroll being off. - const minLineHeight = 10, maxLineHeight = 20; function between(x, min, max) (min <= max) ? (min <= x && x <= max) : (max <= x && x <= min); @@ -228,6 +226,7 @@ function initPrefs() // Disables the app level scroll acceleration prefSvc.setIntPref("mousewheel.acceleration.start", -1); prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false); + prefSvc.setBoolPref("general.smoothScroll", false); } function clearPrefs() @@ -236,10 +235,9 @@ function clearPrefs() var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); - if (prefSvc.prefHasUserValue("mousewheel.acceleration.start")) - prefSvc.clearUserPref("mousewheel.acceleration.start"); - if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled")) - prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled"); + prefSvc.clearUserPref("mousewheel.acceleration.start"); + prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled"); + prefSvc.clearUserPref("general.smoothScroll"); } window.onload = function () { diff --git a/content/events/test/test_bug574663.html b/content/events/test/test_bug574663.html index f201702abee6..bc918d147dc3 100644 --- a/content/events/test/test_bug574663.html +++ b/content/events/test/test_bug574663.html @@ -20,8 +20,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=574663 /** Test for Bug 574663 **/ -// This test depends on general.smoothScroll being off. - function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum) { var win = scrollbox.ownerDocument.defaultView; let event = { @@ -107,6 +105,7 @@ function initPrefs() netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); + prefSvc.setBoolPref("general.smoothScroll", false); // Disables the app level scroll acceleration prefSvc.setIntPref("mousewheel.acceleration.start", -1); prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false); @@ -120,12 +119,10 @@ function clearPrefs() var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); - if (prefSvc.prefHasUserValue("mousewheel.acceleration.start")) - prefSvc.clearUserPref("mousewheel.acceleration.start"); - if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled")) - prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled"); - if (prefSvc.prefHasUserValue("mousewheel.withcontrolkey.action")) - prefSvc.clearUserPref("mousewheel.withcontrolkey.action"); + prefSvc.clearUserPref("general.smoothScroll"); + prefSvc.clearUserPref("mousewheel.acceleration.start"); + prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled"); + prefSvc.clearUserPref("mousewheel.withcontrolkey.action"); } window.onload = function () { diff --git a/docshell/test/navigation/test_bug430723.html b/docshell/test/navigation/test_bug430723.html index 95d77257e02f..91339926fa54 100644 --- a/docshell/test/navigation/test_bug430723.html +++ b/docshell/test/navigation/test_bug430723.html @@ -43,7 +43,9 @@ window.onload = runTest; var testWindow; var testNum = 0; +var smoothScrollPref = "general.smoothScroll"; function runTest() { + SpecialPowers.setBoolPref(smoothScrollPref, false); testWindow = window.open(gTallRedBoxURI, "testWindow", "width=300,height=300,location=yes,scrollbars=yes"); } @@ -122,6 +124,7 @@ var step3 =function() { "Page2Again: Ensure we can still scroll."); testWindow.close(); + SpecialPowers.clearUserPref(smoothScrollPref); window.SimpleTest.finish(); }, true); sendKey('DOWN', testWindow); diff --git a/editor/libeditor/base/tests/test_selection_move_commands.xul b/editor/libeditor/base/tests/test_selection_move_commands.xul index 9bd60f467b94..c92036de025d 100644 --- a/editor/libeditor/base/tests/test_selection_move_commands.xul +++ b/editor/libeditor/base/tests/test_selection_move_commands.xul @@ -9,6 +9,10 @@ diff --git a/toolkit/content/tests/chrome/test_mousescroll.xul b/toolkit/content/tests/chrome/test_mousescroll.xul index 5b6707e2a66a..1fe83f5af764 100644 --- a/toolkit/content/tests/chrome/test_mousescroll.xul +++ b/toolkit/content/tests/chrome/test_mousescroll.xul @@ -73,6 +73,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=378028 /** Test for Bug 378028 **/ /* and for Bug 350471 **/ +var smoothScrollPref = "general.smoothScroll"; +SpecialPowers.setBoolPref(smoothScrollPref, false); SimpleTest.waitForExplicitFinish(); /* There are three kinds of scroll events: @@ -230,6 +232,7 @@ function runTests() testListbox("listbox"); testArrowScrollbox("hscrollbox"); testArrowScrollbox("vscrollbox"); + SpecialPowers.clearUserPref(smoothScrollPref); SimpleTest.finish(); }); } diff --git a/widget/tests/window_bug478536.xul b/widget/tests/window_bug478536.xul index 5bc0b23d5755..3db7d646f511 100644 --- a/widget/tests/window_bug478536.xul +++ b/widget/tests/window_bug478536.xul @@ -78,9 +78,12 @@ var gIgnoreScrollEvent = true; var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); +const kPrefSmoothScroll = "general.smoothScroll"; const kPrefNameTimeout = "mousewheel.transaction.timeout"; const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout); +gPrefSvc.setBoolPref(kPrefSmoothScroll, false); + var gTimeout = kDefaultTimeout; gBody.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false); @@ -117,6 +120,7 @@ function onunload() { resetTimeoutPrefs(); disableNonTestMouseEvents(false); + gPrefSvc.clearUserPref(kPrefSmoothScroll); window.opener.wrappedJSObject.SimpleTest.finish(); } diff --git a/widget/tests/window_wheeltransaction.xul b/widget/tests/window_wheeltransaction.xul index b0946ccea097..899e6d73533e 100644 --- a/widget/tests/window_wheeltransaction.xul +++ b/widget/tests/window_wheeltransaction.xul @@ -110,11 +110,14 @@ var gTimer; var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); +const kPrefSmoothScroll = "general.smoothScroll"; const kPrefNameTimeout = "mousewheel.transaction.timeout"; const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay"; const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout); -const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay) +const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay); + +gPrefSvc.setBoolPref(kPrefSmoothScroll, false); var gTimeout, gIgnoreMoveDelay; var gEnoughForTimeout, gEnoughForIgnoreMoveDelay; @@ -171,6 +174,7 @@ function onload() function onunload() { resetTimeoutPrefs(); + gPrefSvc.clearUserPref(kPrefSmoothScroll); disableNonTestMouseEvents(false); window.opener.wrappedJSObject.SimpleTest.finish(); }