Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Csoregi Natalia 2018-07-29 12:47:28 +03:00
commit b0f4e9eb05
154 changed files with 526 additions and 779 deletions

View File

@ -857,12 +857,7 @@ function shortenString(aString, aMaxLength) {
* Return main chrome window (crosses chrome boundary)
*/
function getMainChromeWindow(aWindow) {
return aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return aWindow.docShell.rootTreeItem.domWindow;
}
/** Sets the test plugin(s) initially expected enabled state.

View File

@ -7080,12 +7080,7 @@ function BrowserOpenAddonsMgr(aView) {
let browserWindow;
var receivePong = function(aSubject, aTopic, aData) {
let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let browserWin = aSubject.docShell.rootTreeItem.domWindow;
if (!emWindow || browserWin == window /* favor the current window */) {
emWindow = aSubject;
browserWindow = browserWin;

View File

@ -302,7 +302,8 @@ add_task(async function checkAdvancedDetails() {
is(message.tagName, "a", "Error message is a link");
message = await ContentTask.spawn(browser, {frame: useFrame}, async function({frame}) {
let doc = frame ? content.document.querySelector("iframe").contentDocument : content.document;
let win = frame ? content.document.querySelector("iframe").contentWindow : content;
let doc = win.document;
let errorCode = doc.getElementById("errorCode");
errorCode.click();
@ -311,7 +312,7 @@ add_task(async function checkAdvancedDetails() {
let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
let serializable = doc.docShell.failedChannel.securityInfo
let serializable = win.docShell.failedChannel.securityInfo
.QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable);
@ -388,7 +389,8 @@ add_task(async function checkAdvancedDetailsForHSTS() {
is(message.cdlTagName, "a", "cert_domain_link is a link");
message = await ContentTask.spawn(browser, {frame: useFrame}, async function({frame}) {
let doc = frame ? content.document.querySelector("iframe").contentDocument : content.document;
let win = frame ? content.document.querySelector("iframe").contentWindow : content;
let doc = win.document;
let errorCode = doc.getElementById("errorCode");
errorCode.click();
@ -397,7 +399,7 @@ add_task(async function checkAdvancedDetailsForHSTS() {
let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
let serializable = doc.docShell.failedChannel.securityInfo
let serializable = win.docShell.failedChannel.securityInfo
.QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable);

View File

@ -12,8 +12,7 @@ function waitForNewWindow() {
resolve(domwindow);
}
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var domwindow = aXULWindow.docShell.domWindow;
domwindow.addEventListener("load", downloadOnLoad, true);
},
onCloseWindow: aXULWindow => {},

View File

@ -28,8 +28,7 @@ function frameScript() {
});
});
function waitUntilActive() {
let doc = content.document;
if (doc.docShell.isActive && doc.hasFocus()) {
if (docShell.isActive && content.document.hasFocus()) {
sendAsyncMessage("Test:Activated");
} else {
setTimeout(waitUntilActive, 10);

View File

@ -21,7 +21,7 @@ add_task(async function test_principal_click() {
await loadPromise;
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
let channel = content.document.docShell.currentDocumentChannel;
let channel = content.docShell.currentDocumentChannel;
is(channel.originalURI.asciiSpec,
"about:test-about-principal-child",
"sanity check - make sure we test the principal for the correct URI");
@ -57,7 +57,7 @@ add_task(async function test_principal_ctrl_click() {
gBrowser.selectTabAtIndex(2);
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
let channel = content.document.docShell.currentDocumentChannel;
let channel = content.docShell.currentDocumentChannel;
is(channel.originalURI.asciiSpec,
"about:test-about-principal-child",
"sanity check - make sure we test the principal for the correct URI");
@ -102,7 +102,7 @@ add_task(async function test_principal_right_click_open_link_in_new_tab() {
gBrowser.selectTabAtIndex(2);
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
let channel = content.document.docShell.currentDocumentChannel;
let channel = content.docShell.currentDocumentChannel;
is(channel.originalURI.asciiSpec,
"about:test-about-principal-child",
"sanity check - make sure we test the principal for the correct URI");

View File

@ -317,8 +317,7 @@ WindowListener.prototype = {
onOpenWindow(aXULWindow) {
Services.wm.removeListener(this);
let domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let domwindow = aXULWindow.docShell.domWindow;
let onLoad = aEvent => {
is(domwindow.document.location.href, this.test_url,
"Opened Window is expected: " + this.test_title);

View File

@ -356,7 +356,7 @@ add_task(async function checkAllTheCSS() {
iframe.contentWindow.location = testFile;
await iframeLoaded;
let doc = iframe.contentWindow.document;
doc.docShell.cssErrorReportingEnabled = true;
iframe.contentWindow.docShell.cssErrorReportingEnabled = true;
// Parse and remove all manifests from the list.
// NOTE that this must be done before filtering out devtools paths

View File

@ -10,7 +10,7 @@ function waitForDocshellActivated() {
// "visibilitychange" event rather than polling the docShell.isActive.
await ContentTaskUtils.waitForEvent(content.document, "visibilitychange",
true /* capture */, (aEvent) => {
return content.document.docShell.isActive;
return content.docShell.isActive;
});
});
}

View File

@ -612,7 +612,7 @@ class TabTracker extends TabTrackerBase {
if (browser.ownerDocument.documentURI === "about:addons") {
// When we're loaded into a <browser> inside about:addons, we need to go up
// one more level.
browser = browser.ownerDocument.docShell.chromeEventHandler;
browser = browser.ownerGlobal.docShell.chromeEventHandler;
({gBrowser} = browser.ownerGlobal);
} else {

View File

@ -287,12 +287,7 @@ WebContentConverterRegistrar.prototype = {
* Returns the browser chrome window in which the content window is in
*/
_getBrowserWindowForContentWindow(aContentWindow) {
return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
return aContentWindow.docShell.rootTreeItem.domWindow
.wrappedJSObject;
},

View File

@ -670,12 +670,7 @@ function handURIToExistingBrowser(uri, location, cmdLine, forcePrivate, triggeri
return;
}
var navNav = navWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
var rootItem = navNav.QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem;
var rootWin = rootItem.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var bwin = rootWin.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow;
var bwin = navWin.docShell.rootTreeItem.domWindow;
bwin.openURI(uri, null, location,
Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL, triggeringPrincipal);
}

View File

@ -21,7 +21,7 @@ add_task(async function test_principal_right_click_open_link_in_new_private_win(
await ContentTask.spawn(privateWin.gBrowser.selectedBrowser, {DUMMY_PAGE, TEST_PAGE}, async function({DUMMY_PAGE, TEST_PAGE}) { // eslint-disable-line
let channel = content.document.docShell.currentDocumentChannel;
let channel = content.docShell.currentDocumentChannel;
is(channel.URI.spec, DUMMY_PAGE,
"sanity check to ensure we check principal for right URI");

View File

@ -46,12 +46,7 @@ function doSearch() {
window.removeEventListener("unload", recordPageClosed);
let win = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let win = window.docShell.rootTreeItem.domWindow;
win.openTrustedLinkIn(submission.uri.spec, "current", {
allowThirdPartyFixup: false,
postData: submission.postData,

View File

@ -17,8 +17,7 @@ function promiseDialogOpened() {
onOpenWindow(xulWin) {
Services.wm.removeListener(this);
let win = xulWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let win = xulWin.docShell.domWindow;
waitForFocus(() => {
if (win.location == "chrome://global/content/commonDialog.xul")
resolve(win);

View File

@ -314,8 +314,7 @@ ContentRestoreInternal.prototype = {
let {formdata, scrollPositions} = this._restoringDocument;
this._restoringDocument = null;
let window = this.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let window = this.docShell.domWindow;
// Restore form data.
restoreFrameTreeData(window, formdata, (frame, data) => {

View File

@ -150,7 +150,7 @@ var SessionStorageInternal = {
}
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
let window = aDocShell.domWindow;
// There is no need to pass documentURI, it's only used to fill documentURI property of
// domstorage event, which in this case has no consumer. Prevention of events in case
@ -179,7 +179,7 @@ var SessionStorageInternal = {
let hostData = {};
let storage;
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
let window = aDocShell.domWindow;
try {
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);

View File

@ -225,9 +225,7 @@ function onListKeyDown(aEvent) {
// Helper functions
function getBrowserWindow() {
return window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
return window.docShell.rootTreeItem.domWindow;
}
function toggleRowChecked(aIx) {

View File

@ -30,8 +30,7 @@ function loadContentWindow(webNavigation, uri) {
if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
return;
}
let contentWindow = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
let contentWindow = docShell.domWindow;
progressListeners.delete(progressListener);
webProgress.removeProgressListener(progressListener);
contentWindow.addEventListener("load", (event) => {

View File

@ -10,12 +10,6 @@ var EXPORTED_SYMBOLS = [
// Get the chrome (ie, browser) window hosting this content.
function getChromeWindow(window) {
return window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
return window.docShell.rootTreeItem.domWindow
.wrappedJSObject;
}

View File

@ -47,8 +47,7 @@ function addWindowListener(aURL, aCallback) {
info("window opened, waiting for focus");
Services.wm.removeListener(this);
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var domwindow = aXULWindow.docShell.domWindow;
waitForFocus(function() {
is(domwindow.document.location.href, aURL, "should have seen the right window open");
domwindow.close();

View File

@ -89,7 +89,7 @@ class ClickEventHandler {
// Only when the owner doc has |mixedContentChannel| and the same origin
// should we allow mixed content.
json.allowMixedContent = false;
let docshell = ownerDoc.docShell;
let docshell = ownerDoc.defaultView.docShell;
if (this.mm.docShell.mixedContentChannel) {
const sm = Services.scriptSecurityManager;
try {

View File

@ -13,13 +13,14 @@ XPCOMUtils.defineLazyGlobalGetters(this, ["Blob", "FileReader"]);
ChromeUtils.defineModuleGetter(this, "Feeds",
"resource:///modules/Feeds.jsm");
ChromeUtils.defineModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
ChromeUtils.defineModuleGetter(this, "DeferredTask",
"resource://gre/modules/DeferredTask.jsm");
ChromeUtils.defineModuleGetter(this, "PromiseUtils",
"resource://gre/modules/PromiseUtils.jsm");
const BinaryInputStream = Components.Constructor("@mozilla.org/binaryinputstream;1",
"nsIBinaryInputStream", "setInputStream");
const SIZES_TELEMETRY_ENUM = {
NO_SIZES: 0,
ANY: 1,
@ -69,16 +70,15 @@ class FaviconLoad {
this.buffers = [];
this.icon = iconInfo;
this.channel = NetUtil.newChannel({
uri: iconInfo.iconUri,
loadingNode: iconInfo.node,
loadingPrincipal: iconInfo.node.nodePrincipal,
triggeringPrincipal: iconInfo.node.nodePrincipal,
contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON,
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
Ci.nsILoadInfo.SEC_ALLOW_CHROME |
Ci.nsILoadInfo.SEC_DISALLOW_SCRIPT,
});
this.channel = Services.io.newChannelFromURI2(
iconInfo.iconUri,
iconInfo.node,
iconInfo.node.nodePrincipal,
iconInfo.node.nodePrincipal,
(Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
Ci.nsILoadInfo.SEC_ALLOW_CHROME |
Ci.nsILoadInfo.SEC_DISALLOW_SCRIPT),
Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON);
this.channel.loadFlags |= Ci.nsIRequest.LOAD_BACKGROUND;
// Sometimes node is a document and sometimes it is an element. This is
@ -121,8 +121,10 @@ class FaviconLoad {
}
onDataAvailable(request, context, inputStream, offset, count) {
let data = NetUtil.readInputStreamToString(inputStream, count);
this.buffers.push(Uint8Array.from(data, c => c.charCodeAt(0)));
let stream = new BinaryInputStream(inputStream);
let buffer = new ArrayBuffer(count);
stream.readArrayBuffer(buffer.byteLength, buffer);
this.buffers.push(new Uint8Array(buffer));
}
asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {

View File

@ -27,8 +27,8 @@ const BRAND_PROPERTIES = "chrome://branding/locale/brand.properties";
const HTML_NS = "http://www.w3.org/1999/xhtml";
function getTabBrowser(browser) {
while (browser.ownerDocument.docShell.itemType !== Ci.nsIDocShell.typeChrome) {
browser = browser.ownerDocument.docShell.chromeEventHandler;
while (browser.ownerGlobal.docShell.itemType !== Ci.nsIDocShell.typeChrome) {
browser = browser.ownerGlobal.docShell.chromeEventHandler;
}
return {browser, window: browser.ownerGlobal};
}
@ -106,7 +106,7 @@ var ExtensionsUI = {
showAddonsManager(browser, strings, icon, histkey) {
let global = browser.selectedBrowser.ownerGlobal;
return global.BrowserOpenAddonsMgr("addons://list/extension").then(aomWin => {
let aomBrowser = aomWin.document.docShell.chromeEventHandler;
let aomBrowser = aomWin.docShell.chromeEventHandler;
return this.showPermissionsPrompt(aomBrowser, strings, icon, histkey);
});
},

View File

@ -552,7 +552,7 @@ var NetErrorContent = {
Services.prefs.getBoolPref("security.certerror.hideAddException", false);
}
if (this.isAboutNetError(win.document)) {
let docShell = win.document.docShell;
let docShell = win.docShell;
if (docShell) {
let {securityInfo} = docShell.failedChannel;
// We don't have a securityInfo when this is for example a DNS error.
@ -597,7 +597,7 @@ var NetErrorContent = {
// If we're enabling reports, send a report for this failure.
if (evt.detail) {
let win = evt.originalTarget.ownerGlobal;
let docShell = win.document.docShell;
let docShell = win.docShell;
let {securityInfo} = docShell.failedChannel;
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
@ -610,7 +610,7 @@ var NetErrorContent = {
},
onCertError(global, targetElement, win) {
let docShell = win.document.docShell;
let docShell = win.docShell;
global.sendAsyncMessage("Browser:CertExceptionError", {
frameId: WebNavigationFrames.getFrameId(win),
location: win.document.location.href,

View File

@ -8,7 +8,7 @@ var EXPORTED_SYMBOLS = ["PageStyleHandler"];
var PageStyleHandler = {
getViewer(content) {
return content.document.docShell.contentViewer;
return content.docShell.contentViewer;
},
sendStyleSheetInfo(mm) {
@ -50,7 +50,7 @@ var PageStyleHandler = {
return;
}
let mm = win.document.docShell
let mm = win.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
this.sendStyleSheetInfo(mm);

View File

@ -52,8 +52,8 @@ var webProgressListener;
function waitForLoadAndStopIt(expectedURL) {
return new Promise(resolve => {
let webProgress = content.document.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress);
let webProgress = content.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress);
webProgressListener = {
onStateChange(webProg, req, flags, status) {
if (req instanceof Ci.nsIChannel) {

View File

@ -75,10 +75,7 @@ function addWindow(aUrl) {
}
function getChromeWindow(aWindow) {
return aWindow
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
return aWindow.docShell.rootTreeItem.domWindow;
}
// Override addTab/removeTab as defined by shared-head, since these have

View File

@ -519,13 +519,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
}
debugService.activationHandler = function(window) {
const chromeWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow);
const chromeWindow = window.docShell.rootTreeItem.domWindow;
let setupFinished = false;
slowScriptDebugHandler(chromeWindow.gBrowser.selectedTab,

View File

@ -18,7 +18,7 @@ add_task(async function() {
// perform sanity checks for URI and pricnipals in loadInfo
await ContentTask.spawn(tab.linkedBrowser, {TEST_JSON_FILE}, async function ({TEST_JSON_FILE}) { // eslint-disable-line
const channel = content.document.docShell.currentDocumentChannel;
const channel = content.docShell.currentDocumentChannel;
const channelURI = channel.URI.spec;
ok(channelURI.startsWith("file://") && channelURI.includes(TEST_JSON_FILE),
"sanity: correct channel uri");
@ -44,7 +44,7 @@ add_task(async function() {
// check principals in loadInfo are still correct
await ContentTask.spawn(tab.linkedBrowser, {TEST_JSON_FILE}, async function ({TEST_JSON_FILE}) { // eslint-disable-line
const channel = content.document.docShell.currentDocumentChannel;
const channel = content.docShell.currentDocumentChannel;
const channelURI = channel.URI.spec;
ok(channelURI.startsWith("file://") && channelURI.includes(TEST_JSON_FILE),
"reloaded: correct channel uri");

View File

@ -4,19 +4,13 @@
"use strict";
const { Ci } = require("chrome");
const Services = require("Services");
/**
* Returns the `nsIDOMWindow` toplevel window for any child/inner window
*/
function getToplevelWindow(window) {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return window.docShell.rootTreeItem.domWindow;
}
exports.getToplevelWindow = getToplevelWindow;

View File

@ -373,7 +373,7 @@ async function generateCssMessageStubs() {
gBrowser.selectedBrowser,
[key, code],
function([subKey, subCode]) {
content.document.docShell.cssErrorReportingEnabled = true;
content.docShell.cssErrorReportingEnabled = true;
const style = content.document.createElement("style");
// eslint-disable-next-line no-unsanitized/property
style.innerHTML = subCode;

View File

@ -4,7 +4,6 @@
"use strict";
const {Ci} = require("chrome");
const Services = require("Services");
const {Devices} = require("resource://devtools/shared/apps/Devices.jsm");
const {DebuggerServer} = require("devtools/server/main");
@ -391,8 +390,7 @@ WiFiRuntime.prototype = {
let promptWindow;
const windowListener = {
onOpenWindow(xulWindow) {
const win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const win = xulWindow.docShell.domWindow;
win.addEventListener("load", function() {
if (win.document.documentElement.getAttribute("id") != WINDOW_ID) {
return;

View File

@ -183,9 +183,7 @@ CustomizedReload.prototype = {
if (window == this.window) {
this.customizedReloadWindows.add(window);
} else if (subjectDocShell.sameTypeParent) {
const parentWindow = subjectDocShell.sameTypeParent
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const parentWindow = subjectDocShell.sameTypeParent.domWindow;
if (parentWindow && this.customizedReloadWindows.has(parentWindow)) {
this.customizedReloadWindows.add(window);
}

View File

@ -62,8 +62,7 @@ function getDocShellChromeEventHandler(docShell) {
try {
// Toplevel xul window's docshell doesn't have chromeEventHandler
// attribute. The chrome event handler is just the global window object.
handler = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
handler = docShell.domWindow;
} catch (e) {
// ignore
}
@ -80,6 +79,7 @@ function getChildDocShells(parentDocShell) {
const docShells = [];
while (docShellsEnum.hasMoreElements()) {
const docShell = docShellsEnum.getNext();
docShell.QueryInterface(Ci.nsIDocShell);
docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress);
docShells.push(docShell);
@ -345,9 +345,7 @@ const browsingContextTargetPrototype = {
get window() {
// On xpcshell, there is no document
if (this.docShell) {
return this.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return this.docShell.domWindow;
}
return null;
},
@ -381,8 +379,7 @@ const browsingContextTargetPrototype = {
*/
get windows() {
return this.docShells.map(docShell => {
return docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return docShell.domWindow;
});
},
@ -1488,8 +1485,7 @@ DebuggerProgressListener.prototype = {
// Add the docshell to the watched set. We're actually adding the window,
// because docShell objects are not wrappercached and would be rejected
// by the WeakSet.
const docShellWindow = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const docShellWindow = docShell.domWindow;
this._watchedDocShells.add(docShellWindow);
const webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
@ -1511,8 +1507,7 @@ DebuggerProgressListener.prototype = {
},
unwatch(docShell) {
const docShellWindow = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const docShellWindow = docShell.domWindow;
if (!this._watchedDocShells.has(docShellWindow)) {
return;
}
@ -1539,8 +1534,7 @@ DebuggerProgressListener.prototype = {
_getWindowsInDocShell(docShell) {
return getChildDocShells(docShell).map(d => {
return d.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return d.domWindow;
});
},

View File

@ -165,8 +165,7 @@ webExtensionTargetPrototype._createFallbackWindow = function() {
this.fallbackWebNav = Services.appShell.createWindowlessBrowser(true);
// Save the reference to the fallback DOMWindow.
this.fallbackWindow = this.fallbackWebNav.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
this.fallbackWindow = this.fallbackWebNav.document.defaultView;
// Insert the fallback doc message.
this.fallbackWindow.document.body.innerText = FALLBACK_DOC_MESSAGE;
@ -273,11 +272,8 @@ webExtensionTargetPrototype._docShellToWindow = function(docShell) {
// Collect the addonID from the document origin attributes and its sameType top level
// frame.
const addonID = window.document.nodePrincipal.addonId;
const sameTypeRootAddonID = docShell.QueryInterface(Ci.nsIDocShellTreeItem)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.document.nodePrincipal.addonId;
const sameTypeRootAddonID = docShell.sameTypeRootTreeItem.domWindow
.document.nodePrincipal.addonId;
return Object.assign(baseWindowDetails, {
addonID,
@ -304,10 +300,7 @@ webExtensionTargetPrototype.isExtensionWindow = function(window) {
webExtensionTargetPrototype.isExtensionWindowDescendent = function(window) {
// Check if the source is coming from a descendant docShell of an extension window.
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell);
const rootWin = docShell.sameTypeRootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const rootWin = window.docShell.sameTypeRootTreeItem.domWindow;
return this.isExtensionWindow(rootWin);
};

View File

@ -657,8 +657,9 @@ DevToolsUtils.makeInfallible(function(window) {
BrowserTabList.prototype.onCloseWindow =
DevToolsUtils.makeInfallible(function(window) {
window = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
if (window instanceof Ci.nsIXULWindow) {
window = window.docShell.domWindow;
}
if (appShellDOMWindowType(window) !== DebuggerServer.chromeWindowType) {
return;

View File

@ -6,7 +6,6 @@
"use strict";
var { Ci } = require("chrome");
var Services = require("Services");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
loader.lazyRequireGetter(this, "AuthenticationResult",
@ -60,8 +59,7 @@ Client.defaultSendOOB = ({ authResult, oob }) => {
let promptWindow;
const windowListener = {
onOpenWindow(xulWindow) {
const win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
const win = xulWindow.docShell.domWindow;
win.addEventListener("load", function() {
if (win.document.documentElement.getAttribute("id") != "commonDialog") {
return;

View File

@ -12,7 +12,7 @@
<p>Test for cached messages</p>
<script class="testbody" type="application/javascript">
document.docShell.cssErrorReportingEnabled = true;
window.docShell.cssErrorReportingEnabled = true;
var ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
.getService(Ci.nsIConsoleAPIStorage);
let expectedConsoleCalls = [];

View File

@ -3963,6 +3963,19 @@ nsDocShell::GetWindow()
return mScriptGlobal->AsOuter();
}
NS_IMETHODIMP
nsDocShell::GetDomWindow(mozIDOMWindowProxy** aWindow)
{
NS_ENSURE_ARG_POINTER(aWindow);
nsresult rv = EnsureScriptEnvironment();
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsPIDOMWindowOuter> window = mScriptGlobal->AsOuter();
window.forget(aWindow);
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetDeviceSizeIsPageSize(bool aValue)
{

View File

@ -6,11 +6,11 @@
#include "nsISupports.idl"
interface mozIDOMWindowProxy;
interface nsIDocShellTreeOwner;
interface nsIDocument;
interface nsPIDOMWindowOuter;
/**
* The nsIDocShellTreeItem supplies the methods that are required of any item
* that wishes to be able to live within the docshell tree either as a middle
@ -179,6 +179,11 @@ interface nsIDocShellTreeItem : nsISupports
in nsIDocShellTreeItem aRequestor,
in nsIDocShellTreeItem aOriginalRequestor);
/**
* Returns the DOM outer window for the content viewer.
*/
readonly attribute mozIDOMWindowProxy domWindow;
[noscript,nostdcall,notxpcom] nsIDocument getDocument();
[noscript,nostdcall,notxpcom] nsPIDOMWindowOuter getWindow();
};

View File

@ -71,7 +71,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1342989
var webNav = Cc["@mozilla.org/appshell/appShellService;1"].
getService(Ci.nsIAppShellService).createWindowlessBrowser(true);
var docShell = webNav.QueryInterface(Ci.nsIInterfaceRequestor).
let docShell = webNav.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDocShell);
docShell.createAboutBlankContentViewer(
Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal));

View File

@ -18,12 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=829383
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var mainWindow = window.docShell.rootTreeItem.domWindow;
// We need to wait for the hidden window to load, but can't access
// an event target for a regular event listener.

View File

@ -8,7 +8,7 @@
function checkResults() {
// query the uri of the loadingPrincipal and the TriggeringPrincipal and pass
// that information on to the parent for verification.
var channel = SpecialPowers.wrap(document).docShell.currentDocumentChannel;
var channel = SpecialPowers.wrap(window).docShell.currentDocumentChannel;
var triggeringPrincipalURI = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
var loadingPrincipalURI = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
var referrerURI = document.referrer;

View File

@ -51,7 +51,7 @@ var frameA = document.getElementById("framea");
function checkResults() {
frameA.removeEventListener('load', checkResults);
var channel = SpecialPowers.wrap(frameA.contentDocument).docShell.currentDocumentChannel;
var channel = SpecialPowers.wrap(frameA.contentWindow).docShell.currentDocumentChannel;
var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;

View File

@ -37,7 +37,7 @@ var testframe = document.getElementById("testframe");
function checkResults() {
testframe.removeEventListener('load', checkResults);
var channel = SpecialPowers.wrap(testframe.contentDocument).docShell.currentDocumentChannel;
var channel = SpecialPowers.wrap(testframe.contentWindow).docShell.currentDocumentChannel;
var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;

View File

@ -35,7 +35,7 @@ function checkFinish() {
// Test 1: window.open(http:)
var httpWin = window.open("file_triggeringprincipal_window_open.html", "_blank", "width=10,height=10");
httpWin.onload = function() {
var httpChannel = SpecialPowers.wrap(httpWin.document).docShell.currentDocumentChannel;
var httpChannel = SpecialPowers.wrap(httpWin).docShell.currentDocumentChannel;
var httpTriggeringPrincipal = httpChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
var httpLoadingPrincipal = httpChannel.loadInfo.loadingPrincipal;
@ -56,7 +56,7 @@ httpWin.onload = function() {
// Test 2: window.open(javascript:)
var jsWin = window.open("javascript:'<html><body>js</body></html>';", "_blank", "width=10,height=10");
jsWin.onload = function() {
var jsChannel = SpecialPowers.wrap(jsWin.document).docShell.currentDocumentChannel;
var jsChannel = SpecialPowers.wrap(jsWin).docShell.currentDocumentChannel;
var jsTriggeringPrincipal = jsChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
var jsLoadingPrincipal = jsChannel.loadInfo.loadingPrincipal;

View File

@ -8,7 +8,7 @@
<script type="text/javascript">
var channel = SpecialPowers.wrap(document).docShell.currentDocumentChannel;
var channel = SpecialPowers.wrap(window).docShell.currentDocumentChannel;
var loadInfo = channel.loadInfo;
// 1) perform some sanity checks

View File

@ -10005,30 +10005,6 @@ nsIDocument::IsScrollingElement(Element* aElement)
return !IsPotentiallyScrollable(strongBody);
}
void
nsIDocument::ObsoleteSheet(nsIURI *aSheetURI, ErrorResult& rv)
{
nsresult res = CSSLoader()->ObsoleteSheet(aSheetURI);
if (NS_FAILED(res)) {
rv.Throw(res);
}
}
void
nsIDocument::ObsoleteSheet(const nsAString& aSheetURI, ErrorResult& rv)
{
nsCOMPtr<nsIURI> uri;
nsresult res = NS_NewURI(getter_AddRefs(uri), aSheetURI);
if (NS_FAILED(res)) {
rv.Throw(res);
return;
}
res = CSSLoader()->ObsoleteSheet(uri);
if (NS_FAILED(res)) {
rv.Throw(res);
}
}
class UnblockParsingPromiseHandler final : public PromiseNativeHandler
{
public:

View File

@ -3324,10 +3324,6 @@ public:
return mStyleSheetChangeEventsEnabled;
}
void ObsoleteSheet(nsIURI *aSheetURI, mozilla::ErrorResult& rv);
void ObsoleteSheet(const nsAString& aSheetURI, mozilla::ErrorResult& rv);
already_AddRefed<mozilla::dom::Promise> BlockParsing(mozilla::dom::Promise& aPromise,
const mozilla::dom::BlockParsingOptions& aOptions,
mozilla::ErrorResult& aRv);

View File

@ -247,7 +247,7 @@
// as an XPCOM interface. But elements are losing all their XPCOM
// interfaces, so let's use an object that will likely stay an XPCOM
// one.
let docshell = savedElement.ownerDocument.docShell;
let docshell = savedElement.ownerGlobal.docShell;
ok(docshell, "We should have a docshell here!");
let secureUI = Cc['@mozilla.org/secure_browser_ui;1']

View File

@ -141,7 +141,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var localmm = document.getElementById('ifr').messageManager;
var wn = document.getElementById('ifr').contentWindow
.getInterface(Ci.nsIWebNavigation);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor);
ok(wn, "Should have webnavigation");
var cfmm = wn.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIContentFrameMessageManager);
ok(cfmm, "Should have content messageManager");

View File

@ -635,7 +635,6 @@ skip-if = toolkit == 'android' #bug 904183
subsuite = clipboard
skip-if = toolkit == 'android' #bug 904183
[test_createHTMLDocument.html]
[test_declare_stylesheet_obsolete.html]
[test_data_uri.html]
skip-if = verify
[test_document.all_iteration.html]

View File

@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=513194
// The use of document.write is deliberate. We are testing for the
// HTML parser to call the CSS parser once and only once when it
// encounters a new <style> element.
SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
SpecialPowers.wrap(window).docShell.cssErrorReportingEnabled = true;
SimpleTest.runTestExpectingConsoleMessages(
function () { document.write("<style>qux { foo : bar; }<\/style>") },
[{ errorMessage: /Unknown property/ }]

View File

@ -1,94 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=713564
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 713564</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<!-- Load the variable stylesheet, which changes the color of #content. -->
<link rel="stylesheet" type="text/css" href="variable_style_sheet.sjs"/>
<script type="application/javascript">
function insertLinkToVarSSAndRun(callback) {
var ss = document.createElement("link");
ss.rel = "stylesheet";
ss.type = "text/css";
ss.href = "variable_style_sheet.sjs";
document.getElementsByTagName("head")[0].appendChild(ss);
ss.addEventListener("load", callback);
}
/** Test for Bug 713564 **/
// Then you link to that sheet, remove the link from the DOM, insert a new link to
// the same url and check that there was no new access, then call our new method,
// insert _another_ <link> to the same url, and check that this time we hit the
// server.
SimpleTest.waitForExplicitFinish();
function do_test() {
var var_sheet = document.getElementsByTagName("link")[1];
var head = document.getElementsByTagName("head")[0];
var content = document.getElementById("content");
var var_sheet_url = var_sheet.href;
var previousBgColor = window.getComputedStyle(content).
getPropertyValue("background-color");
var_sheet.remove();
insertLinkToVarSSAndRun(function() {
is(window.getComputedStyle(content).getPropertyValue("background-color"),
previousBgColor,
"Sheet should still be the same.");
// Obsolete sheet
try {
SpecialPowers.wrap(document).obsoleteSheet(var_sheet_url);
} catch (e) {
ok(false, "obsoleteSheet should not raise an error on valid URL.");
}
insertLinkToVarSSAndRun(function() {
isnot(window.getComputedStyle(content).getPropertyValue("background-color"),
previousBgColor,
"Sheet should change after obsoleted and reinserted.");
SimpleTest.finish();
});
});
// obsoleteSheet should throw with invalid input:
try {
SpecialPowers.wrap(document).obsoleteSheet("");
ok(false, "obsoleteSheet should throw with empty string.");
} catch (e) {
ok(true, "obsoleteSheet throws with empty string.");
}
try {
SpecialPowers.wrap(document).obsoleteSheet("foo");
ok(false, "obsoleteSheet should throw with invalid URL.");
} catch (e) {
ok(true, "obsoleteSheet throws with invalid URL.");
}
try {
SpecialPowers.wrap(document).obsoleteSheet("http://www.mozilla.org");
ok(true, "obsoleteSheet should not throw with valid URL.");
} catch (e) {
ok(false, "obsoleteSheet throws with valid URL.");
}
}
</script>
</head>
<body onload="do_test();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=713564">Mozilla Bug 713564</a>
<p id="display"></p>
<div id="content">
<br>
<br>
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -38,7 +38,7 @@ function frameScript() {
doc.addEventListener("keypress", keyHandler, true);
function waitUntilActive() {
if (doc.docShell.isActive && doc.hasFocus()) {
if (docShell.isActive && doc.hasFocus()) {
sendAsyncMessage("Test:Activated");
} else {
setTimeout(waitUntilActive, 10);

View File

@ -13,8 +13,7 @@ function frameScript() {
!!content.document.fullscreenElement);
});
function waitUntilActive() {
let doc = content.document;
if (doc.docShell.isActive && doc.hasFocus()) {
if (docShell.isActive && content.document.hasFocus()) {
sendAsyncMessage("Test:Activated");
} else {
setTimeout(waitUntilActive, 10);

View File

@ -59,6 +59,7 @@ struct AudioIpcInitParams {
int mServerConnection;
size_t mPoolSize;
size_t mStackSize;
void (*mThreadCreateCallback)(const char*);
};
// These functions are provided by audioipc-server crate
@ -430,6 +431,9 @@ cubeb* GetCubebContextUnlocked()
initParams.mPoolSize = sAudioIPCPoolSize;
initParams.mStackSize = sAudioIPCStackSize;
initParams.mServerConnection = sIPCConnection->ClonePlatformHandle().release();
initParams.mThreadCreateCallback = [](const char* aName) {
PROFILER_REGISTER_THREAD(aName);
};
MOZ_LOG(gCubebLog, LogLevel::Debug, ("%s: %d", PREF_AUDIOIPC_POOL_SIZE, (int) initParams.mPoolSize));
MOZ_LOG(gCubebLog, LogLevel::Debug, ("%s: %d", PREF_AUDIOIPC_STACK_SIZE, (int) initParams.mStackSize));

View File

@ -51,12 +51,7 @@ 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.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var mainWindow = window.docShell.rootTreeItem.domWindow;
var contentPage = getRootDirectory(window.location.href) + "privatemode_perwindowpb.xul";
function testOnWindow(aIsPrivate, aCallback) {

View File

@ -9,8 +9,7 @@ function addWindowListener(aURL, aCallback) {
onOpenWindow(aXULWindow) {
info("window opened, waiting for focus");
Services.wm.removeListener(this);
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var domwindow = aXULWindow.docShell.domWindow;
waitForFocus(function() {
is(domwindow.document.location.href, aURL, "should have seen the right window open");
aCallback(domwindow);

View File

@ -9,8 +9,7 @@ function addWindowListener(aURL, aCallback) {
onOpenWindow(aXULWindow) {
info("window opened, waiting for focus");
Services.wm.removeListener(this);
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var domwindow = aXULWindow.docShell.domWindow;
waitForFocus(function() {
is(domwindow.document.location.href, aURL, "should have seen the right window open");
aCallback(domwindow);

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<script>
var securityInfoPresent = !!SpecialPowers.wrap(document).docShell.currentDocumentChannel.securityInfo;
var securityInfoPresent = !!SpecialPowers.wrap(window).docShell.currentDocumentChannel.securityInfo;
window.parent.postMessage({status: "protocol",
data: location.protocol,
securityInfoPresent: securityInfoPresent},

View File

@ -34,12 +34,7 @@ function testOnWindow(aIsPrivate, aCallback) {
}
function setupWindow() {
mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
mainWindow = window.docShell.rootTreeItem.domWindow;
runTest();
}

View File

@ -35,12 +35,7 @@ function whenDelayedStartupFinished(aWindow, aCallback) {
}
function testOnWindow(options, callback) {
var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var mainWindow = window.docShell.rootTreeItem.domWindow;
var win = mainWindow.OpenBrowserWindow(options);
windowsToClose.push(win);

View File

@ -274,11 +274,7 @@ function checkSelection(node, testid)
function getTopWindow(win)
{
return win.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindow);
return win.docShell.rootTreeItem.domWindow;
}
function mouseWillTriggerFocus(element)

View File

@ -15,12 +15,7 @@ prefBranch.setIntPref("browser.startup.page", 0);
prefBranch.setCharPref("browser.startup.homepage_override.mstone", "ignore");
function startTest() {
mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
mainWindow = window.docShell.rootTreeItem.domWindow;
doTest();
}

View File

@ -161,12 +161,7 @@ function whenDelayedStartupFinished(aCallback) {
}
function testOnWindow(aIsPrivate, callback) {
var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var mainWindow = window.docShell.rootTreeItem.domWindow;
mainWindow.openWebLinkIn(CONTENT_PAGE, "window", {
private: aIsPrivate });

View File

@ -20,8 +20,7 @@ function test () {
finish();
}
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var domwindow = aXULWindow.docShell.domWindow;
domwindow.addEventListener("load", downloadOnLoad, true);
},
onCloseWindow: function(aXULWindow) {},

View File

@ -383,13 +383,6 @@ partial interface Document {
[ChromeOnly]
attribute boolean styleSheetChangeEventsEnabled;
[ChromeOnly, Throws]
void obsoleteSheet(URI sheetURI);
[ChromeOnly, Throws]
void obsoleteSheet(DOMString sheetURI);
[ChromeOnly] readonly attribute nsIDocShell? docShell;
[ChromeOnly] readonly attribute DOMString contentLanguage;
[ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;

View File

@ -255,6 +255,8 @@ partial interface Window {
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
[ChromeOnly] readonly attribute nsIDocShell? docShell;
[Throws, NeedsCallerType]
readonly attribute float mozInnerScreenX;
[Throws, NeedsCallerType]

View File

@ -32,12 +32,7 @@ function testOnWindow(aIsPrivate, aCallback) {
}
function setupWindow() {
mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
mainWindow = window.docShell.rootTreeItem.domWindow;
runTest();
}

View File

@ -43,13 +43,8 @@ var onSpellCheck =
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
script = SpecialPowers.loadChromeScript(function() {
var chromeWin = browserElement.ownerDocument.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
var chromeWin = browserElement.ownerGlobal.docShell
.rootTreeItem.domWindow
.QueryInterface(Ci.nsIDOMChromeWindow);
var contextMenu = chromeWin.document.getElementById("contentAreaContextMenu");
contextMenu.addEventListener("popupshown",

View File

@ -53,12 +53,7 @@ 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).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(SpecialPowers.Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindow);
var chromewin = SpecialPowers.wrap(win).docShell.rootTreeItem.domWindow;
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
el.width = chromewin.innerWidth;

View File

@ -26,6 +26,8 @@
#include <pthread_np.h>
#endif
#include "nsThreadUtils.h"
#if defined(OS_MACOSX)
namespace base {
void InitThreading();
@ -33,6 +35,10 @@ void InitThreading();
#endif
static void* ThreadFunc(void* closure) {
// Create a nsThread wrapper for the current platform thread, and register it
// with the thread manager.
(void) NS_GetCurrentThread();
PlatformThread::Delegate* delegate =
static_cast<PlatformThread::Delegate*>(closure);
delegate->ThreadMain();
@ -92,21 +98,10 @@ void PlatformThread::SetName(const char* name) {
if (PlatformThread::CurrentId() == getpid())
return;
// http://0pointer.de/blog/projects/name-your-threads.html
// Set the name for the LWP (which gets truncated to 15 characters).
// Note that glibc also has a 'pthread_setname_np' api, but it may not be
// available everywhere and it's only benefit over using prctl directly is
// that it can set the name of threads other than the current thread.
#if defined(OS_LINUX)
prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
#elif defined(OS_NETBSD)
pthread_setname_np(pthread_self(), "%s", (void *)name);
#elif defined(OS_BSD) && !defined(__GLIBC__)
pthread_set_name_np(pthread_self(), name);
#elif defined(OS_SOLARIS)
pthread_setname_np(pthread_self(), name);
#else
#endif
// Using NS_SetCurrentThreadName, as opposed to using platform APIs directly,
// also sets the thread name on the PRThread wrapper, and allows us to
// retrieve it using PR_GetThreadName.
NS_SetCurrentThreadName(name);
}
#endif // !OS_MACOSX
@ -129,8 +124,9 @@ bool CreateThread(size_t stack_size, bool joinable,
pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);
}
if (stack_size > 0)
pthread_attr_setstacksize(&attributes, stack_size);
if (stack_size == 0)
stack_size = nsIThreadManager::DEFAULT_STACK_SIZE;
pthread_attr_setstacksize(&attributes, stack_size);
success = !pthread_create(thread_handle, &attributes, ThreadFunc, delegate);

View File

@ -9,6 +9,8 @@
#include "base/logging.h"
#include "base/win_util.h"
#include "nsThreadUtils.h"
namespace {
// The information on how to set the thread name comes from
@ -23,6 +25,10 @@ typedef struct tagTHREADNAME_INFO {
} THREADNAME_INFO;
DWORD __stdcall ThreadFunc(void* closure) {
// Create a nsThread wrapper for the current platform thread, and register it
// with the thread manager.
(void) NS_GetCurrentThread();
PlatformThread::Delegate* delegate =
static_cast<PlatformThread::Delegate*>(closure);
delegate->ThreadMain();
@ -48,24 +54,10 @@ void PlatformThread::Sleep(int duration_ms) {
// static
void PlatformThread::SetName(const char* name) {
#ifdef HAVE_SEH_EXCEPTIONS
// The debugger needs to be around to catch the name in the exception. If
// there isn't a debugger, we are just needlessly throwing an exception.
if (!::IsDebuggerPresent())
return;
THREADNAME_INFO info;
info.dwType = 0x1000;
info.szName = name;
info.dwThreadID = CurrentId();
info.dwFlags = 0;
MOZ_SEH_TRY {
RaiseException(kVCThreadNameException, 0, sizeof(info)/sizeof(DWORD),
reinterpret_cast<DWORD_PTR*>(&info));
} MOZ_SEH_EXCEPT(EXCEPTION_CONTINUE_EXECUTION) {
}
#endif
// Using NS_SetCurrentThreadName, as opposed to using platform APIs directly,
// also sets the thread name on the PRThread wrapper, and allows us to
// retrieve it using PR_GetThreadName.
NS_SetCurrentThreadName(name);
}
// static

View File

@ -943,7 +943,12 @@ js::CurrentThreadIsParseThread()
}
#endif
static const uint32_t kDefaultHelperStackSize = 2048 * 1024;
// We want our default stack size limit to be approximately 2MB, to be safe, but
// expect most threads to use much less. On Linux, however, requesting a stack
// of 2MB or larger risks the kernel allocating an entire 2MB huge page for it
// on first access, which we do not want. To avoid this possibility, we subtract
// 2 standard VM page sizes from our default.
static const uint32_t kDefaultHelperStackSize = 2048 * 1024 - 2 * 4096;
static const uint32_t kDefaultHelperStackQuota = 1800 * 1024;
// TSan enforces a minimum stack size that's just slightly larger than our

View File

@ -79,6 +79,10 @@ using namespace xpc;
using namespace JS;
using mozilla::dom::AutoEntryScript;
// The watchdog thread loop is pretty trivial, and should not require much stack
// space to do its job. So only give it 32KiB.
static constexpr size_t kWatchdogStackSize = 32 * 1024;
static void WatchdogMain(void* arg);
class Watchdog;
class WatchdogManager;
@ -143,7 +147,7 @@ class Watchdog
// join it on shutdown.
mThread = PR_CreateThread(PR_USER_THREAD, WatchdogMain, this,
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
PR_JOINABLE_THREAD, 0);
PR_JOINABLE_THREAD, kWatchdogStackSize);
if (!mThread)
MOZ_CRASH("PR_CreateThread failed!");
@ -472,6 +476,8 @@ static void
WatchdogMain(void* arg)
{
AUTO_PROFILER_REGISTER_THREAD("JS Watchdog");
// Create an nsThread wrapper for the thread and register it with the thread manager.
Unused << NS_GetCurrentThread();
NS_SetCurrentThreadName("JS Watchdog");
Watchdog* self = static_cast<Watchdog*>(arg);

View File

@ -12,7 +12,7 @@ add_task(async function() {
docShell.createAboutBlankContentViewer(null);
let window = webnav.getInterface(Ci.nsIDOMWindow);
let window = webnav.document.defaultView;
let unwrapped = Cu.waiveXrays(window);
window.document.body.innerHTML = '<div id="foo"></div>';

View File

@ -17,7 +17,7 @@ var todo = window.opener.wrappedJSObject.todo;
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
var gWbp;
function printpreview() {
gWbp = window.frames[1].document.docShell.printPreview;
gWbp = window.frames[1].docShell.printPreview;
var listener = {
onLocationChange: function(webProgress, request, location, flags) { },
onProgressChange: function(webProgress, request, curSelfProgress,
@ -43,7 +43,7 @@ function printpreview() {
}
function exitprintpreview() {
window.frames[1].document.docShell.printPreview.exitPrintPreview();
window.frames[1].docShell.printPreview.exitPrintPreview();
}
function finish() {
@ -89,7 +89,7 @@ function run2() {
}
function run3() {
gWbp = window.frames[1].document.docShell.printPreview;
gWbp = window.frames[1].docShell.printPreview;
ok(gWbp.doingPrintPreview, "Should be doing print preview");
exitprintpreview();
setTimeout(run4, 0);
@ -108,7 +108,7 @@ function run4() {
}
function run5() {
gWbp = window.frames[0].document.docShell.printPreview;
gWbp = window.frames[0].docShell.printPreview;
ok(!gWbp.doingPrintPreview, "Should not be doing print preview anymore2");
//XXX this shouldn't be necessary, see bug 405555

View File

@ -17,7 +17,7 @@ var todo = window.opener.wrappedJSObject.todo;
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
var gWbp;
function printpreview() {
gWbp = window.frames[1].document.docShell.printPreview;
gWbp = window.frames[1].docShell.printPreview;
var listener = {
onLocationChange: function(webProgress, request, location, flags) { },
onProgressChange: function(webProgress, request, curSelfProgress,
@ -43,7 +43,7 @@ function printpreview() {
}
function exitprintpreview() {
window.frames[1].document.docShell.printPreview.exitPrintPreview();
window.frames[1].docShell.printPreview.exitPrintPreview();
}
function finish() {

View File

@ -24,7 +24,7 @@ var file = Cc["@mozilla.org/file/directory_service;1"]
filePath = file.path;
function printpreview() {
gWbp = window.frames[1].document.docShell.printPreview;
gWbp = window.frames[1].docShell.printPreview;
var listener = {
onLocationChange: function(webProgress, request, location, flags) { },
onProgressChange: function(webProgress, request, curSelfProgress,
@ -60,7 +60,7 @@ function printpreview() {
}
function exitprintpreview() {
window.frames[1].document.docShell.printPreview.exitPrintPreview();
window.frames[1].docShell.printPreview.exitPrintPreview();
}
function finish() {

View File

@ -60,7 +60,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420499
SimpleTest.waitForExplicitFinish();
function getSelectionController() {
return document.docShell
return window.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISelectionDisplay)
.QueryInterface(Ci.nsISelectionController);

View File

@ -129,11 +129,7 @@ function endTest() {
SimpleTest.finish();
}
var mainWindow =
window.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShellTreeItem).
rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindow);
var mainWindow = window.docShell.rootTreeItem.domWindow;
var contentPage = "http://mochi.test:8888/chrome/layout/forms/test/bug536567_iframe.html";
function whenDelayedStartupFinished(aWindow, aCallback) {

View File

@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>prefers-reduced-motion</title>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
}
@media (prefers-reduced-motion: no-preference) {
div { background-color: green; }
}
@media (prefers-reduced-motion) {
div { background-color: green; }
}
</style>
<div></div>

View File

@ -21,3 +21,4 @@ test-pref(ui.prefersReducedMotion,1) == mq_prefers_reduced_motion_no_preference.
test-pref(ui.prefersReducedMotion,0) == mq_prefers_reduced_motion_reduce.html about:blank
test-pref(ui.prefersReducedMotion,1) == mq_prefers_reduced_motion_reduce.html greenbox.html
test-pref(privacy.resistFingerprinting,true) test-pref(ui.prefersReducedMotion,1) == mq_prefers_reduced_motion_reduce.html about:blank
test-pref(privacy.resistFingerprinting,true) == mq_prefers_reduced_motion_both.html greenbox.html

View File

@ -852,26 +852,6 @@ Loader::IsAlternateSheet(const nsAString& aTitle, bool aHasAlternateRel)
return IsAlternate::Yes;
}
nsresult
Loader::ObsoleteSheet(nsIURI* aURI)
{
if (!mSheets) {
return NS_OK;
}
if (!aURI) {
return NS_ERROR_INVALID_ARG;
}
for (auto iter = mSheets->mCompleteSheets.Iter(); !iter.Done(); iter.Next()) {
nsIURI* sheetURI = iter.Key()->GetURI();
bool areEqual;
nsresult rv = sheetURI->Equals(aURI, &areEqual);
if (NS_SUCCEEDED(rv) && areEqual) {
iter.Remove();
}
}
return NS_OK;
}
nsresult
Loader::CheckContentPolicy(nsIPrincipal* aLoadingPrincipal,
nsIPrincipal* aTriggeringPrincipal,

View File

@ -443,10 +443,6 @@ public:
// Measure our size.
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
// Marks all the sheets at the given URI obsolete, and removes them from the
// cache.
nsresult ObsoleteSheet(nsIURI* aURI);
private:
friend class SheetLoadData;
friend class StreamLoader;

View File

@ -129,13 +129,14 @@ enum class StyleAppearance : uint8_t {
// A scrollbar button (up/down/left/right).
// Keep these in order (some code casts these values to `int` in order to
// compare them against each other).
ScrollbarbuttonUp,
ScrollbarbuttonDown,
ScrollbarbuttonLeft,
ScrollbarbuttonRight,
ScrollbarbuttonUp,
// The scrollbar thumb.
ScrollbarthumbHorizontal,
ScrollbarthumbVertical,
// The scrollbar track.
ScrollbartrackHorizontal,
ScrollbartrackVertical,
// The scroll corner

View File

@ -520,31 +520,23 @@ GetIsGlyph(nsIDocument* aDocument, const nsMediaFeature* aFeature,
aResult.SetIntValue(aDocument->IsSVGGlyphsDocument() ? 1 : 0, eCSSUnit_Integer);
}
static bool
PrefersReducedMotion(nsIDocument* aDocument)
{
if (nsContentUtils::ShouldResistFingerprinting(aDocument)) {
return false;
}
return LookAndFeel::GetInt(LookAndFeel::eIntID_PrefersReducedMotion, 0) == 1;
}
static void
GetPrefersReducedMotion(nsIDocument* aDocument,
const nsMediaFeature* aFeature,
const nsMediaFeature*,
nsCSSValue& aResult)
{
const bool isAccessibleFromContentPages =
!(aFeature->mReqFlags & nsMediaFeature::eUserAgentAndChromeOnly);
if (isAccessibleFromContentPages &&
nsContentUtils::ShouldResistFingerprinting(aDocument)) {
return;
}
StylePrefersReducedMotion prefersReducedMotion =
StylePrefersReducedMotion::NoPreference;
switch (LookAndFeel::GetInt(LookAndFeel::eIntID_PrefersReducedMotion, 0)) {
case 0:
prefersReducedMotion = StylePrefersReducedMotion::NoPreference;
break;
case 1:
prefersReducedMotion = StylePrefersReducedMotion::Reduce;
break;
default:
return;
}
auto prefersReducedMotion = PrefersReducedMotion(aDocument)
? StylePrefersReducedMotion::Reduce
: StylePrefersReducedMotion::NoPreference;
aResult.SetEnumValue(prefersReducedMotion);
}

View File

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=413958
Style attr: <span id="setStyle">4</span>.
Properties: <span id="setStyleProp" style="">5</span>.</p>
<script>
SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
SpecialPowers.wrap(window).docShell.cssErrorReportingEnabled = true;
var tests = [
function() {

View File

@ -9,7 +9,7 @@
<body>
<style id="testbench"></style>
<script>
SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
SpecialPowers.wrap(window).docShell.cssErrorReportingEnabled = true;
var tests = [
{ css: "@unknown {}", error: "Unrecognized at-rule or error parsing at-rule @unknown." },

View File

@ -18,7 +18,7 @@
// That's not the point of the test, though; the point is only that
// *that text* is properly escaped.
SpecialPowers.wrap(document).docShell.cssErrorReportingEnabled = true;
SpecialPowers.wrap(window).docShell.cssErrorReportingEnabled = true;
// There is one "pattern" for each code path through the error reporter
// that might need to escape some kind of user-supplied text.

View File

@ -18,10 +18,10 @@ function processTerminated() {
}
var WindowListener = {
onOpenWindow: function(win) {
onOpenWindow: function(xulWin) {
Services.wm.removeListener(WindowListener);
win = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
let win = xulWin.docShell.domWindow;
win.addEventListener("load", function listener() {
// Load into any existing windows.
let windows = Services.wm.getEnumerator("navigator:browser");

View File

@ -527,7 +527,7 @@ sandbox.compareRetainedDisplayLists = g.compareRetainedDisplayLists;
sandbox.browserIsRemote = g.browserIsRemote;
try {
sandbox.asyncPan = g.containingWindow.document.docShell.asyncPanZoomEnabled;
sandbox.asyncPan = g.containingWindow.docShell.asyncPanZoomEnabled;
} catch (e) {
sandbox.asyncPan = false;
}

View File

@ -20,6 +20,7 @@ use std::os::raw::c_void;
use std::os::unix::io::FromRawFd;
use std::os::unix::net;
use std::sync::mpsc;
use std::thread;
use stream;
use tokio_core::reactor::{Handle, Remote};
use tokio_uds::UnixStream;
@ -99,9 +100,25 @@ impl ContextOps for ClientContext {
let (tx_rpc, rx_rpc) = mpsc::channel();
let params = CPUPOOL_INIT_PARAMS.with(|p| {
p.replace(None).unwrap()
});
let thread_create_callback = params.thread_create_callback;
let register_thread = move || {
if let Some(func) = thread_create_callback {
let thr = thread::current();
let name = CString::new(thr.name().unwrap()).unwrap();
func(name.as_ptr());
}
};
let core = t!(core::spawn_thread("AudioIPC Client RPC", move || {
let handle = core::handle();
register_thread();
open_server_stream()
.ok()
.and_then(|stream| UnixStream::from_stream(stream, &handle).ok())
@ -116,14 +133,12 @@ impl ContextOps for ClientContext {
let rpc = t!(rx_rpc.recv());
let cpupool = CPUPOOL_INIT_PARAMS.with(|p| {
let params = p.replace(None).unwrap();
futures_cpupool::Builder::new()
let cpupool = futures_cpupool::Builder::new()
.name_prefix("AudioIPC")
.after_start(register_thread)
.pool_size(params.pool_size)
.stack_size(params.stack_size)
.create()
});
.create();
let ctx = Box::new(ClientContext {
_ops: &CLIENT_OPS as *const _,

View File

@ -37,12 +37,14 @@ pub struct AudioIpcInitParams {
pub server_connection: c_int,
pub pool_size: usize,
pub stack_size: usize,
pub thread_create_callback: Option<extern "C" fn(*const ::std::os::raw::c_char)>,
}
#[derive(Clone, Copy, Debug)]
struct CpuPoolInitParams {
pub pool_size: usize,
pub stack_size: usize,
pub thread_create_callback: Option<extern "C" fn(*const ::std::os::raw::c_char)>,
}
impl CpuPoolInitParams {
@ -50,6 +52,7 @@ impl CpuPoolInitParams {
CpuPoolInitParams {
pool_size: params.pool_size,
stack_size: params.stack_size,
thread_create_callback: params.thread_create_callback,
}
}
}

View File

@ -304,13 +304,7 @@ document.addEventListener("DOMContentLoaded", function() {
// messageManager of that <browser> element, or null.
function getBrowserMessageManager() {
let browser = window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow)
.docShell.rootTreeItem.domWindow
.BrowserApp
.getBrowserForDocument(document);
if (browser) {

View File

@ -16,12 +16,7 @@ const UPDATE_INDICATOR = "chrome://browser/skin/images/extension-update.svg";
var gStringBundle = Services.strings.createBundle("chrome://browser/locale/aboutAddons.properties");
XPCOMUtils.defineLazyGetter(window, "gChromeWin", function() {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
return window.docShell.rootTreeItem.domWindow
.QueryInterface(Ci.nsIDOMChromeWindow);
});
ChromeUtils.defineModuleGetter(window, "Preferences",

View File

@ -8,12 +8,7 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyGetter(window, "gChromeWin", () =>
window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
window.docShell.rootTreeItem.domWindow
.QueryInterface(Ci.nsIDOMChromeWindow));
ChromeUtils.defineModuleGetter(this, "EventDispatcher",

View File

@ -9,12 +9,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyGetter(window, "gChromeWin", () =>
window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
window.docShell.rootTreeItem.domWindow
.QueryInterface(Ci.nsIDOMChromeWindow));
document.addEventListener("DOMContentLoaded", function() {

Some files were not shown because too many files have changed in this diff Show More