Backed out changeset e50cbce87f8d (bug 1618539) for nsFocusManager related crashes CLOSED TREE

This commit is contained in:
Bogdan Tara 2020-03-20 11:25:11 +02:00
parent f92d37e44f
commit 69ff22a78e
4 changed files with 14 additions and 9 deletions

View File

@ -76,6 +76,14 @@ async function testURL(url, loadFunc, endFunc) {
null,
"focusedElement not null"
);
if (arg.isRemote) {
Assert.equal(
Services.focus.activeWindow,
content,
"activeWindow not correct"
);
}
}
);

View File

@ -359,8 +359,7 @@ InputContextAction::Cause nsFocusManager::GetFocusMoveActionCause(
NS_IMETHODIMP
nsFocusManager::GetActiveWindow(mozIDOMWindowProxy** aWindow) {
MOZ_ASSERT(XRE_IsParentProcess(),
"Must not be called outside the parent process.");
// TODO mActiveWindow in content process
NS_IF_ADDREF(*aWindow = mActiveWindow);
return NS_OK;
}

View File

@ -7,10 +7,8 @@ var test = function(isContent) {
set: [["security.allow_eval_with_system_principal", true]],
});
if (!isContent) {
let { ww } = SpecialPowers.Services;
window.chromeWindow = ww.activeWindow;
}
let { ww } = SpecialPowers.Services;
window.chromeWindow = ww.activeWindow;
// The pairs of values expected to be the same when
// fingerprinting resistance is enabled.
@ -64,11 +62,11 @@ var test = function(isContent) {
pairs.map(function([item, onVal]) {
if (resisting) {
checkPair("window." + item, onVal);
} else if (!isContent && !item.startsWith("moz")) {
} else if (!item.startsWith("moz")) {
checkPair("window." + item, "chromeWindow." + item);
}
});
if (!isContent && !resisting) {
if (!resisting) {
// Hard to predict these values, but we can enforce constraints:
ok(
window.mozInnerScreenX >= chromeWindow.mozInnerScreenX,

View File

@ -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. Do not use outside the parent process.
* the application is active.
*/
readonly attribute mozIDOMWindowProxy activeWindow;