diff --git a/browser/components/urlbar/tests/browser/browser_locationBarExternalLoad.js b/browser/components/urlbar/tests/browser/browser_locationBarExternalLoad.js index 1b1da7510d7e..3560179be40d 100644 --- a/browser/components/urlbar/tests/browser/browser_locationBarExternalLoad.js +++ b/browser/components/urlbar/tests/browser/browser_locationBarExternalLoad.js @@ -76,14 +76,6 @@ async function testURL(url, loadFunc, endFunc) { null, "focusedElement not null" ); - - if (arg.isRemote) { - Assert.equal( - Services.focus.activeWindow, - content, - "activeWindow not correct" - ); - } } ); diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 544f0dbd86b2..0af84b89b020 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -359,7 +359,8 @@ InputContextAction::Cause nsFocusManager::GetFocusMoveActionCause( NS_IMETHODIMP nsFocusManager::GetActiveWindow(mozIDOMWindowProxy** aWindow) { - // TODO mActiveWindow in content process + MOZ_ASSERT(XRE_IsParentProcess(), + "Must not be called outside the parent process."); NS_IF_ADDREF(*aWindow = mActiveWindow); return NS_OK; } diff --git a/dom/base/test/chrome/bug418986-1.js b/dom/base/test/chrome/bug418986-1.js index 8e8408c9b331..72653a7718c4 100644 --- a/dom/base/test/chrome/bug418986-1.js +++ b/dom/base/test/chrome/bug418986-1.js @@ -7,8 +7,10 @@ var test = function(isContent) { set: [["security.allow_eval_with_system_principal", true]], }); - let { ww } = SpecialPowers.Services; - window.chromeWindow = ww.activeWindow; + if (!isContent) { + let { ww } = SpecialPowers.Services; + window.chromeWindow = ww.activeWindow; + } // The pairs of values expected to be the same when // fingerprinting resistance is enabled. @@ -62,11 +64,11 @@ var test = function(isContent) { pairs.map(function([item, onVal]) { if (resisting) { checkPair("window." + item, onVal); - } else if (!item.startsWith("moz")) { + } else if (!isContent && !item.startsWith("moz")) { checkPair("window." + item, "chromeWindow." + item); } }); - if (!resisting) { + if (!isContent && !resisting) { // Hard to predict these values, but we can enforce constraints: ok( window.mozInnerScreenX >= chromeWindow.mozInnerScreenX, diff --git a/dom/interfaces/base/nsIFocusManager.idl b/dom/interfaces/base/nsIFocusManager.idl index 8036fa4e30d8..9da5076fe588 100644 --- a/dom/interfaces/base/nsIFocusManager.idl +++ b/dom/interfaces/base/nsIFocusManager.idl @@ -46,7 +46,7 @@ interface nsIFocusManager : nsISupports { /** * The most active (frontmost) window, or null if no window that is part of - * the application is active. + * the application is active. Do not use outside the parent process. */ readonly attribute mozIDOMWindowProxy activeWindow;