diff --git a/.flake8 b/.flake8 index 4d7b90c28443..48d31d31dd56 100644 --- a/.flake8 +++ b/.flake8 @@ -4,9 +4,13 @@ ignore = E121, E123, E126, E129, E133, E226, E241, E242, E704, W503, E402, E741 max-line-length = 99 exclude = browser/extensions/mortar/ppapi/, + browser/moz.configure, + build/moz.configure/*.configure, build/pymake/, + js/*.configure, + memory/moz.configure, + mobile/android/*.configure, node_modules, security/nss/, testing/mochitest/pywebsocket, tools/lint/test/files, - diff --git a/browser/base/content/browser-siteIdentity.js b/browser/base/content/browser-siteIdentity.js index ee58a2dc6810..f21fb38f65b3 100644 --- a/browser/base/content/browser-siteIdentity.js +++ b/browser/base/content/browser-siteIdentity.js @@ -45,12 +45,6 @@ var gIdentityHandler = { */ _state: 0, - /** - * This flag gets set if the identity popup was opened by a keypress, - * to be able to focus it on the popupshown event. - */ - _popupTriggeredByKeyboard: false, - /** * RegExp used to decide if an about url should be shown as being part of * the browser UI. @@ -831,7 +825,14 @@ var gIdentityHandler = { return; } - this._popupTriggeredByKeyboard = event.type == "keypress"; + // Move focus to the next available element in the identity popup. + // This is required by role=alertdialog and fixes an issue where + // an already open panel would steal focus from the identity popup. + if (event.type == "keypress") { + let panelView = PanelView.forNode(this._identityPopupMainView); + this._identityPopupMainView.addEventListener("ViewShown", () => panelView.focusFirstNavigableElement(), + {once: true}); + } // Make sure that the display:none style we set in xul is removed now that // the popup is actually needed @@ -853,13 +854,6 @@ var gIdentityHandler = { onPopupShown(event) { if (event.target == this._identityPopup) { - if (this._popupTriggeredByKeyboard) { - // Move focus to the next available element in the identity popup. - // This is required by role=alertdialog and fixes an issue where - // an already open panel would steal focus from the identity popup. - document.commandDispatcher.advanceFocusIntoSubtree(this._identityPopup); - } - window.addEventListener("focus", this, true); } }, diff --git a/browser/base/content/test/performance/browser_startup_content.js b/browser/base/content/test/performance/browser_startup_content.js index 5676af5042c0..2f8755c9a0db 100644 --- a/browser/base/content/test/performance/browser_startup_content.js +++ b/browser/base/content/test/performance/browser_startup_content.js @@ -87,6 +87,19 @@ const whitelist = { ]), }; +// Items on this list are allowed to be loaded but not +// required, as opposed to items in the main whitelist, +// which are all required. +const intermittently_loaded_whitelist = { + components: new Set([ + "nsAsyncShutdown.js", + ]), + modules: new Set([ + "resource://gre/modules/sessionstore/Utils.jsm", + "resource://gre/modules/TelemetryStopwatch.jsm", + ]), +}; + const blacklist = { services: new Set([ "@mozilla.org/base/telemetry-startup;1", @@ -145,6 +158,10 @@ add_task(async function() { return false; }); + loadedList[scriptType] = loadedList[scriptType].filter(c => { + return !intermittently_loaded_whitelist[scriptType].has(c); + }); + is(loadedList[scriptType].length, 0, `should have no unexpected ${scriptType} loaded on content process startup`); diff --git a/browser/base/content/test/performance/browser_startup_flicker.js b/browser/base/content/test/performance/browser_startup_flicker.js index e6530093cda5..609645666170 100644 --- a/browser/base/content/test/performance/browser_startup_flicker.js +++ b/browser/base/content/test/performance/browser_startup_flicker.js @@ -15,6 +15,7 @@ add_task(async function() { // Ensure all the frame data is in the test compartment to avoid traversing // a cross compartment wrapper for each pixel. let frames = Cu.cloneInto(startupRecorder.data.frames, {}); + ok(frames.length > 0, "Should have captured some frames."); let unexpectedRects = 0; let alreadyFocused = false; diff --git a/browser/components/controlcenter/content/panel.inc.xul b/browser/components/controlcenter/content/panel.inc.xul index 6bce41ced4fa..1c7cf27a6528 100644 --- a/browser/components/controlcenter/content/panel.inc.xul +++ b/browser/components/controlcenter/content/panel.inc.xul @@ -47,7 +47,7 @@