зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1638153) for perma failures on cross-origin-objects.html. CLOSED TREE
Backed out changeset f7aedc92d396 (bug 1638153) Backed out changeset 07ec713926c6 (bug 1638153) Backed out changeset 5a656842e241 (bug 1638153)
This commit is contained in:
Родитель
b2fb31c57b
Коммит
a36bb7751f
|
@ -121,7 +121,7 @@ function openBrowserWindowIntl() {
|
|||
}
|
||||
}
|
||||
|
||||
gBrowserContext.browserWnd = window.browsingContext.topChromeWindow.openDialog(
|
||||
gBrowserContext.browserWnd = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
return aWindow.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
|
||||
/** Sets the test plugin(s) initially expected enabled state.
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
new invokerChecker(EVENT_FOCUS, () => gDialog.document)
|
||||
];
|
||||
|
||||
this.invoke = () => (gDialog = window.browsingContext.topChromeWindow.openDialog(aURL));
|
||||
this.invoke = () => (gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL));
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
];
|
||||
|
||||
|
||||
this.invoke = () => gDialog = window.browsingContext.topChromeWindow.openDialog(aURL);
|
||||
this.invoke = () => gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL);
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
this) ];
|
||||
|
||||
this.invoke = function openWnd_invoke() {
|
||||
this.dialog = window.browsingContext.topChromeWindow
|
||||
this.dialog = window.docShell.rootTreeItem.domWindow
|
||||
.openDialog("about:mozilla",
|
||||
"AboutMozilla",
|
||||
"chrome,width=600,height=600");
|
||||
|
|
|
@ -7985,7 +7985,7 @@ function BrowserOpenAddonsMgr(aView) {
|
|||
let browserWindow;
|
||||
|
||||
var receivePong = function(aSubject, aTopic, aData) {
|
||||
let browserWin = aSubject.browsingContext.topChromeWindow;
|
||||
let browserWin = aSubject.docShell.rootTreeItem.domWindow;
|
||||
if (!emWindow || browserWin == window /* favor the current window */) {
|
||||
emWindow = aSubject;
|
||||
browserWindow = browserWin;
|
||||
|
|
|
@ -57,7 +57,9 @@ var gSanitizePromptDialog = {
|
|||
.translateFragment(warningDesc)
|
||||
.then(() => {
|
||||
// And then ensure we've run layout.
|
||||
let rootWin = window.browsingContext.topChromeWindow;
|
||||
let rootWin = window.docShell.rootTreeItem.QueryInterface(
|
||||
Ci.nsIDocShell
|
||||
).domWindow;
|
||||
return rootWin.promiseDocumentFlushed(() => {});
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -129,7 +129,9 @@ var DownloadsTaskbar = {
|
|||
*/
|
||||
_attachIndicator(aWindow) {
|
||||
// Activate the indicator on the specified window.
|
||||
let { docShell } = aWindow.browsingContext.topChromeWindow;
|
||||
let docShell = aWindow.docShell.treeOwner
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIAppWindow).docShell;
|
||||
this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell);
|
||||
|
||||
// If the DownloadSummary object has already been created, we should update
|
||||
|
|
|
@ -955,7 +955,7 @@ var gMainPane = {
|
|||
* changes.
|
||||
*/
|
||||
async initDefaultZoomValues() {
|
||||
let win = window.browsingContext.topChromeWindow;
|
||||
let win = window.docShell.rootTreeItem.domWindow;
|
||||
let selected = await win.ZoomUI.getGlobalValue();
|
||||
let menulist = document.getElementById("defaultZoom");
|
||||
|
||||
|
@ -1183,7 +1183,7 @@ var gMainPane = {
|
|||
* to set the property, regardless of our actual context.
|
||||
*/
|
||||
|
||||
let win = window.browsingContext.topChromeWindow;
|
||||
let win = window.docShell.rootTreeItem.domWindow;
|
||||
cps2.setGlobal(win.FullZoom.name, newZoom, nonPrivateLoadContext);
|
||||
},
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ function init_all() {
|
|||
// Ignore right clicks.
|
||||
return;
|
||||
}
|
||||
let mainWindow = window.browsingContext.topChromeWindow;
|
||||
let mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow.gSync.formatLastSyncDate(
|
||||
: window.docShell.rootTreeItem.domWindow.gSync.formatLastSyncDate(
|
||||
state.lastSync
|
||||
);
|
||||
document
|
||||
|
@ -552,14 +552,12 @@ var gSyncPane = {
|
|||
|
||||
// Disconnect the account, including everything linked.
|
||||
unlinkFirefoxAccount(confirm) {
|
||||
window.browsingContext.topChromeWindow.gSync.disconnect({
|
||||
confirm,
|
||||
});
|
||||
window.docShell.rootTreeItem.domWindow.gSync.disconnect({ confirm });
|
||||
},
|
||||
|
||||
// Disconnect sync, leaving the account connected.
|
||||
disconnectSync() {
|
||||
return window.browsingContext.topChromeWindow.gSync.disconnect({
|
||||
return window.docShell.rootTreeItem.domWindow.gSync.disconnect({
|
||||
confirm: true,
|
||||
disconnectAccount: false,
|
||||
});
|
||||
|
|
|
@ -276,7 +276,7 @@ function onListKeyDown(aEvent) {
|
|||
// Helper functions
|
||||
|
||||
function getBrowserWindow() {
|
||||
return window.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
|
||||
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.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow.wrappedJSObject;
|
||||
}
|
||||
|
|
|
@ -512,7 +512,7 @@ var SiteDataManager = {
|
|||
allowed: false,
|
||||
};
|
||||
let features = "centerscreen,chrome,modal,resizable=no";
|
||||
win.browsingContext.topChromeWindow.openDialog(
|
||||
win.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://browser/content/preferences/dialogs/siteDataRemoveSelected.xhtml",
|
||||
"",
|
||||
features,
|
||||
|
|
|
@ -521,7 +521,7 @@ var gDevToolsBrowser = (exports.gDevToolsBrowser = {
|
|||
}
|
||||
|
||||
debugService.activationHandler = function(window) {
|
||||
const chromeWindow = window.browsingContext.topChromeWindow;
|
||||
const chromeWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
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.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
exports.getTopLevelWindow = getTopLevelWindow;
|
||||
|
||||
|
|
|
@ -507,7 +507,6 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
|
|||
|
||||
// Window APIs that are cross-origin-accessible (from the HTML spec).
|
||||
WindowProxyHolder Window();
|
||||
BrowsingContext* GetBrowsingContext() { return this; };
|
||||
BrowsingContext* Self() { return this; }
|
||||
void Location(JSContext* aCx, JS::MutableHandle<JSObject*> aLocation,
|
||||
ErrorResult& aError);
|
||||
|
|
|
@ -205,18 +205,6 @@ CanonicalBrowsingContext::GetParentCrossChromeBoundary() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Nullable<WindowProxyHolder> CanonicalBrowsingContext::GetTopChromeWindow() {
|
||||
RefPtr<CanonicalBrowsingContext> bc(this);
|
||||
while (RefPtr<CanonicalBrowsingContext> parent =
|
||||
bc->GetParentCrossChromeBoundary()) {
|
||||
bc = parent.forget();
|
||||
}
|
||||
if (bc->IsChrome()) {
|
||||
return WindowProxyHolder(bc.forget());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsISHistory* CanonicalBrowsingContext::GetSessionHistory() {
|
||||
if (!IsTop()) {
|
||||
return Cast(Top())->GetSessionHistory();
|
||||
|
|
|
@ -94,8 +94,6 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
|||
|
||||
already_AddRefed<CanonicalBrowsingContext> GetParentCrossChromeBoundary();
|
||||
|
||||
Nullable<WindowProxyHolder> GetTopChromeWindow();
|
||||
|
||||
nsISHistory* GetSessionHistory();
|
||||
UniquePtr<SessionHistoryInfoAndId> CreateSessionHistoryEntryForLoad(
|
||||
nsDocShellLoadState* aLoadState, nsIChannel* aChannel);
|
||||
|
|
|
@ -28,7 +28,7 @@ function nextTest() {
|
|||
gen.next();
|
||||
}
|
||||
|
||||
let chromeWindow = window.browsingContext.topChromeWindow;
|
||||
let chromeWindow = docShell.rootTreeItem.domWindow;
|
||||
|
||||
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 = window.browsingContext.topChromeWindow.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");
|
||||
|
|
|
@ -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.browsingContext.topChromeWindow.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");
|
||||
|
|
|
@ -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.browsingContext.topChromeWindow.openDialog(OUTER_URL, "_blank", "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();
|
||||
|
|
|
@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1016960
|
|||
|
||||
/** Test for Bug 1016960 **/
|
||||
|
||||
var chromeWindow = window.browsingContext.topChromeWindow.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
|
||||
var chromeWindow = docShell.rootTreeItem.domWindow.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
|
||||
ok(chromeWindow.isChromeWindow, "A chrome window should return true for .isChromeWindow.");
|
||||
chromeWindow.close();
|
||||
|
||||
|
|
|
@ -9528,9 +9528,7 @@ class CGSpecializedGetter(CGAbstractStaticMethod):
|
|||
if self.attr.getExtendedAttribute("CrossOriginReadable"):
|
||||
remoteType = type
|
||||
extendedAttributes = self.descriptor.getExtendedAttributes(self.attr, getter=True)
|
||||
if (remoteType.isGeckoInterface()
|
||||
and not remoteType.unroll().inner.isExternal()
|
||||
and remoteType.unroll().inner.getExtendedAttribute("ChromeOnly") is None):
|
||||
if remoteType.isGeckoInterface() and not remoteType.unroll().inner.isExternal():
|
||||
# We'll use a JSObject. It might make more sense to use remoteType's
|
||||
# RemoteProxy, but it's not easy to construct a type for that from here.
|
||||
remoteType = BuiltinTypes[IDLBuiltinType.Types.object]
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
|
||||
// Need to open as a toplevel chrome window so that
|
||||
// DRAWWINDOW_USE_WIDGET_LAYERS is honored.
|
||||
sourceWindow = window.browsingContext.topChromeWindow.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);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,8 +115,6 @@ interface CanonicalBrowsingContext : BrowsingContext {
|
|||
|
||||
readonly attribute WindowGlobalParent? currentWindowGlobal;
|
||||
|
||||
readonly attribute WindowProxy? topChromeWindow;
|
||||
|
||||
// XXX(nika): This feels kinda hacky, but will do for now while we don't
|
||||
// synchronously create WindowGlobalParent. It can throw if somehow the
|
||||
// content process has died.
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1412775
|
|||
var win;
|
||||
function init() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
win = window.browsingContext.topChromeWindow.open("window_bug1412775.xhtml", "_new", "chrome");
|
||||
win = docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.open("window_bug617528.xhtml", "_new", "chrome");
|
||||
_window = docShell.rootTreeItem.domWindow.open("window_bug617528.xhtml", "_new", "chrome");
|
||||
_window.addEventListener("load", onLoad, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,7 @@ cpm.addMessageListener("cpm-async", function(m) {
|
|||
cpm.sendAsyncMessage("ppm-async");
|
||||
});
|
||||
|
||||
var dshell = content.docShell.sameTypeRootTreeItem.QueryInterface(
|
||||
Ci.nsIDocShell
|
||||
);
|
||||
var dshell = content.docShell.rootTreeItem.QueryInterface(Ci.nsIDocShell);
|
||||
|
||||
addEventListener(
|
||||
"click",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.expectChildProcessCrash();
|
||||
|
||||
var w = window.browsingContext.topChromeWindow.openDialog('process_error.xhtml', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
var w = docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog('process_error.xhtml?crashType=CRASH_OOM', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
var w = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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 = window.browsingContext.topChromeWindow.openDialog('xulbrowser_plugin_visibility.xhtml', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
var w = docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
runTest();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) {
|
|||
}
|
||||
|
||||
function testOnWindow(options, callback) {
|
||||
var mainWindow = window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
var win = mainWindow.OpenBrowserWindow(options);
|
||||
windowsToClose.push(win);
|
||||
|
|
|
@ -38,7 +38,7 @@ SpecialPowers.pushPrefEnv({"set": [
|
|||
]}, setup);
|
||||
|
||||
function setup() {
|
||||
newwindow = window.browsingContext.topChromeWindow.openDialog(
|
||||
newwindow = docShell.rootTreeItem.domWindow.openDialog(
|
||||
"MozDomFullscreen_chrome.xhtml", "_blank","chrome,dialog=no,resizable=yes,width=400,height=400", window);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
newwindow = window.browsingContext.topChromeWindow.openDialog("window_activation.xhtml", "_blank","chrome,width=300,height=200", window);
|
||||
newwindow = docShell.rootTreeItem.domWindow.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 = 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 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 loadCount = 0;
|
||||
function loadHandler() {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
newwindow = window.browsingContext.topChromeWindow.openDialog("fullscreen.xhtml", "_blank","chrome,resizable=yes", window);
|
||||
newwindow = docShell.rootTreeItem.domWindow.openDialog("fullscreen.xhtml", "_blank","chrome,resizable=yes", window);
|
||||
|
||||
function done()
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
newwindow = window.browsingContext.topChromeWindow.openDialog("sizemode_attribute.xhtml", "_blank","chrome,resizable=yes", window);
|
||||
newwindow = docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
return win.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
|
||||
function mouseWillTriggerFocus(element)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
async function run_test(path) {
|
||||
let win = window.browsingContext.topChromeWindow
|
||||
let win = window.docShell.rootTreeItem.domWindow
|
||||
.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.browsingContext.topChromeWindow;
|
||||
mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
doTest();
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ function whenDelayedStartupFinished(aCallback) {
|
|||
}
|
||||
|
||||
function testOnWindow(aIsPrivate, callback) {
|
||||
var mainWindow = window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
mainWindow.openWebLinkIn(CONTENT_PAGE, "window", {
|
||||
private: aIsPrivate });
|
||||
|
|
|
@ -430,9 +430,6 @@ partial interface Window {
|
|||
|
||||
[ChromeOnly] readonly attribute nsIDocShell? docShell;
|
||||
|
||||
[ChromeOnly, Constant, CrossOriginReadable, BinaryName="getBrowsingContext"]
|
||||
readonly attribute BrowsingContext browsingContext;
|
||||
|
||||
[Throws, NeedsCallerType]
|
||||
readonly attribute float mozInnerScreenX;
|
||||
[Throws, NeedsCallerType]
|
||||
|
|
|
@ -28,7 +28,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
}
|
||||
|
||||
function setupWindow() {
|
||||
mainWindow = window.browsingContext.topChromeWindow;
|
||||
mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
runTest();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
let chromeWindow = window.browsingContext.topChromeWindow;
|
||||
let chromeWindow = docShell.rootTreeItem.domWindow;
|
||||
|
||||
var attempts = 0;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
SpecialPowers.pushPrefEnv({"set":[["dom.ipc.tabs.disabled", true]]}, startTest);
|
||||
|
||||
function startTest() {
|
||||
var otherWindow = window.browsingContext.topChromeWindow.open("window_bug757137.xhtml", "", "chrome");
|
||||
var otherWindow = docShell.rootTreeItem.domWindow.open("window_bug757137.xhtml", "", "chrome");
|
||||
ok(otherWindow.isChromeWindow, 'XUL window should be a ChromeWindow');
|
||||
|
||||
otherWindow.onload = function () {
|
||||
|
|
|
@ -46,7 +46,8 @@ SimpleTest.waitForFocus(async function() {
|
|||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
var chromeWin = actorParent.rootFrameLoader
|
||||
.ownerElement.ownerGlobal.browsingContext.topChromeWindow;
|
||||
.ownerElement.ownerGlobal.docShell
|
||||
.rootTreeItem.domWindow;
|
||||
var contextMenu = chromeWin.document.getElementById("contentAreaContextMenu");
|
||||
contextMenu.addEventListener("popupshown",
|
||||
() => sendAsyncMessage("popupshown"));
|
||||
|
|
|
@ -33,9 +33,10 @@ add_task(async function() {
|
|||
},
|
||||
async function(browser) {
|
||||
await SpecialPowers.spawn(browser, [], async function() {
|
||||
let rootDocShell = docShell.sameTypeRootTreeItem.QueryInterface(
|
||||
Ci.nsIDocShell
|
||||
);
|
||||
let rootDocShell = docShell
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
let defaultAppType = rootDocShell.appType;
|
||||
|
||||
rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_EDITOR;
|
||||
|
@ -87,9 +88,10 @@ add_task(async function() {
|
|||
},
|
||||
async function(browser) {
|
||||
await SpecialPowers.spawn(browser, [], async function() {
|
||||
let rootDocShell = docShell.sameTypeRootTreeItem.QueryInterface(
|
||||
Ci.nsIDocShell
|
||||
);
|
||||
let rootDocShell = docShell
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
let defaultAppType = rootDocShell.appType;
|
||||
|
||||
rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_UNKNOWN;
|
||||
|
|
|
@ -53,17 +53,14 @@ 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
|
||||
// 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 chromewin = SpecialPowers.wrap(win).docShell.rootTreeItem.domWindow;
|
||||
|
||||
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
||||
el.width = topWin.innerWidth;
|
||||
el.height = topWin.innerHeight;
|
||||
el.width = chromewin.innerWidth;
|
||||
el.height = chromewin.innerHeight;
|
||||
var ctx = el.getContext("2d");
|
||||
// pass the correct flags so we don't have to flush the retained layers
|
||||
SpecialPowers.wrap(ctx).drawWindow(topWin, 0, 0, topWin.innerWidth, topWin.innerHeight, "rgba(0,0,0,0)",
|
||||
SpecialPowers.wrap(ctx).drawWindow(chromewin, 0, 0, chromewin.innerWidth, chromewin.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 = window.browsingContext.topChromeWindow.open("about:blank", "w", "chrome");
|
||||
var w = docShell.rootTreeItem.domWindow.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.
|
||||
window.browsingContext.topChromeWindow.openDialog("bug503926.xhtml", "chromeDialog", "modal", window);
|
||||
docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.openDialog("file_bug458898.html");
|
||||
var win = docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.open(
|
||||
const window1 = docShell.rootTreeItem.domWindow.open(
|
||||
baseURL + "window_css_visibility_propagation-1.xhtml",
|
||||
"_blank", "chrome");
|
||||
const window2 = window.browsingContext.topChromeWindow.open(
|
||||
const window2 = docShell.rootTreeItem.domWindow.open(
|
||||
baseURL + "window_css_visibility_propagation-2.xhtml",
|
||||
"_blank", "chrome");
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ function endTest() {
|
|||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
var mainWindow = window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow
|
||||
win = window.docShell.rootTreeItem.domWindow
|
||||
.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 = window.browsingContext.topChromeWindow.open(tests[gTestId].src, "_blank", "chrome,resizable=yes");
|
||||
tests[gTestId].window = docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes");
|
||||
var titledPanelWindow = docShell.rootTreeItem.domWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes");
|
||||
SimpleTest.waitForFocus(titledPanelWindowOpened, titledPanelWindow);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -21,7 +21,7 @@ ChromeUtils.defineModuleGetter(
|
|||
);
|
||||
|
||||
const getBrowserWindow = window => {
|
||||
return window.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow;
|
||||
};
|
||||
|
||||
const tabListener = {
|
||||
|
|
|
@ -426,7 +426,7 @@ function editCerts() {
|
|||
getSelectedCerts();
|
||||
|
||||
for (let cert of selected_certs) {
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://pippki/content/editcacert.xhtml",
|
||||
"",
|
||||
"chrome,centerscreen,modal",
|
||||
|
@ -554,7 +554,7 @@ function deleteCerts() {
|
|||
let retVals = {
|
||||
deleteConfirmed: false,
|
||||
};
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://pippki/content/deletecert.xhtml",
|
||||
"",
|
||||
"chrome,centerscreen,modal",
|
||||
|
@ -627,7 +627,7 @@ async function addEmailCert() {
|
|||
}
|
||||
|
||||
function addException() {
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://pippki/content/exceptionDialog.xhtml",
|
||||
"",
|
||||
"chrome,centerscreen,modal"
|
||||
|
|
|
@ -326,7 +326,7 @@ function doLogout() {
|
|||
|
||||
// load a new device
|
||||
function doLoad() {
|
||||
window.browsingContext.topChromeWindow.open(
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"changepassword.xhtml",
|
||||
"",
|
||||
"chrome,centerscreen,modal",
|
||||
|
|
|
@ -49,7 +49,7 @@ async function viewCertHelper(parent, cert, openingOption = "tab") {
|
|||
}
|
||||
} else {
|
||||
Services.ww.openWindow(
|
||||
parent && parent.browsingContext.topChromeWindow,
|
||||
parent && parent.docShell.rootTreeItem.domWindow,
|
||||
"chrome://pippki/content/certViewer.xhtml",
|
||||
"_blank",
|
||||
"centerscreen,chrome",
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
// When the round begins, this will be initialized.
|
||||
var testsleftinround = 0;
|
||||
var currentround = "";
|
||||
var mainWindow = window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
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.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
_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] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
|
||||
let w = remotes[i] = docShell.rootTreeItem.domWindow.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] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
|
||||
let w = remotes[i] = docShell.rootTreeItem.domWindow.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] = window.browsingContext.topChromeWindow.open("remote.xhtml", "", "chrome");
|
||||
let w = remotes[i] = docShell.rootTreeItem.domWindow.open("remote.xhtml", "", "chrome");
|
||||
|
||||
w.addEventListener("load", function loadHandler() {
|
||||
w.removeEventListener("load", loadHandler);
|
||||
|
|
|
@ -568,7 +568,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.browsingContext.topChromeWindow;
|
||||
return win.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
|
||||
get currentWindow() {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
let w = window.browsingContext.topChromeWindow.openDialog('browser_disableglobalhistory.xhtml', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
let w = docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
var testDatas = [
|
||||
{ url: "itisaphishingsite.org/phishing.html",
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var mainWindow = window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.window.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow;
|
||||
var mainWindow = window.docShell.rootTreeItem.domWindow;
|
||||
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.browsingContext.topChromeWindow.openDialog("file_test_dialog.html", "_blank", "width=100,height=100", TEST_ITEM, window);
|
||||
let win = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
"chrome://mozapps/content/profile/createProfileWizard.xhtml",
|
||||
"",
|
||||
"centerscreen,chrome,modal,titlebar",
|
||||
|
|
|
@ -1521,7 +1521,7 @@ function setupEventListeners() {
|
|||
button = $("show-update-history-button");
|
||||
if (button) {
|
||||
button.addEventListener("click", function(event) {
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
return window.docShell.rootTreeItem.domWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
function runTest() {
|
||||
add_task(async function() {
|
||||
let win = window.browsingContext.topChromeWindow.openDialog("window_browser_drop.xhtml", "_blank", "chrome,width=200,height=200", window);
|
||||
let win = docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.openDialog("bug624329_window.xhtml", "_blank", "width=300,resizable=yes,chrome", window);
|
||||
win = docShell.rootTreeItem.domWindow.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 = window.browsingContext.topChromeWindow.openDialog(filename, "_new", "chrome,dialog", step);
|
||||
var win = docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.open("file_edit_contextmenu.xhtml", "context-menu", "chrome,width=600,height=600");
|
||||
let win = window.docShell.rootTreeItem.domWindow.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 window.browsingContext.topChromeWindow.openDialog(
|
||||
return docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow
|
||||
let win = window.docShell.rootTreeItem.domWindow
|
||||
.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.browsingContext.topChromeWindow
|
||||
win = window.docShell.rootTreeItem.domWindow
|
||||
.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.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunInstantPrefTest, false);
|
||||
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunInstantPrefTest, false);
|
||||
|
||||
// - test deferred reset in child window
|
||||
InitTestPrefs(true);
|
||||
window.browsingContext.topChromeWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, false);
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestGeneral, false);
|
||||
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestGeneral, false);
|
||||
|
||||
// - test Cancel
|
||||
InitTestPrefs(false);
|
||||
window.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, false);
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences.xhtml", "", "modal", RunNonInstantPrefTestClose, true);
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences2.xhtml", "", "modal", RunResetPrefTest, true);
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences_commandretarget.xhtml", "", "modal", RunCheckCommandRedirect, true);
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences_disabled.xhtml", "", "modal", RunCheckDisabled, true);
|
||||
window.docShell.rootTreeItem.domWindow.openDialog("window_preferences_disabled.xhtml", "", "modal", RunCheckDisabled, true);
|
||||
}
|
||||
|
||||
function RunTest()
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
});
|
||||
|
||||
// No instant-apply for this test
|
||||
var prefWindow = window.browsingContext.topChromeWindow.openDialog("window_preferences_beforeaccept.xhtml", "", "", windowOnload);
|
||||
var prefWindow = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow.openDialog("window_preferences_onsyncfrompreference.xhtml", "", "", onSync);
|
||||
let prefWindow = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow
|
||||
win = window.docShell.rootTreeItem.domWindow
|
||||
.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.browsingContext.topChromeWindow
|
||||
win = window.docShell.rootTreeItem.domWindow
|
||||
.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.browsingContext.topChromeWindow.open("window_showcaret.xhtml", "_blank", "chrome,width=400,height=200");
|
||||
otherWindow = window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow
|
||||
return window.docShell.rootTreeItem.domWindow
|
||||
.openDialog("window_intrinsic_size.xhtml",
|
||||
"", "chrome,dialog=no,all," + features);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ var ResetProfile = {
|
|||
let params = {
|
||||
reset: false,
|
||||
};
|
||||
window.browsingContext.topChromeWindow.openDialog(
|
||||
window.docShell.rootTreeItem.domWindow.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.browsingContext.topChromeWindow;
|
||||
let rootWin = docShell.rootTreeItem.domWindow;
|
||||
this.mDialog = Services.ww.openWindow(
|
||||
rootWin,
|
||||
"chrome://mozapps/content/downloads/unknownContentType.xhtml",
|
||||
|
|
|
@ -19,7 +19,7 @@ nsContentDispatchChooser.prototype = {
|
|||
// nsIContentDispatchChooser
|
||||
|
||||
ask: function ask(aHandler, aBrowsingContext, aURI, aReason) {
|
||||
let window = aBrowsingContext?.topChromeWindow || null;
|
||||
let window = aBrowsingContext?.top?.embedderElement?.ownerGlobal || null;
|
||||
|
||||
var bundle = Services.strings.createBundle(STRINGBUNDLE_URL);
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче