2010-12-18 05:01:12 +03:00
|
|
|
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);
|
|
|
|
|
2014-12-16 00:05:46 +03:00
|
|
|
gBrowser.selectedBrowser.addEventListener("load", function () {
|
|
|
|
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
2010-12-18 05:01:12 +03:00
|
|
|
|
|
|
|
executeSoon(function () {
|
2014-12-16 00:05:46 +03:00
|
|
|
is(gBrowser.selectedBrowser.contentDocument.activeElement,
|
|
|
|
gBrowser.selectedBrowser.contentDocument.body,
|
2010-12-18 05:01:12 +03:00
|
|
|
"foo");
|
|
|
|
|
|
|
|
prefs.setBoolPref("browser.autofocus", gAutofocusPref);
|
|
|
|
|
|
|
|
finish();
|
|
|
|
});
|
|
|
|
}, true);
|
|
|
|
|
2014-12-16 00:05:46 +03:00
|
|
|
gBrowser.selectedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>");
|
2010-12-18 05:01:12 +03:00
|
|
|
}
|