зеркало из https://github.com/mozilla/gecko-dev.git
Merge inbound to mozilla-central. a=merge
--HG-- extra : amend_source : 39c72a7f01f9afa5abf7587d732d1e63969cc9da
This commit is contained in:
Коммит
b6a627c094
|
@ -119,7 +119,7 @@ function openBrowserWindowIntl() {
|
|||
}
|
||||
}
|
||||
|
||||
gBrowserContext.browserWnd = window.openDialog(
|
||||
gBrowserContext.browserWnd = window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
"_blank",
|
||||
params,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
this.eventSeq = [ new invokerChecker(EVENT_REORDER, gRootAcc) ];
|
||||
|
||||
this.invoke = () => (gDialog = window.openDialog(aURL));
|
||||
this.invoke = () => (gDialog = docShell.rootTreeItem.domWindow.openDialog(aURL));
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
];
|
||||
|
||||
|
||||
this.invoke = () => gDialog = window.openDialog(aURL);
|
||||
this.invoke = () => gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL);
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
this) ];
|
||||
|
||||
this.invoke = function openWnd_invoke() {
|
||||
this.dialog = window.openDialog("about:mozilla",
|
||||
this.dialog = window.docShell.rootTreeItem.domWindow
|
||||
.openDialog("about:mozilla",
|
||||
"AboutMozilla",
|
||||
"chrome,width=600,height=600");
|
||||
};
|
||||
|
|
|
@ -1,24 +1,14 @@
|
|||
function test() {
|
||||
var contentWin = window.open("about:blank", "", "width=100,height=100");
|
||||
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");
|
||||
add_task(async function test() {
|
||||
window.open("about:blank", "", "width=100,height=100,noopener");
|
||||
|
||||
// clean up
|
||||
if (!win.closed) {
|
||||
win.close();
|
||||
}
|
||||
if (
|
||||
Services.prefs.prefHasUserValue("browser.tabs.closeWindowWithLastTab")
|
||||
) {
|
||||
Services.prefs.clearUserPref("browser.tabs.closeWindowWithLastTab");
|
||||
}
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
|
||||
win.gBrowser.removeCurrentTab();
|
||||
ok(win.closed, "popup is closed");
|
||||
|
||||
return;
|
||||
}
|
||||
// clean up
|
||||
if (!win.closed) {
|
||||
win.close();
|
||||
}
|
||||
|
||||
throw new Error("couldn't find the content window");
|
||||
}
|
||||
Services.prefs.clearUserPref("browser.tabs.closeWindowWithLastTab");
|
||||
});
|
||||
|
|
|
@ -181,6 +181,7 @@ function test_open_from_chrome() {
|
|||
message: {
|
||||
title: "test_open_from_chrome",
|
||||
param: "",
|
||||
option: "noopener",
|
||||
},
|
||||
finalizeFn() {},
|
||||
});
|
||||
|
|
|
@ -180,7 +180,8 @@ add_task(async function sidebar_isOpen() {
|
|||
});
|
||||
|
||||
info("Open a new window");
|
||||
let newWin = open();
|
||||
open("", "", "noopener");
|
||||
let newWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
info("The new window has no sidebar");
|
||||
await sendMessage(extension1, "isOpen", { result: false });
|
||||
|
|
|
@ -100,7 +100,8 @@ SubDialog.prototype = {
|
|||
this._addDialogEventListeners();
|
||||
|
||||
let features =
|
||||
(aFeatures ? aFeatures + "," : "") + "resizable,dialog=no,centerscreen";
|
||||
(aFeatures ? aFeatures + "," : "") +
|
||||
"resizable,dialog=no,centerscreen,chrome=no";
|
||||
let dialog = window.openDialog(
|
||||
aURL,
|
||||
`dialogFrame-${this._id}`,
|
||||
|
|
|
@ -508,7 +508,7 @@ var SiteDataManager = {
|
|||
allowed: false,
|
||||
};
|
||||
let features = "centerscreen,chrome,modal,resizable=no";
|
||||
win.openDialog(
|
||||
win.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://browser/content/preferences/siteDataRemoveSelected.xul",
|
||||
"",
|
||||
features,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
add_task(async function() {
|
||||
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;
|
||||
|
||||
newWindow.focus();
|
||||
|
|
|
@ -112,6 +112,6 @@ async function continue_remove_tab(client, tab) {
|
|||
async function addWindow(url) {
|
||||
info("Adding window: " + url);
|
||||
const onNewWindow = BrowserTestUtils.waitForNewWindow({ url });
|
||||
window.open(url);
|
||||
window.open(url, "_blank", "noopener");
|
||||
return onNewWindow;
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ already_AddRefed<BrowsingContext> BrowsingContext::Create(
|
|||
Type aType) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!aParent || aParent->mType == aType);
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(aType != Type::Chrome || XRE_IsParentProcess());
|
||||
|
||||
uint64_t id = nsContentUtils::GenerateBrowsingContextId();
|
||||
|
||||
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.
|
||||
context->mName = aName;
|
||||
if (aOpener) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aOpener->Group() == context->Group());
|
||||
MOZ_DIAGNOSTIC_ASSERT(aOpener->mType == context->mType);
|
||||
context->mOpenerId = aOpener->Id();
|
||||
context->mHadOriginalOpener = true;
|
||||
}
|
||||
|
@ -1052,7 +1056,7 @@ void BrowsingContext::Transaction::Apply(BrowsingContext* aBrowsingContext) {
|
|||
}
|
||||
|
||||
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;
|
||||
init.mId = Id();
|
||||
|
|
|
@ -213,12 +213,14 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
|||
already_AddRefed<BrowsingContext> GetOpener() const {
|
||||
RefPtr<BrowsingContext> opener(Get(mOpenerId));
|
||||
if (!mIsDiscarded && opener && !opener->mIsDiscarded) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(opener->mType == mType);
|
||||
return opener.forget();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
void SetOpener(BrowsingContext* aOpener) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!aOpener || aOpener->Group() == Group());
|
||||
MOZ_DIAGNOSTIC_ASSERT(!aOpener || aOpener->mType == mType);
|
||||
SetOpenerId(aOpener ? aOpener->Id() : 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ function test() {
|
|||
|
||||
function doTest() {
|
||||
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;
|
||||
if (!uri) {
|
||||
uri = undefined;
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
@ -39,7 +39,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow",
|
||||
"compareSnapshots", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok"];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
const text="MOZILLA";
|
||||
|
@ -38,7 +38,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad(e) {
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
function finish() {
|
||||
for (let eventType of LISTEN_EVENTS) {
|
||||
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
function finish() {
|
||||
for (let eventType of LISTEN_EVENTS) {
|
||||
|
@ -34,7 +34,7 @@
|
|||
}
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
//
|
||||
async function runTests() {
|
||||
// Disable rcwn to make cache behavior deterministic.
|
||||
var {SpecialPowers} = opener;
|
||||
var {SpecialPowers} = window.arguments[0];
|
||||
await SpecialPowers.pushPrefEnv({"set":[["network.http.rcwn.enabled", false]]});
|
||||
|
||||
// Load a test page containing an image referring to the sjs that returns
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
@ -39,7 +39,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<script type="application/javascript" src="docshell_helpers.js" />
|
||||
<script type="application/javascript"><![CDATA[
|
||||
function runTests() {
|
||||
let opener = window.opener;
|
||||
let SimpleTest = opener.wrappedJSObject.SimpleTest;
|
||||
let opener = window.arguments[0];
|
||||
let SimpleTest = opener.SimpleTest;
|
||||
|
||||
function getDocShellType(frame) {
|
||||
return frame.contentWindow.docShell.itemType;
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=112564
|
|||
/** Test for Bug 112564 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug112564_window.xul", "bug112564",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug112564_window.xul", "bug112564",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=113934
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug113934_window.xul?content", "bug113934",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug113934_window.xul?content", "bug113934",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=215405
|
|||
/** Test for Bug 215405 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug215405_window.xul", "bug215405",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug215405_window.xul", "bug215405",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=293235.xul
|
|||
/** Test for Bug 293235 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug293235_window.xul", "bug293235",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug293235_window.xul", "bug293235",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=294258.xul
|
|||
/** Test for Bug 294258 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug294258_window.xul", "bug294258",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug294258_window.xul", "bug294258",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=298622.xul
|
|||
/** Test for Bug 298622 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug298622_window.xul", "bug298622",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug298622_window.xul", "bug298622",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=301397.xul
|
|||
/** Test for Bug 301397 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug301397_window.xul", "bug301397",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug301397_window.xul", "bug301397",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -30,8 +30,8 @@ SimpleTest.expectAssertions(0, 1);
|
|||
/** Test for Bug 303267 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug303267_window.xul", "bug303267",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug303267_window.xul", "bug303267",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -33,8 +33,8 @@ if (navigator.platform.startsWith("Win")) {
|
|||
/** Test for Bug 311007 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug311007_window.xul", "bug311007",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug311007_window.xul", "bug311007",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=321671.xul
|
|||
/** Test for Bug 321671 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug321671_window.xul", "bug321671",
|
||||
"chrome,width=600,height=600,scrollbars");
|
||||
window.openDialog("bug321671_window.xul", "bug321671",
|
||||
"chrome,width=600,height=600,scrollbars,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -30,8 +30,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=360511.xul
|
|||
/** Test for Bug 360511 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug360511_window.xul", "bug360511",
|
||||
"chrome,scrollbars,width=600,height=600");
|
||||
window.openDialog("bug360511_window.xul", "bug360511",
|
||||
"chrome,scrollbars,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -34,8 +34,8 @@ SpecialPowers.pushPrefEnv({
|
|||
}, runTests);
|
||||
|
||||
function runTests() {
|
||||
window.open("bug364461_window.xul", "bug364461",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug364461_window.xul", "bug364461",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396519
|
|||
/** Test for Bug 396519 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug396519_window.xul", "bug396519",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug396519_window.xul", "bug396519",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -32,8 +32,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396649.xul
|
|||
/** Test for Bug 396649 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug396649_window.xul", "bug396649",
|
||||
"chrome,width=600,height=600,scrollbars");
|
||||
window.openDialog("bug396649_window.xul", "bug396649",
|
||||
"chrome,width=600,height=600,scrollbars,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449778
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug449778_window.xul", "bug449778",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug449778_window.xul", "bug449778",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449780
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug449780_window.xul", "bug449780",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug449780_window.xul", "bug449780",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=456980
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug113934_window.xul?chrome", "bug456980",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug113934_window.xul?chrome", "bug456980",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=582176.xul
|
|||
/** Test for Bug 582176 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug582176_window.xul", "bug582176",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug582176_window.xul", "bug582176",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -28,6 +28,8 @@ function nextTest() {
|
|||
gen.next();
|
||||
}
|
||||
|
||||
let chromeWindow = docShell.rootTreeItem.domWindow;
|
||||
|
||||
function* doTest() {
|
||||
var notificationCount = 0;
|
||||
var observer = {
|
||||
|
@ -48,24 +50,26 @@ function* doTest() {
|
|||
is(notificationCount, 0, "initial count");
|
||||
|
||||
// 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";
|
||||
is(notificationCount, 1, "after created window");
|
||||
|
||||
// Try loading in the window
|
||||
testWin.location = "bug608669.xul";
|
||||
window.onmessage = nextTest;
|
||||
chromeWindow.onmessage = nextTest;
|
||||
yield undefined;
|
||||
is(notificationCount, 1, "after first load");
|
||||
is(testWin.x, "y", "reused window");
|
||||
|
||||
// Try loading again in the window
|
||||
testWin.location = "bug608669.xul?x";
|
||||
window.onmessage = nextTest;
|
||||
chromeWindow.onmessage = nextTest;
|
||||
yield undefined;
|
||||
is(notificationCount, 2, "after second load");
|
||||
is("x" in testWin, false, "didn't reuse window");
|
||||
|
||||
chromeWindow.onmessage = null;
|
||||
|
||||
testWin.close();
|
||||
|
||||
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 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug662200_window.xul", "bug662200",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug662200_window.xul", "bug662200",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=690056
|
|||
<![CDATA[
|
||||
/** Test for Bug 690056 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug690056_window.xul", "bug690056",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug690056_window.xul", "bug690056",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=89419.xul
|
|||
/** Test for Bug 89419 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug89419_window.xul", "bug89419",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug89419_window.xul", "bug89419",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=92598
|
|||
/** Test for Bug 92598 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug92598_window.xul", "bug92598",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug92598_window.xul", "bug92598",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -32,8 +32,8 @@ if (navigator.platform.startsWith("Win")) {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function () {
|
||||
window.open("mozFrameType_window.xul", "mozFrameType",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("mozFrameType_window.xul", "mozFrameType",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
});
|
||||
|
||||
]]>
|
||||
|
|
|
@ -61,7 +61,7 @@ var tests = [
|
|||
// force creation of a content viewer.
|
||||
let xulWinURL = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?>' +
|
||||
'<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 () {
|
||||
let frame = newWin.document.createXULElement("iframe");
|
||||
frame.setAttribute("type", "content");
|
||||
|
|
|
@ -18,19 +18,19 @@
|
|||
var savedMM = null;
|
||||
|
||||
function info(message) {
|
||||
return opener.wrappedJSObject.info(message);
|
||||
return window.arguments[0].info(message);
|
||||
}
|
||||
|
||||
function ok(condition, message) {
|
||||
return opener.wrappedJSObject.ok(condition, message);
|
||||
return window.arguments[0].ok(condition, 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) {
|
||||
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.
|
||||
|
@ -411,7 +411,7 @@
|
|||
}
|
||||
failed = true;
|
||||
}
|
||||
opener.wrappedJSObject.SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
window.arguments[0].SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
ok(failed, "CPOW should fail when unsafe");
|
||||
msg.target.messageManager.sendAsyncMessage("cpows:unsafe_done");
|
||||
}
|
||||
|
@ -427,7 +427,7 @@
|
|||
}
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@
|
|||
|
||||
function finish() {
|
||||
ok(gReceivedErrorProbe, "Should have reported error probe");
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
]]></script>
|
||||
|
|
|
@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
|
|||
var ppm = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService();
|
||||
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
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.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();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
function is(actual, expected, msg) {
|
||||
opener.wrappedJSObject.is(actual, expected, msg);
|
||||
window.arguments[0].is(actual, expected, msg);
|
||||
}
|
||||
|
||||
function run() {
|
||||
|
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
is(treeOwner.primaryContentShell, null,
|
||||
"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();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||
var cpm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService();
|
||||
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
function is(actual, expected, msg) {
|
||||
opener.wrappedJSObject.is(actual, expected, msg);
|
||||
window.arguments[0].is(actual, expected, msg);
|
||||
}
|
||||
|
||||
var asyncPPML = false;
|
||||
|
@ -119,7 +119,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||
}
|
||||
|
||||
function finish() {
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
var i = document.getElementById("ifr");
|
||||
i.remove(); // This is a crash test!
|
||||
window.close();
|
||||
|
|
|
@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
function recvCmp(m) {
|
||||
var i = m.json.i, cmp = m.json.cmp;
|
||||
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) {
|
||||
messageManager.removeMessageListener("cmp", recvCmp);
|
||||
|
@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
}
|
||||
|
||||
function finish() {
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
function ok(val, msg) {
|
||||
opener.wrappedJSObject.ok(val, msg);
|
||||
window.arguments[0].ok(val, msg);
|
||||
}
|
||||
|
||||
var elems =
|
||||
|
@ -60,7 +60,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
testElement(elems[i], true, false);
|
||||
}
|
||||
ok(true, "done");
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
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) {
|
||||
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) {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
browser.messageManager.loadFrameScript(FRAME_SCRIPT, true);
|
||||
|
||||
Promise.all([global, window, group]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
self.arguments[0].setTimeout(function() { this.next(); });
|
||||
self.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -55,7 +55,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
globalMM.broadcastAsyncMessage("test", "global");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -50,7 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
messageManager.broadcastAsyncMessage("test");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseTwoMessages(type, mm) {
|
||||
|
@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
messageManager.broadcastAsyncMessage("test");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug1139964.xul", "", "chrome");
|
||||
window.openDialog("file_bug1139964.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
}
|
||||
|
||||
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() {
|
||||
window.open("file_bug549682.xul", "", "chrome");
|
||||
window.openDialog("file_bug549682.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug616841.xul", "", "chrome");
|
||||
window.openDialog("file_bug616841.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -23,8 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=814638
|
|||
|
||||
function startTest() {
|
||||
let hostURL = "chrome://mochitests/content/chrome/dom/base/test/chrome/host_bug814638.xul";
|
||||
let host1 = window.open(hostURL, "_blank", "chrome");
|
||||
let host2 = window.open(hostURL, "_blank", "chrome");
|
||||
let host1 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
|
||||
let host2 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
|
||||
|
||||
let isHost1Loaded = isHost2Loaded = false
|
||||
host1.onload = function() {
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug816340.xul", "", "chrome");
|
||||
window.openDialog("file_bug816340.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
if (tests.length > 0) {
|
||||
var file = tests.shift();
|
||||
info("-- running " + file);
|
||||
window.open(file, "", "chrome");
|
||||
window.openDialog(file, "_blank", "chrome,noopener", window);
|
||||
} else {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ windows.
|
|||
* nonRemote<num>: a reference to the non-remote browser in the window
|
||||
*/
|
||||
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");
|
||||
let remote = win.document.getElementById("remote");
|
||||
let nonRemote = win.document.getElementById("non-remote");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("cpows_parent.xul", "", "chrome");
|
||||
window.openDialog("cpows_parent.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</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.
|
||||
async function testEvents() {
|
||||
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(INNER_URL);
|
||||
win.close();
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<![CDATA[
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("window_nsITextInputProcessor.xul", "_blank",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("window_nsITextInputProcessor.xul", "_blank",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -19,7 +19,7 @@ Test swapFrameLoaders with different frame types and remoteness
|
|||
<script type="application/javascript"><![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.open("window_swapFrameLoaders.xul", "bug1242644",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("window_swapFrameLoaders.xul", "bug1242644",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -22,8 +22,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=481777
|
|||
/** Test for Bug 481777 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("title_window.xul", "bug481777",
|
||||
"chrome,width=100,height=100");
|
||||
window.openDialog("title_window.xul", "bug481777",
|
||||
"chrome,width=100,height=100,noopener", window);
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function testStatics() {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
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);
|
||||
|
||||
|
@ -78,7 +78,7 @@ var iframe = document.getElementById("iframe");
|
|||
var childWindow = iframe.contentWindow;
|
||||
var textareaInFrame;
|
||||
var input = document.getElementById("input");
|
||||
var otherWindow = window.opener;
|
||||
var otherWindow = window.arguments[0];
|
||||
var otherDocument = otherWindow.document;
|
||||
var inputInChildWindow = otherDocument.getElementById("input");
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Test swapFrameLoaders with different frame types and remoteness
|
|||
|
||||
<script type="application/javascript"><![CDATA[
|
||||
["SimpleTest", "SpecialPowers", "info", "is", "ok", "add_task"].forEach(key => {
|
||||
window[key] = window.opener[key];
|
||||
window[key] = window.arguments[0][key];
|
||||
})
|
||||
|
||||
const NS = {
|
||||
|
|
|
@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1016960
|
|||
|
||||
/** Test for Bug 1016960 **/
|
||||
|
||||
var chromeWindow = window.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|.");
|
||||
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 .isChromeWindow.");
|
||||
chromeWindow.close();
|
||||
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
|
||||
// Need to open as a toplevel chrome window so that
|
||||
// DRAWWINDOW_USE_WIDGET_LAYERS is honored.
|
||||
sourceWindow = window.open("file_drawWindow_source.html", "",
|
||||
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
|
||||
sourceWindow = docShell.rootTreeItem.domWindow.open("file_drawWindow_source.html", "",
|
||||
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
|
||||
SimpleTest.waitForFocus(runTests, sourceWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1412775
|
|||
var win;
|
||||
function init() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
win = window.open("window_bug1412775.xul", "_new", "chrome");
|
||||
win = docShell.rootTreeItem.domWindow.open("window_bug1412775.xul", "_new", "chrome");
|
||||
win.onload = function() {
|
||||
var b = win.document.getElementById("browser");
|
||||
var d = b.contentWindow.document;
|
||||
|
|
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
|||
var browser;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
const ok = window.opener.wrappedJSObject.ok;
|
||||
const is = window.opener.wrappedJSObject.is;
|
||||
const done = window.opener.wrappedJSObject.done;
|
||||
const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
const ok = window.arguments[0].ok;
|
||||
const is = window.arguments[0].is;
|
||||
const done = window.arguments[0].done;
|
||||
const SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
// Allow the browser to get connected before using the messageManager to cause
|
||||
// a crash:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
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()
|
||||
{
|
||||
|
|
|
@ -2,23 +2,23 @@ let port;
|
|||
let mm;
|
||||
|
||||
function info(message) {
|
||||
return opener.wrappedJSObject.info(message);
|
||||
return window.arguments[0].info(message);
|
||||
}
|
||||
|
||||
function ok(condition, message) {
|
||||
return opener.wrappedJSObject.ok(condition, message);
|
||||
return window.arguments[0].ok(condition, 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) {
|
||||
return opener.wrappedJSObject.todo_is(v1, v2, message);
|
||||
return window.arguments[0].todo_is(v1, v2, message);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
opener.setTimeout(function() {
|
||||
window.arguments[0].setTimeout(function() {
|
||||
this.done();
|
||||
}, 0);
|
||||
window.close();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("mm_messageChannelParent.xul", "", "chrome");
|
||||
window.openDialog("mm_messageChannelParent.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("mm_messageChannelParentNotRemote.xul", "", "chrome");
|
||||
window.openDialog("mm_messageChannelParentNotRemote.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
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()
|
||||
{
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
<script type="application/javascript" src="plugin-utils.js"/>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
const ok = window.opener.wrappedJSObject.ok;
|
||||
const is = window.opener.wrappedJSObject.is;
|
||||
const done = window.opener.wrappedJSObject.done;
|
||||
const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
const ok = window.arguments[0].ok;
|
||||
const is = window.arguments[0].is;
|
||||
const done = window.arguments[0].done;
|
||||
const SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
const nsIWebProgress = Ci.nsIWebProgress;
|
||||
const nsIWebProgressListener = Ci.nsIWebProgressListener;
|
||||
|
|
|
@ -228,7 +228,7 @@ add_task(async function() {
|
|||
let defaultWindowPromise = BrowserTestUtils.waitForNewWindow({
|
||||
url: TARGET_PAGE,
|
||||
});
|
||||
window.open(TARGET_PAGE, "_blank");
|
||||
window.open(TARGET_PAGE, "_blank", "noopener");
|
||||
let defaultWindow = await defaultWindowPromise;
|
||||
|
||||
// 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
|
||||
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({
|
||||
url: TARGET_PAGE,
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
var SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
document.addEventListener("DOMWindowCreated", function(e) {
|
||||
var otherWindow = e.target.defaultView.wrappedJSObject;
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
function ok(condition, msg) {
|
||||
window.opener.wrappedJSObject.ok(condition, msg);
|
||||
window.arguments[0].ok(condition, msg);
|
||||
}
|
||||
|
||||
function is(a, b, msg) {
|
||||
window.opener.wrappedJSObject.is(a, b, msg);
|
||||
window.arguments[0].is(a, b, msg);
|
||||
}
|
||||
|
||||
var gBrowser = null;
|
||||
|
@ -88,7 +88,7 @@ function earlyExit(event) {
|
|||
function lastExit(event) {
|
||||
is(event.target, gOuterDoc, "MozDOMFullscreen:Exited should be targeted at the last exited doc");
|
||||
ok(gOuterDoc.fullscreenElement == null, "Fullscreen should have been fully exited");
|
||||
window.opener.wrappedJSObject.done();
|
||||
window.arguments[0].done();
|
||||
}
|
||||
|
||||
function start() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
/** Test for Bug 799299 **/
|
||||
var SimpleTest = opener.wrappedJSObject.SimpleTest;
|
||||
var ok = opener.wrappedJSObject.ok;
|
||||
var SimpleTest = window.arguments[0].SimpleTest;
|
||||
var ok = window.arguments[0].ok;
|
||||
|
||||
// Note: We can't use frames[0] here because the type="content" attribute
|
||||
// isolates it into a separate browsing context hierarchy.
|
||||
|
@ -26,7 +26,7 @@
|
|||
"Should be instance of HTMLLabelElement");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
|
||||
function nonModalClosed() {
|
||||
window.close();
|
||||
opener.wrappedJSObject.modalClosed();
|
||||
window.arguments[0].modalClosed();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
|
||||
function nonModalOpened() {
|
||||
window.close();
|
||||
nonModal.wrappedJSObject.modalClosed(opener);
|
||||
nonModal.modalClosed(window.arguments[0]);
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -30,29 +30,29 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=799299
|
|||
var b1 = document.getElementById("b1");
|
||||
var b2 = document.getElementById("b2");
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
|
||||
var didCallDummy = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
|
||||
var didCallListener = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"focus should move to the second iframe");
|
||||
window.arguments[0].ok(didCallListener, "mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"focus should move to the second iframe");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -30,41 +30,41 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
|
|||
var b1 = document.getElementById("b1");
|
||||
var b2 = document.getElementById("b2");
|
||||
|
||||
var testMozBrowser = opener.wrappedJSObject.testMozBrowser;
|
||||
var testMozBrowser = window.arguments[0].testMozBrowser;
|
||||
if (testMozBrowser) {
|
||||
b1.setAttribute("mozbrowser", "true");
|
||||
b2.setAttribute("mozbrowser", "true");
|
||||
}
|
||||
|
||||
if (testMozBrowser)
|
||||
opener.wrappedJSObject.info("Testing with mozbrowser=true");
|
||||
window.arguments[0].info("Testing with mozbrowser=true");
|
||||
else
|
||||
opener.wrappedJSObject.info("Testing without mozbrowser");
|
||||
window.arguments[0].info("Testing without mozbrowser");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
|
||||
var didCallDummy = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
|
||||
var didCallListener = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Did not move focus to the second iframe");
|
||||
window.arguments[0].ok(didCallListener, "mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Did not move focus to the second iframe");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.finishedTests();
|
||||
window.arguments[0].finishedTests();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -34,27 +34,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830858
|
|||
b.addEventListener("foo", function() { ++iframeListenerCalled; }, true);
|
||||
|
||||
doc.dispatchEvent(new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Document");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 1, "Normal dispatch to Document");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(winListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(iframeListenerCalled, 1, "Normal dispatch to Document");
|
||||
|
||||
win.dispatchEvent(new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Window");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Normal dispatch to Window");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 2, "Normal dispatch to Window");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Window");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Normal dispatch to Window");
|
||||
window.arguments[0].is(iframeListenerCalled, 2, "Normal dispatch to Window");
|
||||
|
||||
wu.dispatchEventToChromeOnly(doc, new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Document");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Document");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 3, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(iframeListenerCalled, 3, "Chrome-only dispatch to Document");
|
||||
|
||||
wu.dispatchEventToChromeOnly(win, new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Window");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Window");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 4, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(iframeListenerCalled, 4, "Chrome-only dispatch to Window");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.finishedTests();
|
||||
window.arguments[0].finishedTests();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
window.opener.wrappedJSObject.done(window.fullScreen);
|
||||
window.arguments[0].done(window.fullScreen);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -46,7 +46,7 @@ let tests = [
|
|||
},
|
||||
|
||||
function test8() {
|
||||
window.opener.wrappedJSObject.done();
|
||||
window.arguments[0].done();
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -77,7 +77,7 @@ function checkAndContinue(sizemode) {
|
|||
}, 0);
|
||||
}
|
||||
|
||||
let is = window.opener.wrappedJSObject.is;
|
||||
let is = window.arguments[0].is;
|
||||
|
||||
</script>
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче