Bug 198964 - Enable smooth scrolling by default. r=gavin

This commit is contained in:
Jared Wein 2012-01-13 16:26:34 -08:00
parent 8f44198d78
commit c3725ef355
11 changed files with 42 additions and 23 deletions

View File

@ -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

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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);

View File

@ -9,6 +9,10 @@
<script class="testbody" type="application/javascript">
<![CDATA[
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("general.smoothScroll", false);
function runTest() {
var tests = execTests();
function execNext() {
@ -182,16 +186,14 @@ function execTests() {
is(testPageSelectCommand("cmd_selectPageUp", 0), 22 - lineNum, "cmd_selectPageUp");
}
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var origPrefValue = prefs.getBoolPref("layout.word_select.eat_space_to_next_word");
try {
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", false);
runSelectionTests(body, 1);
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", true);
runSelectionTests(node(2), 0);
} finally {
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", origPrefValue);
prefs.clearUserPref("general.smoothScroll");
prefs.clearUserPref("layout.word_select.eat_space_to_next_word");
}
SimpleTest.finish();

View File

@ -19,6 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549262
/** Test for Bug 549262 **/
var smoothScrollPref = "general.smoothScroll";
SpecialPowers.setBoolPref(smoothScrollPref, false);
SimpleTest.waitForExplicitFinish();
var win = window.open("file_bug549262.html", "_blank",
"width=600,height=600,scrollbars=yes");
@ -90,6 +92,7 @@ SimpleTest.waitForFocus(function() {
is(win.getSelection().focusOffset, ed.textContent.length, "Selection should be moved to the end");
win.close();
SpecialPowers.clearUserPref(smoothScrollPref);
SimpleTest.finish();
}, 0);
}, 0);

View File

@ -34,11 +34,13 @@ addLoadEvent(function() {
is(iframe.contentWindow.scrollY, 0, "Sanity check");
var rect = iframe.getBoundingClientRect();
setTimeout(function() {
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
setTimeout(function() {
var onscroll = function () {
iframe.contentWindow.removeEventListener("scroll", onscroll, false);
isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work");
SimpleTest.finish();
}, 0);
}
iframe.contentWindow.addEventListener("scroll", onscroll, false);
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
}, 0);
});

View File

@ -42,9 +42,12 @@ function runTests() {
function finish() {
// assert that scroll top is now less than before
ok(scrollTopBefore > doc.body.scrollTop, "pressing up arrow should scroll up");
SpecialPowers.clearUserPref(smoothScrollPref);
SimpleTest.finish();
}
var smoothScrollPref = "general.smoothScroll";
SpecialPowers.setBoolPref(smoothScrollPref, false);
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTests);
</script>

View File

@ -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();
});
}

View File

@ -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();
}

View File

@ -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();
}