Bug 1638153: Part 2 - Fix uses of .rootTreeItem to get top browser window. r=geckoview-reviewers,nika,snorp

Differential Revision: https://phabricator.services.mozilla.com/D75429
This commit is contained in:
Kris Maglione 2020-06-17 17:17:16 +00:00
Родитель 85c4e84fc5
Коммит 3bda67deab
105 изменённых файлов: 140 добавлений и 140 удалений

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

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

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

@ -992,7 +992,7 @@ function shortenString(aString, aMaxLength) {
* Return main chrome window (crosses chrome boundary)
*/
function getMainChromeWindow(aWindow) {
return aWindow.docShell.rootTreeItem.domWindow;
return aWindow.browsingContext.topChromeWindow;
}
/** Sets the test plugin(s) initially expected enabled state.

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

@ -43,7 +43,7 @@
new invokerChecker(EVENT_FOCUS, () => gDialog.document)
];
this.invoke = () => (gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL));
this.invoke = () => (gDialog = window.browsingContext.topChromeWindow.openDialog(aURL));
this.finalCheck = () => {
const accTree = {

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

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

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

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

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

@ -7966,7 +7966,7 @@ function BrowserOpenAddonsMgr(aView) {
let browserWindow;
var receivePong = function(aSubject, aTopic, aData) {
let browserWin = aSubject.docShell.rootTreeItem.domWindow;
let browserWin = aSubject.browsingContext.topChromeWindow;
if (!emWindow || browserWin == window /* favor the current window */) {
emWindow = aSubject;
browserWindow = browserWin;

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

@ -57,9 +57,7 @@ var gSanitizePromptDialog = {
.translateFragment(warningDesc)
.then(() => {
// And then ensure we've run layout.
let rootWin = window.docShell.rootTreeItem.QueryInterface(
Ci.nsIDocShell
).domWindow;
let rootWin = window.browsingContext.topChromeWindow;
return rootWin.promiseDocumentFlushed(() => {});
});
} else {

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

@ -129,9 +129,7 @@ var DownloadsTaskbar = {
*/
_attachIndicator(aWindow) {
// Activate the indicator on the specified window.
let docShell = aWindow.docShell.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIAppWindow).docShell;
let { docShell } = aWindow.browsingContext.topChromeWindow;
this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell);
// If the DownloadSummary object has already been created, we should update

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

@ -946,7 +946,7 @@ var gMainPane = {
* changes.
*/
async initDefaultZoomValues() {
let win = window.docShell.rootTreeItem.domWindow;
let win = window.browsingContext.topChromeWindow;
let selected = await win.ZoomUI.getGlobalValue();
let menulist = document.getElementById("defaultZoom");
@ -1174,7 +1174,7 @@ var gMainPane = {
* to set the property, regardless of our actual context.
*/
let win = window.docShell.rootTreeItem.domWindow;
let win = window.browsingContext.topChromeWindow;
cps2.setGlobal(win.FullZoom.name, newZoom, nonPrivateLoadContext);
},

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

@ -124,7 +124,7 @@ function init_all() {
// Ignore right clicks.
return;
}
let mainWindow = window.docShell.rootTreeItem.domWindow;
let mainWindow = window.browsingContext.topChromeWindow;
mainWindow.BrowserOpenAddonsMgr();
AMTelemetry.recordLinkEvent({
object: "aboutPreferences",

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

@ -268,7 +268,7 @@ var gSyncPane = {
// button label (ie, "Syncing...")
let tooltiptext = state.syncing
? document.getElementById("syncNow").getAttribute("label")
: window.docShell.rootTreeItem.domWindow.gSync.formatLastSyncDate(
: window.browsingContext.topChromeWindow.gSync.formatLastSyncDate(
state.lastSync
);
document
@ -552,12 +552,14 @@ var gSyncPane = {
// Disconnect the account, including everything linked.
unlinkFirefoxAccount(confirm) {
window.docShell.rootTreeItem.domWindow.gSync.disconnect({ confirm });
window.browsingContext.topChromeWindow.gSync.disconnect({
confirm,
});
},
// Disconnect sync, leaving the account connected.
disconnectSync() {
return window.docShell.rootTreeItem.domWindow.gSync.disconnect({
return window.browsingContext.topChromeWindow.gSync.disconnect({
confirm: true,
disconnectAccount: false,
});

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

@ -276,7 +276,7 @@ function onListKeyDown(aEvent) {
// Helper functions
function getBrowserWindow() {
return window.docShell.rootTreeItem.domWindow;
return window.browsingContext.topChromeWindow;
}
function toggleRowChecked(aIx) {

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

@ -8,5 +8,5 @@ var EXPORTED_SYMBOLS = ["getChromeWindow"];
// Get the chrome (ie, browser) window hosting this content.
function getChromeWindow(window) {
return window.docShell.rootTreeItem.domWindow.wrappedJSObject;
return window.browsingContext.topChromeWindow;
}

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

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

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

@ -521,7 +521,7 @@ var gDevToolsBrowser = (exports.gDevToolsBrowser = {
}
debugService.activationHandler = function(window) {
const chromeWindow = window.docShell.rootTreeItem.domWindow;
const chromeWindow = window.browsingContext.topChromeWindow;
let setupFinished = false;
slowScriptDebugHandler(chromeWindow.gBrowser.selectedTab, () => {

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

@ -10,7 +10,7 @@ const Services = require("Services");
* Returns the `nsIDOMWindow` toplevel window for any child/inner window
*/
function getTopLevelWindow(window) {
return window.docShell.rootTreeItem.domWindow;
return window.browsingContext.topChromeWindow;
}
exports.getTopLevelWindow = getTopLevelWindow;

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

@ -28,7 +28,7 @@ function nextTest() {
gen.next();
}
let chromeWindow = docShell.rootTreeItem.domWindow;
let chromeWindow = window.browsingContext.topChromeWindow;
function* doTest() {
var notificationCount = 0;

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

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

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

@ -72,7 +72,7 @@ windows.
* nonRemote<num>: a reference to the non-remote browser in the window
*/
async function prepareWindow(num, page) {
let win = docShell.rootTreeItem.domWindow.open(BROWSER_DOC, "bug1474662-" + num, "chrome,width=200,height=200");
let win = window.browsingContext.topChromeWindow.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");

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

@ -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 = docShell.rootTreeItem.domWindow.openDialog(OUTER_URL, "_blank", "chrome,dialog=no,all");
let win = window.browsingContext.topChromeWindow.openDialog(OUTER_URL, "_blank", "chrome,dialog=no,all");
await waitForEvent(OUTER_URL);
await waitForEvent(INNER_URL);
win.close();

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

@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1016960
/** Test for Bug 1016960 **/
var chromeWindow = docShell.rootTreeItem.domWindow.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
var chromeWindow = window.browsingContext.topChromeWindow.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();

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

@ -29,8 +29,8 @@
// Need to open as a toplevel chrome window so that
// DRAWWINDOW_USE_WIDGET_LAYERS is honored.
sourceWindow = docShell.rootTreeItem.domWindow.open("file_drawWindow_source.html", "",
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
sourceWindow = window.browsingContext.topChromeWindow.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 = docShell.rootTreeItem.domWindow.open("window_bug1412775.xhtml", "_new", "chrome");
win = window.browsingContext.topChromeWindow.open("window_bug1412775.xhtml", "_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 = docShell.rootTreeItem.domWindow.open("window_bug617528.xhtml", "_new", "chrome");
_window = window.browsingContext.topChromeWindow.open("window_bug617528.xhtml", "_new", "chrome");
_window.addEventListener("load", onLoad, false);
}

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

@ -14,7 +14,9 @@ cpm.addMessageListener("cpm-async", function(m) {
cpm.sendAsyncMessage("ppm-async");
});
var dshell = content.docShell.rootTreeItem.QueryInterface(Ci.nsIDocShell);
var dshell = content.docShell.sameTypeRootTreeItem.QueryInterface(
Ci.nsIDocShell
);
addEventListener(
"click",

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

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

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

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

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

@ -54,7 +54,7 @@ async function runTestsCallback() {
is(state2, false, "Browser returned incorrect private mode state.");
// open a window with private mode and get the references of the elements.
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = getRootDirectory(window.location.href) + "privatemode_perwindowpb.xhtml";
function testOnWindow(aIsPrivate, aCallback) {

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

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

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

@ -31,7 +31,7 @@ function testOnWindow(aIsPrivate, aCallback) {
}
function setupWindow() {
mainWindow = window.docShell.rootTreeItem.domWindow;
mainWindow = window.browsingContext.topChromeWindow;
runTest();
}

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

@ -36,7 +36,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) {
}
function testOnWindow(options, callback) {
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var win = mainWindow.OpenBrowserWindow(options);
windowsToClose.push(win);

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

@ -38,7 +38,7 @@ SpecialPowers.pushPrefEnv({"set": [
]}, setup);
function setup() {
newwindow = docShell.rootTreeItem.domWindow.openDialog(
newwindow = window.browsingContext.topChromeWindow.openDialog(
"MozDomFullscreen_chrome.xhtml", "_blank","chrome,dialog=no,resizable=yes,width=400,height=400", window);
}

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

@ -26,7 +26,7 @@
<script>
SimpleTest.waitForExplicitFinish();
newwindow = docShell.rootTreeItem.domWindow.openDialog("window_activation.xhtml", "_blank","chrome,width=300,height=200", window);
newwindow = window.browsingContext.topChromeWindow.openDialog("window_activation.xhtml", "_blank","chrome,width=300,height=200", window);
function complete()
{

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

@ -17,8 +17,8 @@
SimpleTest.waitForExplicitFinish();
// Create two identical windows, each with a <browser> element.
let win1 = docShell.rootTreeItem.domWindow.openDialog("window_docshell_swap.xhtml", "_blank","chrome,width=300,height=200");
let win2 = docShell.rootTreeItem.domWindow.openDialog("window_docshell_swap.xhtml", "_blank","chrome,width=300,height=200");
let win1 = window.browsingContext.topChromeWindow.openDialog("window_docshell_swap.xhtml", "_blank","chrome,width=300,height=200");
let win2 = window.browsingContext.topChromeWindow.openDialog("window_docshell_swap.xhtml", "_blank","chrome,width=300,height=200");
let loadCount = 0;
function loadHandler() {

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

@ -13,7 +13,7 @@
<script>
SimpleTest.waitForExplicitFinish();
newwindow = docShell.rootTreeItem.domWindow.openDialog("fullscreen.xhtml", "_blank","chrome,resizable=yes", window);
newwindow = window.browsingContext.topChromeWindow.openDialog("fullscreen.xhtml", "_blank","chrome,resizable=yes", window);
function done()
{

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

@ -13,7 +13,7 @@
<script>
SimpleTest.waitForExplicitFinish();
newwindow = docShell.rootTreeItem.domWindow.openDialog("sizemode_attribute.xhtml", "_blank","chrome,resizable=yes", window);
newwindow = window.browsingContext.topChromeWindow.openDialog("sizemode_attribute.xhtml", "_blank","chrome,resizable=yes", window);
function done() {
newwindow.close();

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

@ -272,7 +272,7 @@ function checkSelection(node, testid)
function getTopWindow(win)
{
return win.docShell.rootTreeItem.domWindow;
return win.browsingContext.topChromeWindow;
}
function mouseWillTriggerFocus(element)

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

@ -11,7 +11,7 @@
SimpleTest.waitForExplicitFinish();
async function run_test(path) {
let win = window.docShell.rootTreeItem.domWindow
let win = window.browsingContext.topChromeWindow
.openDialog(path, "_blank", "width=500,height=500", window);
await SimpleTest.promiseFocus(win);
await win.startTest();

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

@ -15,7 +15,7 @@ prefBranch.setIntPref("browser.startup.page", 0);
prefBranch.setCharPref("browser.startup.homepage_override.mstone", "ignore");
function startTest() {
mainWindow = window.docShell.rootTreeItem.domWindow;
mainWindow = window.browsingContext.topChromeWindow;
doTest();
}

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

@ -175,7 +175,7 @@ function whenDelayedStartupFinished(aCallback) {
}
function testOnWindow(aIsPrivate, callback) {
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
mainWindow.openWebLinkIn(CONTENT_PAGE, "window", {
private: aIsPrivate });

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

@ -28,7 +28,7 @@ function testOnWindow(aIsPrivate, aCallback) {
}
function setupWindow() {
mainWindow = window.docShell.rootTreeItem.domWindow;
mainWindow = window.browsingContext.topChromeWindow;
runTest();
}

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

@ -14,7 +14,7 @@
<script>
SimpleTest.waitForExplicitFinish();
let chromeWindow = docShell.rootTreeItem.domWindow;
let chromeWindow = window.browsingContext.topChromeWindow;
var attempts = 0;

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

@ -20,7 +20,7 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set":[["dom.ipc.tabs.disabled", true]]}, startTest);
function startTest() {
var otherWindow = docShell.rootTreeItem.domWindow.open("window_bug757137.xhtml", "", "chrome");
var otherWindow = window.browsingContext.topChromeWindow.open("window_bug757137.xhtml", "", "chrome");
ok(otherWindow.isChromeWindow, 'XUL window should be a ChromeWindow');
otherWindow.onload = function () {

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

@ -46,8 +46,7 @@ SimpleTest.waitForFocus(async function() {
/* eslint-env mozilla/frame-script */
script = SpecialPowers.loadChromeScript(function() {
var chromeWin = actorParent.rootFrameLoader
.ownerElement.ownerGlobal.docShell
.rootTreeItem.domWindow;
.ownerElement.ownerGlobal.browsingContext.topChromeWindow;
var contextMenu = chromeWin.document.getElementById("contentAreaContextMenu");
contextMenu.addEventListener("popupshown",
() => sendAsyncMessage("popupshown"));

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

@ -33,10 +33,9 @@ add_task(async function() {
},
async function(browser) {
await SpecialPowers.spawn(browser, [], async function() {
let rootDocShell = docShell
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell);
let rootDocShell = docShell.sameTypeRootTreeItem.QueryInterface(
Ci.nsIDocShell
);
let defaultAppType = rootDocShell.appType;
rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_EDITOR;
@ -88,10 +87,9 @@ add_task(async function() {
},
async function(browser) {
await SpecialPowers.spawn(browser, [], async function() {
let rootDocShell = docShell
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell);
let rootDocShell = docShell.sameTypeRootTreeItem.QueryInterface(
Ci.nsIDocShell
);
let defaultAppType = rootDocShell.appType;
rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_UNKNOWN;

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

@ -53,14 +53,17 @@ function continueTest() {
// we need to drawWindow the chrome window so we can get a dump of the retained widget layers
// if we have to repaint to fulfill this drawWindow request then it will be impossible to
// observe the bug
var chromewin = SpecialPowers.wrap(win).docShell.rootTreeItem.domWindow;
// XXX(kmag): This test has not had access to a chrome window since the dawn
// of e10s. I'm not sure how accurate the above comment was even before that
// point, but it certainly is not accurate now.
var topWin = SpecialPowers.wrap(win).top;
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
el.width = chromewin.innerWidth;
el.height = chromewin.innerHeight;
el.width = topWin.innerWidth;
el.height = topWin.innerHeight;
var ctx = el.getContext("2d");
// pass the correct flags so we don't have to flush the retained layers
SpecialPowers.wrap(ctx).drawWindow(chromewin, 0, 0, chromewin.innerWidth, chromewin.innerHeight, "rgba(0,0,0,0)",
SpecialPowers.wrap(ctx).drawWindow(topWin, 0, 0, topWin.innerWidth, topWin.innerHeight, "rgba(0,0,0,0)",
ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_DRAW_CARET);
var leftbox = win.document.getElementById("left").getBoundingClientRect();

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1124898
SimpleTest.expectAssertions(0, 1); // Dumb unrelated widget assertion - see bug 1126023.
var w = docShell.rootTreeItem.domWindow.open("about:blank", "w", "chrome");
var w = window.browsingContext.topChromeWindow.open("about:blank", "w", "chrome");
is(w.eval('typeof getAttention'), 'function', 'getAttention exists on regular chrome window');
is(w.eval('typeof messageManager'), 'object', 'messageManager exists on regular chrome window');
var contentURL = "http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html";

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

@ -47,7 +47,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=503926
ok(!contentWin.passed, "untrusted QI should not be called");
// Try with a dialog.
docShell.rootTreeItem.domWindow.openDialog("bug503926.xhtml", "chromeDialog", "modal", window);
window.browsingContext.topChromeWindow.openDialog("bug503926.xhtml", "chromeDialog", "modal", window);
SimpleTest.finish();
}

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=458898
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var win = docShell.rootTreeItem.domWindow.openDialog("file_bug458898.html");
var win = window.browsingContext.topChromeWindow.openDialog("file_bug458898.html");
function loaded() {
var disableWindowResizePref = "dom.disable_window_move_resize";

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

@ -12,10 +12,10 @@ const baseURL = "chrome://mochitests/content/chrome/layout/base/tests/chrome/";
// Tests that browser visibility is updated when it's swapped.
add_task(async () => {
// Open two new windows to swap iframes.
const window1 = docShell.rootTreeItem.domWindow.open(
const window1 = window.browsingContext.topChromeWindow.open(
baseURL + "window_css_visibility_propagation-1.xhtml",
"_blank", "chrome");
const window2 = docShell.rootTreeItem.domWindow.open(
const window2 = window.browsingContext.topChromeWindow.open(
baseURL + "window_css_visibility_propagation-2.xhtml",
"_blank", "chrome");

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

@ -129,7 +129,7 @@ function endTest() {
SimpleTest.finish();
}
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://mochi.test:8888/chrome/layout/forms/test/bug536567_iframe.html";
function whenDelayedStartupFinished(aWindow, aCallback) {

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

@ -35,7 +35,7 @@ let fullscreenChanged = false;
let childHasFocused = false;
function openFullscreenWindow() {
win = window.docShell.rootTreeItem.domWindow
win = window.browsingContext.topChromeWindow
.openDialog("bug665540_window.xhtml", "_blank", "resizable=yes,chrome");
win.addEventListener("sizemodechange", () => {

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

@ -86,7 +86,7 @@ function nextTest()
SimpleTest.waitForFocus(function () { nextPopupTest(document.getElementById("panel")) } );
}
else {
tests[gTestId].window = docShell.rootTreeItem.domWindow.open(tests[gTestId].src, "_blank", "chrome,resizable=yes");
tests[gTestId].window = window.browsingContext.topChromeWindow.open(tests[gTestId].src, "_blank", "chrome,resizable=yes");
SimpleTest.waitForFocus(windowOpened, tests[gTestId].window);
}
}
@ -169,7 +169,7 @@ function nextPopupTest(panel)
if (++gTestId >= popupTests.length) {
// Next, check a panel that has a titlebar to ensure that it is accounted for
// properly in the size.
var titledPanelWindow = docShell.rootTreeItem.domWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes");
var titledPanelWindow = window.browsingContext.topChromeWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes");
SimpleTest.waitForFocus(titledPanelWindowOpened, titledPanelWindow);
}
else {

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

@ -21,7 +21,7 @@ ChromeUtils.defineModuleGetter(
);
const getBrowserWindow = window => {
return window.docShell.rootTreeItem.domWindow;
return window.browsingContext.topChromeWindow;
};
const tabListener = {

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

@ -426,7 +426,7 @@ function editCerts() {
getSelectedCerts();
for (let cert of selected_certs) {
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://pippki/content/editcacert.xhtml",
"",
"chrome,centerscreen,modal",
@ -554,7 +554,7 @@ function deleteCerts() {
let retVals = {
deleteConfirmed: false,
};
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://pippki/content/deletecert.xhtml",
"",
"chrome,centerscreen,modal",
@ -627,7 +627,7 @@ async function addEmailCert() {
}
function addException() {
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://pippki/content/exceptionDialog.xhtml",
"",
"chrome,centerscreen,modal"

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

@ -326,7 +326,7 @@ function doLogout() {
// load a new device
function doLoad() {
window.docShell.rootTreeItem.domWindow.open(
window.browsingContext.topChromeWindow.open(
"load_device.xhtml",
"loaddevice",
"chrome,centerscreen,modal"
@ -365,7 +365,7 @@ function changePassword() {
let objects = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
objects.appendElement(selected_slot.getToken());
params.objects = objects;
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"changepassword.xhtml",
"",
"chrome,centerscreen,modal",

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

@ -28,7 +28,7 @@
// When the round begins, this will be initialized.
var testsleftinround = 0;
var currentround = "";
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
SpecialPowers.Services.prefs.setIntPref("browser.startup.page", 0);

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

@ -1281,7 +1281,7 @@ class SpecialPowersChild extends JSWindowActorChild {
// XXX: these APIs really ought to be removed, they're not e10s-safe.
// (also they're pretty Firefox-specific)
_getTopChromeWindow(window) {
return window.docShell.rootTreeItem.domWindow;
return window.browsingContext.topChromeWindow;
}
_getAutoCompletePopup(window) {
return this._getTopChromeWindow(window).document.getElementById(

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

@ -38,7 +38,7 @@
SpecialPowers.pushPrefEnv({"set": prefs}, function() {
for (let i = 0; i < numRemotes; i++) {
let w = remotes[i] = docShell.rootTreeItem.domWindow.open("remote.xhtml", "", "chrome");
let w = remotes[i] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
w.addEventListener("load", function loadHandler() {
w.removeEventListener("load", loadHandler);

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

@ -24,7 +24,7 @@
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", numRemotes]]},
function() {
for (let i = 0; i < numRemotes; i++) {
let w = remotes[i] = docShell.rootTreeItem.domWindow.open("remote.xhtml", "", "chrome");
let w = remotes[i] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
w.addEventListener("load", function loadHandler() {
w.removeEventListener("load", loadHandler);

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

@ -25,7 +25,7 @@
let remotes = [];
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 3]]}, function() {
for (let i = 0; i < numRemotes; i++) {
let w = remotes[i] = docShell.rootTreeItem.domWindow.open("remote.xhtml", "", "chrome");
let w = remotes[i] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
w.addEventListener("load", function loadHandler() {
w.removeEventListener("load", loadHandler);

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

@ -570,7 +570,7 @@ class ExtensionPageContextParent extends ProxyContextParent {
// The window that contains this context. This may change due to moving tabs.
get appWindow() {
let win = this.xulBrowser.ownerGlobal;
return win.docShell.rootTreeItem.domWindow;
return win.browsingContext.topChromeWindow;
}
get currentWindow() {

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

@ -14,7 +14,7 @@
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
let w = docShell.rootTreeItem.domWindow.openDialog('browser_disableglobalhistory.xhtml', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
let w = window.browsingContext.topChromeWindow.openDialog('browser_disableglobalhistory.xhtml', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
function done() {
w.close();

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

@ -20,7 +20,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
const {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm");
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var testDatas = [
{ url: "itisaphishingsite.org/phishing.html",

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

@ -14,7 +14,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html";
var Cc = SpecialPowers.Cc;

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

@ -16,7 +16,7 @@
<script src="head.js"></script>
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/bug_1281083.html";
const testTable = "moz-track-digest256";

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

@ -14,7 +14,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
const tests = [
// DNT turned on and TP turned off, DNT signal sent in both private browsing

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

@ -16,7 +16,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://www.itisatrap.org/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html";
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

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

@ -21,7 +21,7 @@ const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/Browser
;
const {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm");
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
const SJS = "mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs";
const BASE_URL = "http://" + SJS + "?";

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

@ -21,7 +21,7 @@ const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var listmanager = Cc["@mozilla.org/url-classifier/listmanager;1"].
getService(Ci.nsIUrlListManager);

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

@ -16,7 +16,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html";
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

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

@ -19,7 +19,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage = "http://www.itisatrap.org/chrome/toolkit/components/url-classifier/tests/mochitest/trackingRequest.html";
ChromeUtils.import("resource://gre/modules/Services.jsm");

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

@ -17,7 +17,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.window.browsingContext.topChromeWindow;
var contentPage1 = "http://www.example.com/chrome/toolkit/components/url-classifier/tests/mochitest/bug_1580416.html";
ChromeUtils.import("resource://gre/modules/Services.jsm");

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

@ -16,7 +16,7 @@
<script class="testbody" type="text/javascript">
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var contentPage1 = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";
var contentPage2 = "http://example.com/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";

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

@ -22,7 +22,7 @@ Test that arguments can be passed to dialogs.
}
SimpleTest.waitForExplicitFinish();
let win = window.docShell.rootTreeItem.domWindow.openDialog("file_test_dialog.html", "_blank", "width=100,height=100", TEST_ITEM, window);
let win = window.browsingContext.topChromeWindow.openDialog("file_test_dialog.html", "_blank", "width=100,height=100", TEST_ITEM, window);
</script>
</head>
<body>

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

@ -208,7 +208,7 @@ function CreateProfile(profile) {
function createProfileWizard() {
// This should be rewritten in HTML eventually.
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://mozapps/content/profile/createProfileWizard.xhtml",
"",
"centerscreen,chrome,modal,titlebar",

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

@ -1571,7 +1571,7 @@ function setupEventListeners() {
button = $("show-update-history-button");
if (button) {
button.addEventListener("click", function(event) {
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://mozapps/content/update/history.xhtml",
"Update:History",
"centerscreen,resizable=no,titlebar,modal"

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

@ -145,7 +145,7 @@ function sectionalizeObject(obj) {
* Obtain the main DOMWindow for the current context.
*/
function getMainWindow() {
return window.docShell.rootTreeItem.domWindow;
return window.browsingContext.topChromeWindow;
}
/**

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

@ -12,7 +12,7 @@
SimpleTest.waitForExplicitFinish();
function runTest() {
add_task(async function() {
let win = docShell.rootTreeItem.domWindow.openDialog("window_browser_drop.xhtml", "_blank", "chrome,width=200,height=200", window);
let win = window.browsingContext.topChromeWindow.openDialog("window_browser_drop.xhtml", "_blank", "chrome,width=200,height=200", window);
await SimpleTest.promiseFocus(win);
for (let browserType of ["content", "remote-content"]) {
await win.dropLinksOnBrowser(win.document.getElementById(browserType + "child"), browserType);

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

@ -28,7 +28,7 @@ var timeoutID;
var menu;
function openTestWindow() {
win = docShell.rootTreeItem.domWindow.openDialog("bug624329_window.xhtml", "_blank", "width=300,resizable=yes,chrome", window);
win = window.browsingContext.topChromeWindow.openDialog("bug624329_window.xhtml", "_blank", "width=300,resizable=yes,chrome", window);
// Close our window if the test times out so that it doesn't interfere
// with later tests.
timeoutID = setTimeout(function () {

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

@ -59,7 +59,7 @@ function runTest()
var expectedFocus = expected[step - 1];
let filename = expectedFocus == "root" ? "dialog_dialogfocus2.xhtml" : "dialog_dialogfocus.xhtml";
var win = docShell.rootTreeItem.domWindow.openDialog(filename, "_new", "chrome,dialog", step);
var win = window.browsingContext.topChromeWindow.openDialog(filename, "_new", "chrome,dialog", step);
function checkDialogFocus(event)
{

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

@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1513343
SimpleTest.waitForExplicitFinish();
async function runTest() {
let win = window.docShell.rootTreeItem.domWindow.open("file_edit_contextmenu.xhtml", "context-menu", "chrome,width=600,height=600");
let win = window.browsingContext.topChromeWindow.open("file_edit_contextmenu.xhtml", "context-menu", "chrome,width=600,height=600");
await new Promise(r => win.addEventListener("load", r, { once: true}));
await SimpleTest.promiseFocus(win);

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

@ -26,7 +26,7 @@
}
function openWindow(features = "") {
return docShell.rootTreeItem.domWindow.openDialog(
return window.browsingContext.topChromeWindow.openDialog(
"window_maximized_persist.xhtml",
"_blank", "chrome,dialog=no,all," + features, window);
}

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

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1460639
// first loading about:blank and then navigating to window_navigate_persist.html.
const PERSIST_SIZE = 200;
// First, load the document and resize it so the size is persisted.
let win = window.docShell.rootTreeItem.domWindow
let win = window.browsingContext.topChromeWindow
.openDialog("window_navigate_persist.html", "_blank", `chrome,all,dialog=no`);
await SimpleTest.promiseFocus(win);
await resize(win, PERSIST_SIZE);
@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1460639
win.close();
// Now mimic early first paint.
win = window.docShell.rootTreeItem.domWindow
win = window.browsingContext.topChromeWindow
.openDialog("about:blank", "_blank", `chrome,all,dialog=no`);
await SimpleTest.promiseFocus(win, true);
isnot(win.outerWidth, PERSIST_SIZE, "Initial window width is not the persisted size");

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

@ -444,11 +444,11 @@
{
// test with instantApply
InitTestPrefs(true);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunInstantPrefTest, false);
window.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunInstantPrefTest, false);
// - test deferred reset in child window
InitTestPrefs(true);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, false);
window.browsingContext.topChromeWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, false);
expected = kPrefValueSet1;
found = ReadPrefsFromSystem();
ok(found.int === expected.int, "instant reset deferred int" );
@ -464,11 +464,11 @@
// test without instantApply
// - general tests, similar to instant apply
InitTestPrefs(false);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestGeneral, false);
window.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestGeneral, false);
// - test Cancel
InitTestPrefs(false);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, false);
window.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, false);
var expected = kPrefValueSet1;
var found = ReadPrefsFromSystem();
ok(found.int === expected.int, "non-instant cancel system int" );
@ -480,7 +480,7 @@
// - test Accept
InitTestPrefs(false);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, true);
window.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, true);
expected = kPrefValueSet2;
found = ReadPrefsFromSystem();
ok(found.int === expected.int, "non-instant accept system int" );
@ -492,7 +492,7 @@
// - test deferred reset in child window
InitTestPrefs(false);
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, true);
window.browsingContext.topChromeWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, true);
expected = CreateEmptyPrefValueSet();
found = ReadPrefsFromSystem();
ok(found.int === expected.int, "non-instant reset deferred int" );
@ -505,7 +505,7 @@
function RunTestCommandRedirect()
{
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences_commandretarget.xhtml", "", "modal", RunCheckCommandRedirect, true);
window.browsingContext.topChromeWindow.openDialog("window_preferences_commandretarget.xhtml", "", "modal", RunCheckCommandRedirect, true);
}
function RunTestDisabled()
@ -514,7 +514,7 @@
const defaultBranch = kPref.getDefaultBranch("");
defaultBranch.setBoolPref("tests.locked_preference_bool", true);
defaultBranch.lockPref("tests.locked_preference_bool");
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences_disabled.xhtml", "", "modal", RunCheckDisabled, true);
window.browsingContext.topChromeWindow.openDialog("window_preferences_disabled.xhtml", "", "modal", RunCheckDisabled, true);
}
function RunTest()

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

@ -18,7 +18,7 @@
});
// No instant-apply for this test
var prefWindow = window.docShell.rootTreeItem.domWindow.openDialog("window_preferences_beforeaccept.xhtml", "", "", windowOnload);
var prefWindow = window.browsingContext.topChromeWindow.openDialog("window_preferences_beforeaccept.xhtml", "", "", windowOnload);
function windowOnload() {
var dialogShown = prefWindow.Preferences.get("tests.beforeaccept.dialogShown");

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

@ -24,7 +24,7 @@
}
let counter = 0;
let prefWindow = window.docShell.rootTreeItem.domWindow.openDialog("window_preferences_onsyncfrompreference.xhtml", "", "", onSync);
let prefWindow = window.browsingContext.topChromeWindow.openDialog("window_preferences_onsyncfrompreference.xhtml", "", "", onSync);
SimpleTest.registerCleanupFunction(() => {
for (let pref of PREFS) {

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

@ -16,7 +16,7 @@
var upper = 60 + screen.availTop;
function runTest() {
win = window.docShell.rootTreeItem.domWindow
win = window.browsingContext.topChromeWindow
.openDialog("window_screenPosSize.xhtml",
"_blank",
"chrome,dialog=no,all,screenX=" + left + ",screenY=" + upper + ",outerHeight=200,outerWidth=200");
@ -31,7 +31,7 @@
}
function runTest2() {
win.close();
win = window.docShell.rootTreeItem.domWindow
win = window.browsingContext.topChromeWindow
.openDialog("window_screenPosSize.xhtml",
"_blank",
"chrome,dialog=no,all");

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

@ -59,7 +59,7 @@ function runTest()
isnot(sel2.focusNode, frames[1].document.body, "focusNode for showcaret");
ok(sel2.anchorOffset > 0, "focusOffset for showcaret");
otherWindow = window.docShell.rootTreeItem.domWindow.open("window_showcaret.xhtml", "_blank", "chrome,width=400,height=200");
otherWindow = window.browsingContext.topChromeWindow.open("window_showcaret.xhtml", "_blank", "chrome,width=400,height=200");
otherWindow.addEventListener("focus", otherWindowFocused, false);
}

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

@ -10,7 +10,7 @@
SimpleTest.waitForExplicitFinish();
function openWindow(features = "") {
return window.docShell.rootTreeItem.domWindow
return window.browsingContext.topChromeWindow
.openDialog("window_intrinsic_size.xhtml",
"", "chrome,dialog=no,all," + features);
}

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

@ -54,7 +54,7 @@ var ResetProfile = {
let params = {
reset: false,
};
window.docShell.rootTreeItem.domWindow.openDialog(
window.browsingContext.topChromeWindow.openDialog(
"chrome://global/content/resetProfile.xhtml",
null,
"modal,centerscreen,titlebar",

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

@ -181,7 +181,7 @@ nsUnknownContentTypeDialog.prototype = {
reallyShow() {
try {
let docShell = this.mContext.getInterface(Ci.nsIDocShell);
let rootWin = docShell.rootTreeItem.domWindow;
let rootWin = docShell.browsingContext.topChromeWindow;
this.mDialog = Services.ww.openWindow(
rootWin,
"chrome://mozapps/content/downloads/unknownContentType.xhtml",

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

@ -130,7 +130,7 @@ nsContentDispatchChooser.prototype = {
// nsIContentDispatchChooser
ask: function ask(aHandler, aURI, aPrincipal, aBrowsingContext, aReason) {
let window = aBrowsingContext?.top?.embedderElement?.ownerGlobal || null;
let window = aBrowsingContext?.topChromeWindow || null;
if (aBrowsingContext) {
const topBC = aBrowsingContext.top;

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

@ -96,7 +96,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1123480
// disabled and enabled
const {PrivateBrowsingUtils} = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
for (let private of [false, true]) {
var win = docShell.rootTreeItem.domWindow.open("about:blank", "_blank", "chrome, width=500, height=200" + (private ? ", private" : ""));
var win = window.browsingContext.topChromeWindow.open("about:blank", "_blank", "chrome, width=500, height=200" + (private ? ", private" : ""));
ok(win, private ? "should open private window" : "should open non-private window");
is(PrivateBrowsingUtils.isContentWindowPrivate(win), private, "used correct window context");

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

@ -34,7 +34,7 @@ SimpleTest.waitForFocus(function () {
return;
}
var win = docShell.rootTreeItem.domWindow.open(
var win = window.browsingContext.topChromeWindow.open(
"window_bug538242.xhtml", "_blank",
"chrome,width=400,height=300,left=100,top=100");
SimpleTest.waitForFocus(function () {

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

@ -28,7 +28,7 @@ function finish() {
SimpleTest.finish();
}
var mainWindow = window.docShell.rootTreeItem.domWindow;
var mainWindow = window.browsingContext.topChromeWindow;
var offscreenWindow = mainWindow.openDialog("window_bug593307_offscreen.xhtml", "",
"dialog=no,chrome,width=200,height=200,screenX=-3000,screenY=-3000",

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

@ -32,10 +32,10 @@ function moveMouseTo(x, y, andThen) {
}
function openWindows() {
gLeftWindow = window.docShell.rootTreeItem.domWindow
gLeftWindow = window.browsingContext.topChromeWindow
.open('empty_window.xhtml', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200');
SimpleTest.waitForFocus(function () {
gRightWindow = window.docShell.rootTreeItem.domWindow
gRightWindow = window.browsingContext.topChromeWindow
.open('empty_window.xhtml', '', 'chrome,screenX=300,screenY=50,width=200,height=200');
SimpleTest.waitForFocus(attachBrowserToLeftWindow, gRightWindow);
}, gLeftWindow);

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

@ -13,7 +13,7 @@
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
SimpleTest.waitForExplicitFinish();
var w = docShell.rootTreeItem.domWindow.openDialog(
var w = window.browsingContext.topChromeWindow.openDialog(
'chrome_context_menus_win.xhtml', '_blank', 'chrome,resizable=yes,width=600,height=600', window);
function done()

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

@ -40,7 +40,7 @@ function runTests()
}
otherWindow =
docShell.rootTreeItem.domWindow.open(
window.browsingContext.topChromeWindow.open(
"./file_input_events_on_deactive_window.html", "_blank",
"chrome,width=100,height=100");
ok(otherWindow, "failed to open other window");

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

@ -14,7 +14,7 @@ SimpleTest.requestFlakyTimeout("untriaged");
var childWindow;
function testStepOne() {
childWindow = window.docShell.rootTreeItem.domWindow.open("window_picker_no_crash_child.html", "childWindow", "width=300,height=150");
childWindow = window.browsingContext.topChromeWindow.open("window_picker_no_crash_child.html", "childWindow", "width=300,height=150");
SimpleTest.waitForFocus(testStepTwo, childWindow);
}

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