Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | function test() { |
michael@0 | 2 | waitForExplicitFinish(); |
michael@0 | 3 | |
michael@0 | 4 | var prefs = Components.classes["@mozilla.org/preferences-service;1"] |
michael@0 | 5 | .getService(Components.interfaces.nsIPrefBranch); |
michael@0 | 6 | var gAutofocusPref = prefs.getBoolPref("browser.autofocus"); |
michael@0 | 7 | prefs.setBoolPref("browser.autofocus", false); |
michael@0 | 8 | |
michael@0 | 9 | gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () { |
michael@0 | 10 | gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true); |
michael@0 | 11 | |
michael@0 | 12 | executeSoon(function () { |
michael@0 | 13 | is(gBrowser.selectedTab.linkedBrowser.contentDocument.activeElement, |
michael@0 | 14 | gBrowser.selectedTab.linkedBrowser.contentDocument.body, |
michael@0 | 15 | "foo"); |
michael@0 | 16 | |
michael@0 | 17 | prefs.setBoolPref("browser.autofocus", gAutofocusPref); |
michael@0 | 18 | |
michael@0 | 19 | finish(); |
michael@0 | 20 | }); |
michael@0 | 21 | }, true); |
michael@0 | 22 | |
michael@0 | 23 | gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>"); |
michael@0 | 24 | } |