Merge inbound to mozilla-central. a=merge

--HG--
extra : amend_source : 39c72a7f01f9afa5abf7587d732d1e63969cc9da
This commit is contained in:
arthur.iakab 2019-09-21 13:00:40 +03:00
Родитель 962c605a9c f5e74811ca
Коммит b6a627c094
439 изменённых файлов: 4381 добавлений и 1360 удалений

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

@ -119,7 +119,7 @@ function openBrowserWindowIntl() {
} }
} }
gBrowserContext.browserWnd = window.openDialog( gBrowserContext.browserWnd = window.docShell.rootTreeItem.domWindow.openDialog(
AppConstants.BROWSER_CHROME_URL, AppConstants.BROWSER_CHROME_URL,
"_blank", "_blank",
params, params,

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

@ -38,7 +38,7 @@
this.eventSeq = [ new invokerChecker(EVENT_REORDER, gRootAcc) ]; this.eventSeq = [ new invokerChecker(EVENT_REORDER, gRootAcc) ];
this.invoke = () => (gDialog = window.openDialog(aURL)); this.invoke = () => (gDialog = docShell.rootTreeItem.domWindow.openDialog(aURL));
this.finalCheck = () => { this.finalCheck = () => {
const accTree = { const accTree = {

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

@ -54,7 +54,7 @@
]; ];
this.invoke = () => gDialog = window.openDialog(aURL); this.invoke = () => gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL);
this.finalCheck = () => { this.finalCheck = () => {
const accTree = { const accTree = {

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

@ -24,7 +24,8 @@
this) ]; this) ];
this.invoke = function openWnd_invoke() { this.invoke = function openWnd_invoke() {
this.dialog = window.openDialog("about:mozilla", this.dialog = window.docShell.rootTreeItem.domWindow
.openDialog("about:mozilla",
"AboutMozilla", "AboutMozilla",
"chrome,width=600,height=600"); "chrome,width=600,height=600");
}; };

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

@ -1,24 +1,14 @@
function test() { add_task(async function test() {
var contentWin = window.open("about:blank", "", "width=100,height=100"); window.open("about:blank", "", "width=100,height=100,noopener");
for (let win of Services.wm.getEnumerator("navigator:browser")) {
if (win.content == contentWin) {
Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
win.gBrowser.removeCurrentTab();
ok(win.closed, "popup is closed");
// clean up let win = Services.wm.getMostRecentWindow("navigator:browser");
if (!win.closed) { Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
win.close(); win.gBrowser.removeCurrentTab();
} ok(win.closed, "popup is closed");
if (
Services.prefs.prefHasUserValue("browser.tabs.closeWindowWithLastTab")
) {
Services.prefs.clearUserPref("browser.tabs.closeWindowWithLastTab");
}
return; // clean up
} if (!win.closed) {
win.close();
} }
Services.prefs.clearUserPref("browser.tabs.closeWindowWithLastTab");
throw new Error("couldn't find the content window"); });
}

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

@ -181,6 +181,7 @@ function test_open_from_chrome() {
message: { message: {
title: "test_open_from_chrome", title: "test_open_from_chrome",
param: "", param: "",
option: "noopener",
}, },
finalizeFn() {}, finalizeFn() {},
}); });

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

@ -180,7 +180,8 @@ add_task(async function sidebar_isOpen() {
}); });
info("Open a new window"); info("Open a new window");
let newWin = open(); open("", "", "noopener");
let newWin = Services.wm.getMostRecentWindow("navigator:browser");
info("The new window has no sidebar"); info("The new window has no sidebar");
await sendMessage(extension1, "isOpen", { result: false }); await sendMessage(extension1, "isOpen", { result: false });

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

@ -100,7 +100,8 @@ SubDialog.prototype = {
this._addDialogEventListeners(); this._addDialogEventListeners();
let features = let features =
(aFeatures ? aFeatures + "," : "") + "resizable,dialog=no,centerscreen"; (aFeatures ? aFeatures + "," : "") +
"resizable,dialog=no,centerscreen,chrome=no";
let dialog = window.openDialog( let dialog = window.openDialog(
aURL, aURL,
`dialogFrame-${this._id}`, `dialogFrame-${this._id}`,

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

@ -508,7 +508,7 @@ var SiteDataManager = {
allowed: false, allowed: false,
}; };
let features = "centerscreen,chrome,modal,resizable=no"; let features = "centerscreen,chrome,modal,resizable=no";
win.openDialog( win.docShell.rootTreeItem.domWindow.openDialog(
"chrome://browser/content/preferences/siteDataRemoveSelected.xul", "chrome://browser/content/preferences/siteDataRemoveSelected.xul",
"", "",
features, features,

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

@ -5,7 +5,7 @@
add_task(async function() { add_task(async function() {
const newWindowPromise = BrowserTestUtils.waitForNewWindow(); const newWindowPromise = BrowserTestUtils.waitForNewWindow();
window.open("data:text/html;charset=utf-8,", "_blank"); window.open("data:text/html;charset=utf-8,", "_blank", "noopener,all");
const newWindow = await newWindowPromise; const newWindow = await newWindowPromise;
newWindow.focus(); newWindow.focus();

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

@ -112,6 +112,6 @@ async function continue_remove_tab(client, tab) {
async function addWindow(url) { async function addWindow(url) {
info("Adding window: " + url); info("Adding window: " + url);
const onNewWindow = BrowserTestUtils.waitForNewWindow({ url }); const onNewWindow = BrowserTestUtils.waitForNewWindow({ url });
window.open(url); window.open(url, "_blank", "noopener");
return onNewWindow; return onNewWindow;
} }

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

@ -102,6 +102,8 @@ already_AddRefed<BrowsingContext> BrowsingContext::Create(
Type aType) { Type aType) {
MOZ_DIAGNOSTIC_ASSERT(!aParent || aParent->mType == aType); MOZ_DIAGNOSTIC_ASSERT(!aParent || aParent->mType == aType);
MOZ_DIAGNOSTIC_ASSERT(aType != Type::Chrome || XRE_IsParentProcess());
uint64_t id = nsContentUtils::GenerateBrowsingContextId(); uint64_t id = nsContentUtils::GenerateBrowsingContextId();
MOZ_LOG(GetLog(), LogLevel::Debug, MOZ_LOG(GetLog(), LogLevel::Debug,
@ -124,6 +126,8 @@ already_AddRefed<BrowsingContext> BrowsingContext::Create(
// using transactions to set them, as we haven't been attached yet. // using transactions to set them, as we haven't been attached yet.
context->mName = aName; context->mName = aName;
if (aOpener) { if (aOpener) {
MOZ_DIAGNOSTIC_ASSERT(aOpener->Group() == context->Group());
MOZ_DIAGNOSTIC_ASSERT(aOpener->mType == context->mType);
context->mOpenerId = aOpener->Id(); context->mOpenerId = aOpener->Id();
context->mHadOriginalOpener = true; context->mHadOriginalOpener = true;
} }
@ -1052,7 +1056,7 @@ void BrowsingContext::Transaction::Apply(BrowsingContext* aBrowsingContext) {
} }
BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() { BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
// FIXME: We should assert that we're loaded in-content here. (bug 1553804) MOZ_DIAGNOSTIC_ASSERT(mType == Type::Content);
IPCInitializer init; IPCInitializer init;
init.mId = Id(); init.mId = Id();

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

@ -213,12 +213,14 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
already_AddRefed<BrowsingContext> GetOpener() const { already_AddRefed<BrowsingContext> GetOpener() const {
RefPtr<BrowsingContext> opener(Get(mOpenerId)); RefPtr<BrowsingContext> opener(Get(mOpenerId));
if (!mIsDiscarded && opener && !opener->mIsDiscarded) { if (!mIsDiscarded && opener && !opener->mIsDiscarded) {
MOZ_DIAGNOSTIC_ASSERT(opener->mType == mType);
return opener.forget(); return opener.forget();
} }
return nullptr; return nullptr;
} }
void SetOpener(BrowsingContext* aOpener) { void SetOpener(BrowsingContext* aOpener) {
MOZ_DIAGNOSTIC_ASSERT(!aOpener || aOpener->Group() == Group()); MOZ_DIAGNOSTIC_ASSERT(!aOpener || aOpener->Group() == Group());
MOZ_DIAGNOSTIC_ASSERT(!aOpener || aOpener->mType == mType);
SetOpenerId(aOpener ? aOpener->Id() : 0); SetOpenerId(aOpener ? aOpener->Id() : 0);
} }

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

@ -38,7 +38,8 @@ function test() {
function doTest() { function doTest() {
uri = uris[iteration - 1]; uri = uris[iteration - 1];
w = window.open(uri, "_blank", "width=10,height=10"); window.open(uri, "_blank", "width=10,height=10,noopener");
w = Services.wm.getMostRecentWindow("navigator:browser").content;
var prin = w.document.nodePrincipal; var prin = w.document.nodePrincipal;
if (!uri) { if (!uri) {
uri = undefined; uri = undefined;

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

@ -22,11 +22,11 @@
var gExpected = []; var gExpected = [];
function ok(condition, message) { function ok(condition, message) {
window.opener.wrappedJSObject.SimpleTest.ok(condition, message); window.arguments[0].SimpleTest.ok(condition, message);
} }
function is(a, b, message) { function is(a, b, message) {
window.opener.wrappedJSObject.SimpleTest.is(a, b, message); window.arguments[0].SimpleTest.is(a, b, message);
} }
function finish() { function finish() {
@ -39,7 +39,7 @@
history.legacySHistory.PurgeHistory(history.count); history.legacySHistory.PurgeHistory(history.count);
window.close(); window.close();
window.opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
function onLoad() { function onLoad() {

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

@ -16,7 +16,7 @@
var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow", var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow",
"compareSnapshots", "onerror" ]; "compareSnapshots", "onerror" ];
for (var name of imports) { for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.arguments[0][name];
} }
function $(id) { function $(id) {

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

@ -17,7 +17,7 @@
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm"); const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
var imports = [ "SimpleTest", "is", "isnot", "ok"]; var imports = [ "SimpleTest", "is", "isnot", "ok"];
for (var name of imports) { for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.arguments[0][name];
} }
const text="MOZILLA"; const text="MOZILLA";
@ -38,7 +38,7 @@
history.legacySHistory.PurgeHistory(history.count); history.legacySHistory.PurgeHistory(history.count);
window.close(); window.close();
window.opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
function onLoad(e) { function onLoad(e) {

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

@ -22,10 +22,10 @@
var gExpected = []; var gExpected = [];
function ok(condition, message) { function ok(condition, message) {
window.opener.wrappedJSObject.SimpleTest.ok(condition, message); window.arguments[0].SimpleTest.ok(condition, message);
} }
function is(a, b, message) { function is(a, b, message) {
window.opener.wrappedJSObject.SimpleTest.is(a, b, message); window.arguments[0].SimpleTest.is(a, b, message);
} }
function finish() { function finish() {
for (let eventType of LISTEN_EVENTS) { for (let eventType of LISTEN_EVENTS) {
@ -33,7 +33,7 @@
} }
window.close(); window.close();
window.opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
function onLoad() { function onLoad() {

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

@ -23,10 +23,10 @@
var gExpected = []; var gExpected = [];
function ok(condition, message) { function ok(condition, message) {
window.opener.wrappedJSObject.SimpleTest.ok(condition, message); window.arguments[0].SimpleTest.ok(condition, message);
} }
function is(a, b, message) { function is(a, b, message) {
window.opener.wrappedJSObject.SimpleTest.is(a, b, message); window.arguments[0].SimpleTest.is(a, b, message);
} }
function finish() { function finish() {
for (let eventType of LISTEN_EVENTS) { for (let eventType of LISTEN_EVENTS) {
@ -34,7 +34,7 @@
} }
window.close(); window.close();
window.opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
function onLoad() { function onLoad() {

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

@ -10,7 +10,7 @@
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ]; var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
for (var name of imports) { for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.arguments[0][name];
} }
function $(id) { function $(id) {

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

@ -10,7 +10,7 @@
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ]; var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
for (var name of imports) { for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.arguments[0][name];
} }
function $(id) { function $(id) {

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

@ -20,7 +20,7 @@
// //
async function runTests() { async function runTests() {
// Disable rcwn to make cache behavior deterministic. // Disable rcwn to make cache behavior deterministic.
var {SpecialPowers} = opener; var {SpecialPowers} = window.arguments[0];
await SpecialPowers.pushPrefEnv({"set":[["network.http.rcwn.enabled", false]]}); await SpecialPowers.pushPrefEnv({"set":[["network.http.rcwn.enabled", false]]});
// Load a test page containing an image referring to the sjs that returns // Load a test page containing an image referring to the sjs that returns

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

@ -22,11 +22,11 @@
var gExpected = []; var gExpected = [];
function ok(condition, message) { function ok(condition, message) {
window.opener.wrappedJSObject.SimpleTest.ok(condition, message); window.arguments[0].SimpleTest.ok(condition, message);
} }
function is(a, b, message) { function is(a, b, message) {
window.opener.wrappedJSObject.SimpleTest.is(a, b, message); window.arguments[0].SimpleTest.is(a, b, message);
} }
function finish() { function finish() {
@ -39,7 +39,7 @@
history.legacySHistory.PurgeHistory(history.count); history.legacySHistory.PurgeHistory(history.count);
window.close(); window.close();
window.opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
function onLoad() { function onLoad() {

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

@ -1,3 +1,6 @@
if (!window.opener && window.arguments) {
window.opener = window.arguments[0];
}
/** /**
* Import common SimpleTest methods so that they're usable in this window. * Import common SimpleTest methods so that they're usable in this window.
*/ */

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

@ -12,8 +12,8 @@
<script type="application/javascript" src="docshell_helpers.js" /> <script type="application/javascript" src="docshell_helpers.js" />
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
function runTests() { function runTests() {
let opener = window.opener; let opener = window.arguments[0];
let SimpleTest = opener.wrappedJSObject.SimpleTest; let SimpleTest = opener.SimpleTest;
function getDocShellType(frame) { function getDocShellType(frame) {
return frame.contentWindow.docShell.itemType; return frame.contentWindow.docShell.itemType;

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

@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=112564
/** Test for Bug 112564 **/ /** Test for Bug 112564 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug112564_window.xul", "bug112564", window.openDialog("bug112564_window.xul", "bug112564",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=113934
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addLoadEvent(function() { addLoadEvent(function() {
window.open("bug113934_window.xul?content", "bug113934", window.openDialog("bug113934_window.xul?content", "bug113934",
"chrome,width=800,height=800"); "chrome,width=800,height=800,noopener", window);
}); });
]]></script> ]]></script>

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

@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=215405
/** Test for Bug 215405 **/ /** Test for Bug 215405 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug215405_window.xul", "bug215405", window.openDialog("bug215405_window.xul", "bug215405",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=293235.xul
/** Test for Bug 293235 **/ /** Test for Bug 293235 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug293235_window.xul", "bug293235", window.openDialog("bug293235_window.xul", "bug293235",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=294258.xul
/** Test for Bug 294258 **/ /** Test for Bug 294258 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug294258_window.xul", "bug294258", window.openDialog("bug294258_window.xul", "bug294258",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=298622.xul
/** Test for Bug 298622 **/ /** Test for Bug 298622 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug298622_window.xul", "bug298622", window.openDialog("bug298622_window.xul", "bug298622",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=301397.xul
/** Test for Bug 301397 **/ /** Test for Bug 301397 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug301397_window.xul", "bug301397", window.openDialog("bug301397_window.xul", "bug301397",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -30,8 +30,8 @@ SimpleTest.expectAssertions(0, 1);
/** Test for Bug 303267 **/ /** Test for Bug 303267 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug303267_window.xul", "bug303267", window.openDialog("bug303267_window.xul", "bug303267",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -33,8 +33,8 @@ if (navigator.platform.startsWith("Win")) {
/** Test for Bug 311007 **/ /** Test for Bug 311007 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug311007_window.xul", "bug311007", window.openDialog("bug311007_window.xul", "bug311007",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=321671.xul
/** Test for Bug 321671 **/ /** Test for Bug 321671 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug321671_window.xul", "bug321671", window.openDialog("bug321671_window.xul", "bug321671",
"chrome,width=600,height=600,scrollbars"); "chrome,width=600,height=600,scrollbars,noopener", window);
]]> ]]>
</script> </script>

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

@ -30,8 +30,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=360511.xul
/** Test for Bug 360511 **/ /** Test for Bug 360511 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug360511_window.xul", "bug360511", window.openDialog("bug360511_window.xul", "bug360511",
"chrome,scrollbars,width=600,height=600"); "chrome,scrollbars,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -34,8 +34,8 @@ SpecialPowers.pushPrefEnv({
}, runTests); }, runTests);
function runTests() { function runTests() {
window.open("bug364461_window.xul", "bug364461", window.openDialog("bug364461_window.xul", "bug364461",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
} }
]]> ]]>
</script> </script>

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

@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396519
/** Test for Bug 396519 **/ /** Test for Bug 396519 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug396519_window.xul", "bug396519", window.openDialog("bug396519_window.xul", "bug396519",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]></script> ]]></script>
</window> </window>

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

@ -32,8 +32,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396649.xul
/** Test for Bug 396649 **/ /** Test for Bug 396649 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug396649_window.xul", "bug396649", window.openDialog("bug396649_window.xul", "bug396649",
"chrome,width=600,height=600,scrollbars"); "chrome,width=600,height=600,scrollbars,noopener", window);
]]> ]]>
</script> </script>

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

@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449778
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addLoadEvent(function() { addLoadEvent(function() {
window.open("bug449778_window.xul", "bug449778", window.openDialog("bug449778_window.xul", "bug449778",
"chrome,width=800,height=800"); "chrome,width=800,height=800,noopener", window);
}); });
]]></script> ]]></script>

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

@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449780
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addLoadEvent(function() { addLoadEvent(function() {
window.open("bug449780_window.xul", "bug449780", window.openDialog("bug449780_window.xul", "bug449780",
"chrome,width=800,height=800"); "chrome,width=800,height=800,noopener", window);
}); });
]]></script> ]]></script>

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

@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=456980
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addLoadEvent(function() { addLoadEvent(function() {
window.open("bug113934_window.xul?chrome", "bug456980", window.openDialog("bug113934_window.xul?chrome", "bug456980",
"chrome,width=800,height=800"); "chrome,width=800,height=800,noopener", window);
}); });
]]></script> ]]></script>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=582176.xul
/** Test for Bug 582176 **/ /** Test for Bug 582176 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug582176_window.xul", "bug582176", window.openDialog("bug582176_window.xul", "bug582176",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -28,6 +28,8 @@ function nextTest() {
gen.next(); gen.next();
} }
let chromeWindow = docShell.rootTreeItem.domWindow;
function* doTest() { function* doTest() {
var notificationCount = 0; var notificationCount = 0;
var observer = { var observer = {
@ -48,24 +50,26 @@ function* doTest() {
is(notificationCount, 0, "initial count"); is(notificationCount, 0, "initial count");
// create a new window // create a new window
var testWin = window.open("", "bug 608669", "chrome,width=600,height=600"); var testWin = chromeWindow.open("", "bug 608669", "chrome,width=600,height=600");
testWin.x = "y"; testWin.x = "y";
is(notificationCount, 1, "after created window"); is(notificationCount, 1, "after created window");
// Try loading in the window // Try loading in the window
testWin.location = "bug608669.xul"; testWin.location = "bug608669.xul";
window.onmessage = nextTest; chromeWindow.onmessage = nextTest;
yield undefined; yield undefined;
is(notificationCount, 1, "after first load"); is(notificationCount, 1, "after first load");
is(testWin.x, "y", "reused window"); is(testWin.x, "y", "reused window");
// Try loading again in the window // Try loading again in the window
testWin.location = "bug608669.xul?x"; testWin.location = "bug608669.xul?x";
window.onmessage = nextTest; chromeWindow.onmessage = nextTest;
yield undefined; yield undefined;
is(notificationCount, 2, "after second load"); is(notificationCount, 2, "after second load");
is("x" in testWin, false, "didn't reuse window"); is("x" in testWin, false, "didn't reuse window");
chromeWindow.onmessage = null;
testWin.close(); testWin.close();
os.removeObserver(observer, "chrome-document-global-created"); os.removeObserver(observer, "chrome-document-global-created");

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662200.xul
/** Test for Bug 662200 **/ /** Test for Bug 662200 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug662200_window.xul", "bug662200", window.openDialog("bug662200_window.xul", "bug662200",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=690056
<![CDATA[ <![CDATA[
/** Test for Bug 690056 **/ /** Test for Bug 690056 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug690056_window.xul", "bug690056", window.openDialog("bug690056_window.xul", "bug690056",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>
</window> </window>

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=89419.xul
/** Test for Bug 89419 **/ /** Test for Bug 89419 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug89419_window.xul", "bug89419", window.openDialog("bug89419_window.xul", "bug89419",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=92598
/** Test for Bug 92598 **/ /** Test for Bug 92598 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("bug92598_window.xul", "bug92598", window.openDialog("bug92598_window.xul", "bug92598",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -32,8 +32,8 @@ if (navigator.platform.startsWith("Win")) {
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addLoadEvent(function () { addLoadEvent(function () {
window.open("mozFrameType_window.xul", "mozFrameType", window.openDialog("mozFrameType_window.xul", "mozFrameType",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
}); });
]]> ]]>

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

@ -61,7 +61,7 @@ var tests = [
// force creation of a content viewer. // force creation of a content viewer.
let xulWinURL = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?>' + let xulWinURL = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?>' +
'<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>'; '<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>';
let newWin = window.openDialog(xulWinURL, "chrome_window", "chrome"); let newWin = docShell.rootTreeItem.domWindow.openDialog(xulWinURL, "chrome_window", "chrome");
loadListener(newWin, function () { loadListener(newWin, function () {
let frame = newWin.document.createXULElement("iframe"); let frame = newWin.document.createXULElement("iframe");
frame.setAttribute("type", "content"); frame.setAttribute("type", "content");

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

@ -18,19 +18,19 @@
var savedMM = null; var savedMM = null;
function info(message) { function info(message) {
return opener.wrappedJSObject.info(message); return window.arguments[0].info(message);
} }
function ok(condition, message) { function ok(condition, message) {
return opener.wrappedJSObject.ok(condition, message); return window.arguments[0].ok(condition, message);
} }
function is(v1, v2, message) { function is(v1, v2, message) {
return opener.wrappedJSObject.is(v1, v2, message); return window.arguments[0].is(v1, v2, message);
} }
function todo_is(v1, v2, message) { function todo_is(v1, v2, message) {
return opener.wrappedJSObject.todo_is(v1, v2, message); return window.arguments[0].todo_is(v1, v2, message);
} }
// Make sure that an error in this file actually causes the test to fail. // Make sure that an error in this file actually causes the test to fail.
@ -411,7 +411,7 @@
} }
failed = true; failed = true;
} }
opener.wrappedJSObject.SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN); window.arguments[0].SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
ok(failed, "CPOW should fail when unsafe"); ok(failed, "CPOW should fail when unsafe");
msg.target.messageManager.sendAsyncMessage("cpows:unsafe_done"); msg.target.messageManager.sendAsyncMessage("cpows:unsafe_done");
} }
@ -427,7 +427,7 @@
} }
ok(false, "cpow failed"); ok(false, "cpow failed");
} }
opener.wrappedJSObject.SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN); window.arguments[0].SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
msg.target.messageManager.sendAsyncMessage("cpows:safe_done"); msg.target.messageManager.sendAsyncMessage("cpows:safe_done");
} }
@ -512,7 +512,7 @@
function finish() { function finish() {
ok(gReceivedErrorProbe, "Should have reported error probe"); ok(gReceivedErrorProbe, "Should have reported error probe");
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
window.close(); window.close();
} }
]]></script> ]]></script>

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

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
var ppm = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(); var ppm = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService();
function ok(cond, msg) { function ok(cond, msg) {
opener.wrappedJSObject.ok(cond, msg); window.arguments[0].ok(cond, msg);
} }
var msgName = "TEST:Global_has_Promise"; var msgName = "TEST:Global_has_Promise";
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
ok(m.data.hasTextEncoder, "BrowserChildGlobal should have TextEncoder object in the global scope!"); ok(m.data.hasTextEncoder, "BrowserChildGlobal should have TextEncoder object in the global scope!");
ok(m.data.hasWindow, "BrowserChildGlobal should have Window object in the global scope!"); ok(m.data.hasWindow, "BrowserChildGlobal should have Window object in the global scope!");
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
window.close(); window.close();
} }

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

@ -12,11 +12,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
<!-- test code goes here --> <!-- test code goes here -->
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
function ok(cond, msg) { function ok(cond, msg) {
opener.wrappedJSObject.ok(cond, msg); window.arguments[0].ok(cond, msg);
} }
function is(actual, expected, msg) { function is(actual, expected, msg) {
opener.wrappedJSObject.is(actual, expected, msg); window.arguments[0].is(actual, expected, msg);
} }
function run() { function run() {
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
is(treeOwner.primaryContentShell, null, is(treeOwner.primaryContentShell, null,
"There shouldn't be primaryContentShell because no browser has primary=true."); "There shouldn't be primaryContentShell because no browser has primary=true.");
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
window.close(); window.close();
} }

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

@ -19,11 +19,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var cpm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService(); var cpm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService();
function ok(cond, msg) { function ok(cond, msg) {
opener.wrappedJSObject.ok(cond, msg); window.arguments[0].ok(cond, msg);
} }
function is(actual, expected, msg) { function is(actual, expected, msg) {
opener.wrappedJSObject.is(actual, expected, msg); window.arguments[0].is(actual, expected, msg);
} }
var asyncPPML = false; var asyncPPML = false;
@ -119,7 +119,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
} }
function finish() { function finish() {
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
var i = document.getElementById("ifr"); var i = document.getElementById("ifr");
i.remove(); // This is a crash test! i.remove(); // This is a crash test!
window.close(); window.close();

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

@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
function recvCmp(m) { function recvCmp(m) {
var i = m.json.i, cmp = m.json.cmp; var i = m.json.i, cmp = m.json.cmp;
var pair = toCompare[i]; var pair = toCompare[i];
opener.wrappedJSObject.is(pair[0].localeCompare(pair[1]), cmp, "localeCompare returned same result in frame script"); window.arguments[0].is(pair[0].localeCompare(pair[1]), cmp, "localeCompare returned same result in frame script");
if (toCompare.length == ++nCmps) { if (toCompare.length == ++nCmps) {
messageManager.removeMessageListener("cmp", recvCmp); messageManager.removeMessageListener("cmp", recvCmp);
@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
} }
function finish() { function finish() {
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
window.close(); window.close();
} }

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
function ok(val, msg) { function ok(val, msg) {
opener.wrappedJSObject.ok(val, msg); window.arguments[0].ok(val, msg);
} }
var elems = var elems =
@ -60,7 +60,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
testElement(elems[i], true, false); testElement(elems[i], true, false);
} }
ok(true, "done"); ok(true, "done");
opener.setTimeout(function() { this.done(); }, 0); window.arguments[0].setTimeout(function() { this.done(); }, 0);
window.close(); window.close();
} }

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

@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
function is(val, exp, msg) { function is(val, exp, msg) {
opener.wrappedJSObject.is(val, exp, msg); window.arguments[0].is(val, exp, msg);
} }
/** /**
@ -37,10 +37,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
messageManager.addMessageListener("test", function onMessage(msg) { messageManager.addMessageListener("test", function onMessage(msg) {
var next = order.shift(); var next = order.shift();
opener.wrappedJSObject.is(msg.data, next, "received test:" + next); window.arguments[0].is(msg.data, next, "received test:" + next);
if (order.length == 0) { if (order.length == 0) {
opener.setTimeout(function() { this.next(); }); window.arguments[0].setTimeout(function() { this.next(); });
window.close(); window.close();
} }
}); });

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
function is(val, exp, msg) { function is(val, exp, msg) {
opener.wrappedJSObject.is(val, exp, msg); window.arguments[0].is(val, exp, msg);
} }
function promiseMessage(type, mm) { function promiseMessage(type, mm) {
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
browser.messageManager.loadFrameScript(FRAME_SCRIPT, true); browser.messageManager.loadFrameScript(FRAME_SCRIPT, true);
Promise.all([global, window, group]).then(function () { Promise.all([global, window, group]).then(function () {
opener.setTimeout(function() { this.next(); }); self.arguments[0].setTimeout(function() { this.next(); });
self.close(); self.close();
}); });
} }

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
function is(val, exp, msg) { function is(val, exp, msg) {
opener.wrappedJSObject.is(val, exp, msg); window.arguments[0].is(val, exp, msg);
} }
function promiseMessage(type, mm) { function promiseMessage(type, mm) {
@ -55,7 +55,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
globalMM.broadcastAsyncMessage("test", "global"); globalMM.broadcastAsyncMessage("test", "global");
Promise.all([promise1, promise2]).then(function () { Promise.all([promise1, promise2]).then(function () {
opener.setTimeout(function() { this.next(); }); window.arguments[0].setTimeout(function() { this.next(); });
window.close(); window.close();
}); });
} }

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

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
function is(val, exp, msg) { function is(val, exp, msg) {
opener.wrappedJSObject.is(val, exp, msg); window.arguments[0].is(val, exp, msg);
} }
function promiseMessage(type, mm) { function promiseMessage(type, mm) {
@ -50,7 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
messageManager.broadcastAsyncMessage("test"); messageManager.broadcastAsyncMessage("test");
Promise.all([promise1, promise2]).then(function () { Promise.all([promise1, promise2]).then(function () {
opener.setTimeout(function() { this.next(); }); window.arguments[0].setTimeout(function() { this.next(); });
window.close(); window.close();
}); });
} }

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

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
function is(val, exp, msg) { function is(val, exp, msg) {
opener.wrappedJSObject.is(val, exp, msg); window.arguments[0].is(val, exp, msg);
} }
function promiseTwoMessages(type, mm) { function promiseTwoMessages(type, mm) {
@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
messageManager.broadcastAsyncMessage("test"); messageManager.broadcastAsyncMessage("test");
Promise.all([promise1, promise2]).then(function () { Promise.all([promise1, promise2]).then(function () {
opener.setTimeout(function() { this.next(); }); window.arguments[0].setTimeout(function() { this.next(); });
window.close(); window.close();
}); });
} }

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

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("file_bug1139964.xul", "", "chrome"); window.openDialog("file_bug1139964.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("file_bug1209621.xul", "", "chrome"); window.openDialog("file_bug1209621.xul", "", "chrome,noopener", window);
}); });
]]> ]]>

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

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("file_bug549682.xul", "", "chrome"); window.openDialog("file_bug549682.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("file_bug616841.xul", "", "chrome"); window.openDialog("file_bug616841.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -23,8 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=814638
function startTest() { function startTest() {
let hostURL = "chrome://mochitests/content/chrome/dom/base/test/chrome/host_bug814638.xul"; let hostURL = "chrome://mochitests/content/chrome/dom/base/test/chrome/host_bug814638.xul";
let host1 = window.open(hostURL, "_blank", "chrome"); let host1 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
let host2 = window.open(hostURL, "_blank", "chrome"); let host2 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
let isHost1Loaded = isHost2Loaded = false let isHost1Loaded = isHost2Loaded = false
host1.onload = function() { host1.onload = function() {

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

@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("file_bug816340.xul", "", "chrome"); window.openDialog("file_bug816340.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
if (tests.length > 0) { if (tests.length > 0) {
var file = tests.shift(); var file = tests.shift();
info("-- running " + file); info("-- running " + file);
window.open(file, "", "chrome"); window.openDialog(file, "_blank", "chrome,noopener", window);
} else { } else {
SimpleTest.finish(); SimpleTest.finish();
} }

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

@ -72,7 +72,7 @@ windows.
* nonRemote<num>: a reference to the non-remote browser in the window * nonRemote<num>: a reference to the non-remote browser in the window
*/ */
async function prepareWindow(num, page) { async function prepareWindow(num, page) {
let win = window.open(BROWSER_DOC, "bug1474662-" + num, "chrome,width=200,height=200"); let win = docShell.rootTreeItem.domWindow.open(BROWSER_DOC, "bug1474662-" + num, "chrome,width=200,height=200");
await BrowserTestUtils.waitForEvent(win, "load"); await BrowserTestUtils.waitForEvent(win, "load");
let remote = win.document.getElementById("remote"); let remote = win.document.getElementById("remote");
let nonRemote = win.document.getElementById("non-remote"); let nonRemote = win.document.getElementById("non-remote");

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

@ -28,7 +28,7 @@
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("cpows_parent.xul", "", "chrome"); window.openDialog("cpows_parent.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1411707
// expect both events to fire with the docs in the correct state. // expect both events to fire with the docs in the correct state.
async function testEvents() { async function testEvents() {
info(`Waiting for events after loading ${OUTER_URL}`); info(`Waiting for events after loading ${OUTER_URL}`);
let win = window.openDialog(OUTER_URL, null, "chrome,dialog=no,all"); let win = docShell.rootTreeItem.domWindow.openDialog(OUTER_URL, "_blank", "chrome,dialog=no,all");
await waitForEvent(OUTER_URL); await waitForEvent(OUTER_URL);
await waitForEvent(INNER_URL); await waitForEvent(INNER_URL);
win.close(); win.close();

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

@ -21,8 +21,8 @@
<![CDATA[ <![CDATA[
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("window_nsITextInputProcessor.xul", "_blank", window.openDialog("window_nsITextInputProcessor.xul", "_blank",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]> ]]>
</script> </script>

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

@ -19,7 +19,7 @@ Test swapFrameLoaders with different frame types and remoteness
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("window_swapFrameLoaders.xul", "bug1242644", window.openDialog("window_swapFrameLoaders.xul", "bug1242644",
"chrome,width=600,height=600"); "chrome,width=600,height=600,noopener", window);
]]></script> ]]></script>
</window> </window>

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

@ -22,8 +22,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=481777
/** Test for Bug 481777 **/ /** Test for Bug 481777 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.open("title_window.xul", "bug481777", window.openDialog("title_window.xul", "bug481777",
"chrome,width=100,height=100"); "chrome,width=100,height=100,noopener", window);
]]> ]]>
</script> </script>
</window> </window>

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

@ -22,7 +22,7 @@
<![CDATA[ <![CDATA[
var imports = [ "SimpleTest", "is", "isnot", "ok" ]; var imports = [ "SimpleTest", "is", "isnot", "ok" ];
for (var name of imports) { for (var name of imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.arguments[0][name];
} }
function testStatics() { function testStatics() {

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

@ -25,7 +25,7 @@
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
var SimpleTest = window.opener.wrappedJSObject.SimpleTest; var SimpleTest = window.arguments[0].SimpleTest;
SimpleTest.waitForFocus(runTests, window); SimpleTest.waitForFocus(runTests, window);
@ -78,7 +78,7 @@ var iframe = document.getElementById("iframe");
var childWindow = iframe.contentWindow; var childWindow = iframe.contentWindow;
var textareaInFrame; var textareaInFrame;
var input = document.getElementById("input"); var input = document.getElementById("input");
var otherWindow = window.opener; var otherWindow = window.arguments[0];
var otherDocument = otherWindow.document; var otherDocument = otherWindow.document;
var inputInChildWindow = otherDocument.getElementById("input"); var inputInChildWindow = otherDocument.getElementById("input");

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

@ -10,7 +10,7 @@ Test swapFrameLoaders with different frame types and remoteness
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
["SimpleTest", "SpecialPowers", "info", "is", "ok", "add_task"].forEach(key => { ["SimpleTest", "SpecialPowers", "info", "is", "ok", "add_task"].forEach(key => {
window[key] = window.opener[key]; window[key] = window.arguments[0][key];
}) })
const NS = { const NS = {

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

@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1016960
/** Test for Bug 1016960 **/ /** Test for Bug 1016960 **/
var chromeWindow = window.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome"); var chromeWindow = docShell.rootTreeItem.domWindow.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
ok(chromeWindow.isChromeWindow, "A chrome window should return true for |instanceof ChromeWindow|."); ok(chromeWindow.isChromeWindow, "A chrome window should return true for .isChromeWindow.");
chromeWindow.close(); chromeWindow.close();
</script> </script>

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

@ -29,8 +29,8 @@
// Need to open as a toplevel chrome window so that // Need to open as a toplevel chrome window so that
// DRAWWINDOW_USE_WIDGET_LAYERS is honored. // DRAWWINDOW_USE_WIDGET_LAYERS is honored.
sourceWindow = window.open("file_drawWindow_source.html", "", sourceWindow = docShell.rootTreeItem.domWindow.open("file_drawWindow_source.html", "",
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`); `chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
SimpleTest.waitForFocus(runTests, sourceWindow); SimpleTest.waitForFocus(runTests, sourceWindow);
} }

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1412775
var win; var win;
function init() { function init() {
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
win = window.open("window_bug1412775.xul", "_new", "chrome"); win = docShell.rootTreeItem.domWindow.open("window_bug1412775.xul", "_new", "chrome");
win.onload = function() { win.onload = function() {
var b = win.document.getElementById("browser"); var b = win.document.getElementById("browser");
var d = b.contentWindow.document; var d = b.contentWindow.document;

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

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
var browser; var browser;
function start() { function start() {
_window = window.open("window_bug617528.xul", "_new", "chrome"); _window = docShell.rootTreeItem.domWindow.open("window_bug617528.xul", "_new", "chrome");
_window.addEventListener("load", onLoad, false); _window.addEventListener("load", onLoad, false);
} }

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

@ -9,10 +9,10 @@
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm"); const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
const ok = window.opener.wrappedJSObject.ok; const ok = window.arguments[0].ok;
const is = window.opener.wrappedJSObject.is; const is = window.arguments[0].is;
const done = window.opener.wrappedJSObject.done; const done = window.arguments[0].done;
const SimpleTest = window.opener.wrappedJSObject.SimpleTest; const SimpleTest = window.arguments[0].SimpleTest;
// Allow the browser to get connected before using the messageManager to cause // Allow the browser to get connected before using the messageManager to cause
// a crash: // a crash:

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

@ -9,7 +9,7 @@
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.expectChildProcessCrash(); SimpleTest.expectChildProcessCrash();
var w = window.open('process_error.xul', '_blank', 'chrome,resizable=yes,width=400,height=600'); var w = docShell.rootTreeItem.domWindow.openDialog('process_error.xul', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
function done() function done()
{ {

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

@ -2,23 +2,23 @@ let port;
let mm; let mm;
function info(message) { function info(message) {
return opener.wrappedJSObject.info(message); return window.arguments[0].info(message);
} }
function ok(condition, message) { function ok(condition, message) {
return opener.wrappedJSObject.ok(condition, message); return window.arguments[0].ok(condition, message);
} }
function is(v1, v2, message) { function is(v1, v2, message) {
return opener.wrappedJSObject.is(v1, v2, message); return window.arguments[0].is(v1, v2, message);
} }
function todo_is(v1, v2, message) { function todo_is(v1, v2, message) {
return opener.wrappedJSObject.todo_is(v1, v2, message); return window.arguments[0].todo_is(v1, v2, message);
} }
function cleanUp() { function cleanUp() {
opener.setTimeout(function() { window.arguments[0].setTimeout(function() {
this.done(); this.done();
}, 0); }, 0);
window.close(); window.close();

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

@ -21,7 +21,7 @@
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("mm_messageChannelParent.xul", "", "chrome"); window.openDialog("mm_messageChannelParent.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -21,7 +21,7 @@
} }
addLoadEvent(function() { addLoadEvent(function() {
window.open("mm_messageChannelParentNotRemote.xul", "", "chrome"); window.openDialog("mm_messageChannelParentNotRemote.xul", "", "chrome,noopener", window);
}); });
]]></script> ]]></script>
</window> </window>

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

@ -10,7 +10,7 @@
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var w = window.open('xulbrowser_plugin_visibility.xul', '_blank', 'chrome,resizable=yes,width=400,height=600'); var w = docShell.rootTreeItem.domWindow.openDialog('xulbrowser_plugin_visibility.xul', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
function done() function done()
{ {

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

@ -17,10 +17,10 @@
<script type="application/javascript" src="plugin-utils.js"/> <script type="application/javascript" src="plugin-utils.js"/>
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm"); const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
const ok = window.opener.wrappedJSObject.ok; const ok = window.arguments[0].ok;
const is = window.opener.wrappedJSObject.is; const is = window.arguments[0].is;
const done = window.opener.wrappedJSObject.done; const done = window.arguments[0].done;
const SimpleTest = window.opener.wrappedJSObject.SimpleTest; const SimpleTest = window.arguments[0].SimpleTest;
const nsIWebProgress = Ci.nsIWebProgress; const nsIWebProgress = Ci.nsIWebProgress;
const nsIWebProgressListener = Ci.nsIWebProgressListener; const nsIWebProgressListener = Ci.nsIWebProgressListener;

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

@ -228,7 +228,7 @@ add_task(async function() {
let defaultWindowPromise = BrowserTestUtils.waitForNewWindow({ let defaultWindowPromise = BrowserTestUtils.waitForNewWindow({
url: TARGET_PAGE, url: TARGET_PAGE,
}); });
window.open(TARGET_PAGE, "_blank"); window.open(TARGET_PAGE, "_blank", "noopener");
let defaultWindow = await defaultWindowPromise; let defaultWindow = await defaultWindowPromise;
// Check that all toolbars are visible // Check that all toolbars are visible
@ -237,7 +237,7 @@ add_task(async function() {
// Now lets open a window with toolbars hidden from this chrome context // Now lets open a window with toolbars hidden from this chrome context
let features = let features =
"location=no, personalbar=no, toolbar=no, scrollbars=no, menubar=no, status=no"; "location=no, personalbar=no, toolbar=no, scrollbars=no, menubar=no, status=no, noopener";
let popupWindowPromise = BrowserTestUtils.waitForNewWindow({ let popupWindowPromise = BrowserTestUtils.waitForNewWindow({
url: TARGET_PAGE, url: TARGET_PAGE,
}); });

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

@ -12,7 +12,7 @@
src="chrome://mochikit/content/chrome-harness.js"></script> src="chrome://mochikit/content/chrome-harness.js"></script>
<script type="application/javascript"> <script type="application/javascript">
var SimpleTest = window.opener.wrappedJSObject.SimpleTest; var SimpleTest = window.arguments[0].SimpleTest;
document.addEventListener("DOMWindowCreated", function(e) { document.addEventListener("DOMWindowCreated", function(e) {
var otherWindow = e.target.defaultView.wrappedJSObject; var otherWindow = e.target.defaultView.wrappedJSObject;

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

@ -26,11 +26,11 @@
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[
function ok(condition, msg) { function ok(condition, msg) {
window.opener.wrappedJSObject.ok(condition, msg); window.arguments[0].ok(condition, msg);
} }
function is(a, b, msg) { function is(a, b, msg) {
window.opener.wrappedJSObject.is(a, b, msg); window.arguments[0].is(a, b, msg);
} }
var gBrowser = null; var gBrowser = null;
@ -88,7 +88,7 @@ function earlyExit(event) {
function lastExit(event) { function lastExit(event) {
is(event.target, gOuterDoc, "MozDOMFullscreen:Exited should be targeted at the last exited doc"); is(event.target, gOuterDoc, "MozDOMFullscreen:Exited should be targeted at the last exited doc");
ok(gOuterDoc.fullscreenElement == null, "Fullscreen should have been fully exited"); ok(gOuterDoc.fullscreenElement == null, "Fullscreen should have been fully exited");
window.opener.wrappedJSObject.done(); window.arguments[0].done();
} }
function start() { function start() {

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

@ -8,8 +8,8 @@
<script type="application/javascript"> <script type="application/javascript">
<![CDATA[ <![CDATA[
/** Test for Bug 799299 **/ /** Test for Bug 799299 **/
var SimpleTest = opener.wrappedJSObject.SimpleTest; var SimpleTest = window.arguments[0].SimpleTest;
var ok = opener.wrappedJSObject.ok; var ok = window.arguments[0].ok;
// Note: We can't use frames[0] here because the type="content" attribute // Note: We can't use frames[0] here because the type="content" attribute
// isolates it into a separate browsing context hierarchy. // isolates it into a separate browsing context hierarchy.
@ -26,7 +26,7 @@
"Should be instance of HTMLLabelElement"); "Should be instance of HTMLLabelElement");
window.close(); window.close();
opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
]]> ]]>
</script> </script>
</window> </window>

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

@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
function nonModalClosed() { function nonModalClosed() {
window.close(); window.close();
opener.wrappedJSObject.modalClosed(); window.arguments[0].modalClosed();
} }
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

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

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
function nonModalOpened() { function nonModalOpened() {
window.close(); window.close();
nonModal.wrappedJSObject.modalClosed(opener); nonModal.modalClosed(window.arguments[0]);
} }
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

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

@ -30,29 +30,29 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=799299
var b1 = document.getElementById("b1"); var b1 = document.getElementById("b1");
var b2 = document.getElementById("b2"); var b2 = document.getElementById("b2");
b1.contentWindow.focus(); b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1, window.arguments[0].is(document.activeElement, b1,
"Focused first iframe"); "Focused first iframe");
var didCallDummy = false; var didCallDummy = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; }); b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
sendClick(b2.contentWindow); sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire"); window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
opener.wrappedJSObject.is(document.activeElement, b2, window.arguments[0].is(document.activeElement, b2,
"Focus shifted to second iframe"); "Focus shifted to second iframe");
b1.contentWindow.focus(); b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1, window.arguments[0].is(document.activeElement, b1,
"Re-focused first iframe for the first time"); "Re-focused first iframe for the first time");
var didCallListener = false; var didCallListener = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); }); b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
sendClick(b2.contentWindow); sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire"); window.arguments[0].ok(didCallListener, "mousedown handler should fire");
opener.wrappedJSObject.is(document.activeElement, b2, window.arguments[0].is(document.activeElement, b2,
"focus should move to the second iframe"); "focus should move to the second iframe");
window.close(); window.close();
opener.wrappedJSObject.SimpleTest.finish(); window.arguments[0].SimpleTest.finish();
} }
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

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

@ -30,41 +30,41 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
var b1 = document.getElementById("b1"); var b1 = document.getElementById("b1");
var b2 = document.getElementById("b2"); var b2 = document.getElementById("b2");
var testMozBrowser = opener.wrappedJSObject.testMozBrowser; var testMozBrowser = window.arguments[0].testMozBrowser;
if (testMozBrowser) { if (testMozBrowser) {
b1.setAttribute("mozbrowser", "true"); b1.setAttribute("mozbrowser", "true");
b2.setAttribute("mozbrowser", "true"); b2.setAttribute("mozbrowser", "true");
} }
if (testMozBrowser) if (testMozBrowser)
opener.wrappedJSObject.info("Testing with mozbrowser=true"); window.arguments[0].info("Testing with mozbrowser=true");
else else
opener.wrappedJSObject.info("Testing without mozbrowser"); window.arguments[0].info("Testing without mozbrowser");
b1.contentWindow.focus(); b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1, window.arguments[0].is(document.activeElement, b1,
"Focused first iframe"); "Focused first iframe");
var didCallDummy = false; var didCallDummy = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; }); b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
sendClick(b2.contentWindow); sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire"); window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
opener.wrappedJSObject.is(document.activeElement, b2, window.arguments[0].is(document.activeElement, b2,
"Focus shifted to second iframe"); "Focus shifted to second iframe");
b1.contentWindow.focus(); b1.contentWindow.focus();
opener.wrappedJSObject.is(document.activeElement, b1, window.arguments[0].is(document.activeElement, b1,
"Re-focused first iframe for the first time"); "Re-focused first iframe for the first time");
var didCallListener = false; var didCallListener = false;
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); }); b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
sendClick(b2.contentWindow); sendClick(b2.contentWindow);
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire"); window.arguments[0].ok(didCallListener, "mousedown handler should fire");
opener.wrappedJSObject.is(document.activeElement, b1, window.arguments[0].is(document.activeElement, b1,
"Did not move focus to the second iframe"); "Did not move focus to the second iframe");
window.close(); window.close();
opener.wrappedJSObject.finishedTests(); window.arguments[0].finishedTests();
} }
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

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

@ -34,27 +34,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830858
b.addEventListener("foo", function() { ++iframeListenerCalled; }, true); b.addEventListener("foo", function() { ++iframeListenerCalled; }, true);
doc.dispatchEvent(new Event("foo")); doc.dispatchEvent(new Event("foo"));
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Document"); window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Document");
opener.wrappedJSObject.is(winListenerCalled, 1, "Normal dispatch to Document"); window.arguments[0].is(winListenerCalled, 1, "Normal dispatch to Document");
opener.wrappedJSObject.is(iframeListenerCalled, 1, "Normal dispatch to Document"); window.arguments[0].is(iframeListenerCalled, 1, "Normal dispatch to Document");
win.dispatchEvent(new Event("foo")); win.dispatchEvent(new Event("foo"));
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Window"); window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Window");
opener.wrappedJSObject.is(winListenerCalled, 2, "Normal dispatch to Window"); window.arguments[0].is(winListenerCalled, 2, "Normal dispatch to Window");
opener.wrappedJSObject.is(iframeListenerCalled, 2, "Normal dispatch to Window"); window.arguments[0].is(iframeListenerCalled, 2, "Normal dispatch to Window");
wu.dispatchEventToChromeOnly(doc, new Event("foo")); wu.dispatchEventToChromeOnly(doc, new Event("foo"));
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Document"); window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Document");
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Document"); window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Document");
opener.wrappedJSObject.is(iframeListenerCalled, 3, "Chrome-only dispatch to Document"); window.arguments[0].is(iframeListenerCalled, 3, "Chrome-only dispatch to Document");
wu.dispatchEventToChromeOnly(win, new Event("foo")); wu.dispatchEventToChromeOnly(win, new Event("foo"));
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Window"); window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Window");
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Window"); window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Window");
opener.wrappedJSObject.is(iframeListenerCalled, 4, "Chrome-only dispatch to Window"); window.arguments[0].is(iframeListenerCalled, 4, "Chrome-only dispatch to Window");
window.close(); window.close();
opener.wrappedJSObject.finishedTests(); window.arguments[0].finishedTests();
} }
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

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

@ -1 +1 @@
<body onload='window.opener.doChecks(this)'><input id='i' value='Sample Text'></body> <body onload='window.arguments[0].doChecks(this)'><input id='i' value='Sample Text'></body>

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

@ -13,7 +13,7 @@ window.addEventListener("fullscreen", onFullScreen, true);
function onFullScreen(event) function onFullScreen(event)
{ {
window.opener.wrappedJSObject.done(window.fullScreen); window.arguments[0].done(window.fullScreen);
} }
</script> </script>

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

@ -46,7 +46,7 @@ let tests = [
}, },
function test8() { function test8() {
window.opener.wrappedJSObject.done(); window.arguments[0].done();
} }
]; ];
@ -77,7 +77,7 @@ function checkAndContinue(sizemode) {
}, 0); }, 0);
} }
let is = window.opener.wrappedJSObject.is; let is = window.arguments[0].is;
</script> </script>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше