Bug 1618539 - Remove content-process use of nsIFocusManager::GetActiveWindow. r=NeilDeakin

Differential Revision: https://phabricator.services.mozilla.com/D66416

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henri Sivonen 2020-03-20 08:25:58 +00:00
Родитель 80fb089287
Коммит 287ee18258
4 изменённых файлов: 9 добавлений и 14 удалений

Просмотреть файл

@ -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"
);
}
}
);

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -45,7 +45,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;