Bug 1819109 - Remove snav.enabled. r=masayuki,geckoview-reviewers,emilio,owlish

Although we have removed Spatial navigation by bug 1341737, we still touch
`snav.enabled`. Let's remove it.

Differential Revision: https://phabricator.services.mozilla.com/D172390
This commit is contained in:
Makoto Kato 2023-03-22 02:40:53 +00:00
parent 9f3c39c66f
commit cda1a13b1c
18 changed files with 23 additions and 70 deletions

View file

@ -28,12 +28,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1372369
/** Test for <input type='date'> bad input validity state **/ /** Test for <input type='date'> bad input validity state **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
const DATE_BAD_INPUT_MSG = "Please enter a valid date."; const DATE_BAD_INPUT_MSG = "Please enter a valid date.";

View file

@ -22,12 +22,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1286182
<script type="application/javascript"> <script type="application/javascript">
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
var testData = [ var testData = [

View file

@ -25,12 +25,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=935506
* key events while it is in various states. * key events while it is in various states.
**/ **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
const defaultMinimum = "NaN"; const defaultMinimum = "NaN";
const defaultMaximum = "NaN"; const defaultMaximum = "NaN";

View file

@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=343444
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
/** Test for Bug 343444 **/ /** Test for Bug 343444 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, startTest); startTest();
function startTest() { function startTest() {
document.getElementById("start").focus(); document.getElementById("start").focus();
var count=0; var count=0;

View file

@ -25,12 +25,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=843725
**/ **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
const defaultMinimum = 0; const defaultMinimum = 0;

View file

@ -26,12 +26,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=853525
* ugly rounding errors. * ugly rounding errors.
**/ **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
/** /**

View file

@ -20,12 +20,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1288591
<script type="application/javascript"> <script type="application/javascript">
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks arrow keydown events:
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, function() { test();
test(); SimpleTest.finish();
SimpleTest.finish();
});
}); });
var testData = [ var testData = [

View file

@ -27,7 +27,7 @@ SimpleTest.waitForExplicitFinish();
var r1 = document.getElementById("r1"); var r1 = document.getElementById("r1");
var r2 = document.getElementById("r2"); var r2 = document.getElementById("r2");
var s1 = document.getElementById("s1"); var s1 = document.getElementById("s1");
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, startTest); startTest();
function startTest() { function startTest() {
r1.click(); r1.click();
ok(r1.checked, ok(r1.checked,

View file

@ -22,10 +22,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633058
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation so that the 'keypress' event fires in traditional behavior. SimpleTest.waitForFocus(startTest);
SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[['snav.enabled', false]]}, startTest);
});
function startTest() { function startTest() {
var nbExpectedKeyDown = 8; var nbExpectedKeyDown = 8;
var nbExpectedKeyPress = 1; var nbExpectedKeyPress = 1;

View file

@ -20,11 +20,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=674558
/** Test for Bug 674558 **/ /** Test for Bug 674558 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off spatial navigation because it hijacks VK_RIGHT and VK_LEFT keydown SimpleTest.waitForFocus(startTest);
// events.
SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, startTest);
});
function startTest() { function startTest() {
function textAreaCtor() { function textAreaCtor() {
return document.createElement("textarea"); return document.createElement("textarea");

View file

@ -96,9 +96,7 @@ function startTest() {
if (gTestStarted) if (gTestStarted)
return; return;
gTestStarted = true; gTestStarted = true;
// Turn off spatial navigation because it hijacks KEY_ArrowRight and KEY_ArrowLeft keydown SpecialPowers.pushPrefEnv({"set": [["accessibility.browsewithcaret", true]]}, test0);
// events
SpecialPowers.pushPrefEnv({"set": [["accessibility.browsewithcaret", true], ["snav.enabled", false]]}, test0);
} }
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();

View file

@ -127,10 +127,6 @@ async function doCompositionTest(aSelector) {
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => { SimpleTest.waitForFocus(async () => {
// Turn off spatial navigation because it hijacks arrow key events and
// VK_RETURN events.
await SpecialPowers.pushPrefEnv({"set": [["snav.enabled", false]]});
await doKeyEventTest("textarea"); await doKeyEventTest("textarea");
await doKeyEventTest("div[contenteditable]"); await doKeyEventTest("div[contenteditable]");
await doCompositionTest("textarea"); await doCompositionTest("textarea");

View file

@ -29,8 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=345267
/** Test for Bug 345267 **/ /** Test for Bug 345267 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation to stop if from hijacking "left" keypress event. runTest();
SpecialPowers.pushPrefEnv({"set":[['snav.enabled', false]]}, runTest);
function runTest() { function runTest() {
is($("d1").value, "abcde", is($("d1").value, "abcde",

View file

@ -124,10 +124,7 @@ function runTest() {
} }
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off spatial nav so that it does not hijack the up and down events. SimpleTest.waitForFocus(runTest);
SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, runTest);
});
</script> </script>
</pre> </pre>

View file

@ -74,10 +74,7 @@ function runTest() {
SimpleTest.finish(); SimpleTest.finish();
} }
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// Turn off Spatial Navigation because it hijacks down and up key events. SimpleTest.waitForFocus(runTest);
SimpleTest.waitForFocus(function() {
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, runTest);
})
</script> </script>
</pre> </pre>

View file

@ -19,11 +19,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=291082
event.preventDefault(); event.preventDefault();
} }
function test() {
// Turn off Spatial Navigation because it hijacks arrow keydown events.
SpecialPowers.pushPrefEnv({"set":[["snav.enabled", false]]}, runTest);
}
function runTest() { function runTest() {
document.getElementById("keydown").addEventListener("keydown", preventDefault); document.getElementById("keydown").addEventListener("keydown", preventDefault);
document.getElementById("keypress").addEventListener("keypress", preventDefault); document.getElementById("keypress").addEventListener("keypress", preventDefault);
@ -60,7 +55,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=291082
} }
</script> </script>
</head> </head>
<body onload="test();"> <body onload="runTest();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=291082">Mozilla Bug 291082</a> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=291082">Mozilla Bug 291082</a>
<div> <div>
<ul> <ul>

View file

@ -525,9 +525,6 @@ pref("gfx.canvas.azure.backends", "skia");
// When true, phone number linkification is enabled. // When true, phone number linkification is enabled.
pref("browser.ui.linkify.phone", false); pref("browser.ui.linkify.phone", false);
// Enables/disables Spatial Navigation
pref("snav.enabled", true);
// The mode of home provider syncing. // The mode of home provider syncing.
// 0: Sync always // 0: Sync always
// 1: Sync only when on wifi // 1: Sync only when on wifi

View file

@ -3615,9 +3615,6 @@ pref("browser.safebrowsing.provider.mozilla.lists.content", "moz-full");
// The table and global pref for blocking plugin content // The table and global pref for blocking plugin content
pref("urlclassifier.blockedTable", "moztest-block-simple,mozplugin-block-digest256"); pref("urlclassifier.blockedTable", "moztest-block-simple,mozplugin-block-digest256");
// Turn off Spatial navigation by default.
pref("snav.enabled", false);
// Wakelock is disabled by default. // Wakelock is disabled by default.
pref("dom.wakelock.enabled", false); pref("dom.wakelock.enabled", false);