mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
3990efb3f1
--HG-- extra : rebase_source : d7ef16a16f884458d99dff05efb370694d2ea5e3
25 lines
910 B
JavaScript
25 lines
910 B
JavaScript
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
|
.getService(Components.interfaces.nsIPrefBranch);
|
|
var gAutofocusPref = prefs.getBoolPref("browser.autofocus");
|
|
prefs.setBoolPref("browser.autofocus", false);
|
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function () {
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
|
|
|
executeSoon(function () {
|
|
is(gBrowser.selectedBrowser.contentDocument.activeElement,
|
|
gBrowser.selectedBrowser.contentDocument.body,
|
|
"foo");
|
|
|
|
prefs.setBoolPref("browser.autofocus", gAutofocusPref);
|
|
|
|
finish();
|
|
});
|
|
}, true);
|
|
|
|
gBrowser.selectedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>");
|
|
}
|