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

This commit is contained in:
Noemi Erli 2018-08-02 12:03:09 +03:00
Родитель 2807285aac 8f66a71e70
Коммит 048f87627e
330 изменённых файлов: 1540 добавлений и 2692 удалений

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

@ -712,9 +712,7 @@ function relationTypeToString(aRelationType) {
} }
function getLoadContext() { function getLoadContext() {
return window.QueryInterface(Ci.nsIInterfaceRequestor) return window.docShell.QueryInterface(Ci.nsILoadContext);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
} }
/** /**

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

@ -59,10 +59,7 @@ function testOffsetAtPoint(aHyperTextID, aX, aY, aCoordType, aExpectedOffset) {
* Zoom the given document. * Zoom the given document.
*/ */
function zoomDocument(aDocument, aZoom) { function zoomDocument(aDocument, aZoom) {
var docShell = aDocument.defaultView. var docShell = aDocument.defaultView.docShell;
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShell);
var docViewer = docShell.contentViewer; var docViewer = docShell.contentViewer;
docViewer.fullZoom = aZoom; docViewer.fullZoom = aZoom;

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

@ -237,8 +237,7 @@ var gLastValidURLStr = "";
var gInPrintPreviewMode = false; var gInPrintPreviewMode = false;
var gContextMenu = null; // nsContextMenu instance var gContextMenu = null; // nsContextMenu instance
var gMultiProcessBrowser = var gMultiProcessBrowser =
window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext) .QueryInterface(Ci.nsILoadContext)
.useRemoteTabs; .useRemoteTabs;
@ -1238,9 +1237,7 @@ var gBrowserInit = {
delete window._gBrowser; delete window._gBrowser;
gBrowser.init(); gBrowser.init();
window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell.treeOwner
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIXULWindow)
.XULBrowserWindow = window.XULBrowserWindow; .XULBrowserWindow = window.XULBrowserWindow;
@ -1323,9 +1320,7 @@ var gBrowserInit = {
let mm = window.getGroupMessageManager("browsers"); let mm = window.getGroupMessageManager("browsers");
mm.loadFrameScript("chrome://browser/content/tab-content.js", true); mm.loadFrameScript("chrome://browser/content/tab-content.js", true);
mm.loadFrameScript("chrome://browser/content/content.js", true); mm.loadFrameScript("chrome://browser/content/content.js", true);
mm.loadFrameScript("chrome://browser/content/content-UITour.js", true);
mm.loadFrameScript("chrome://global/content/content-HybridContentTelemetry.js", true); mm.loadFrameScript("chrome://global/content/content-HybridContentTelemetry.js", true);
mm.loadFrameScript("chrome://global/content/manifestMessages.js", true);
window.messageManager.addMessageListener("Browser:LoadURI", RedirectLoad); window.messageManager.addMessageListener("Browser:LoadURI", RedirectLoad);
@ -1936,9 +1931,7 @@ var gBrowserInit = {
// Final window teardown, do this last. // Final window teardown, do this last.
gBrowser.destroy(); gBrowser.destroy();
window.XULBrowserWindow = null; window.XULBrowserWindow = null;
window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell.treeOwner
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIXULWindow)
.XULBrowserWindow = null; .XULBrowserWindow = null;
@ -2481,9 +2474,7 @@ function getPostDataStream(aPostDataString,
} }
function getLoadContext() { function getLoadContext() {
return window.QueryInterface(Ci.nsIInterfaceRequestor) return window.docShell.QueryInterface(Ci.nsILoadContext);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
} }
function readFromClipboard() { function readFromClipboard() {
@ -2553,9 +2544,7 @@ async function BrowserViewSourceOfDocument(aArgsOrDocument) {
} }
let win = doc.defaultView; let win = doc.defaultView;
let browser = win.getInterface(Ci.nsIWebNavigation) let browser = win.docShell.chromeEventHandler;
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
let outerWindowID = win.windowUtils.outerWindowID; let outerWindowID = win.windowUtils.outerWindowID;
let URL = browser.currentURI.spec; let URL = browser.currentURI.spec;
args = { browser, outerWindowID, URL }; args = { browser, outerWindowID, URL };

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

@ -160,9 +160,7 @@ var RefreshBlocker = {
if (message.name == "RefreshBlocker:Refresh") { if (message.name == "RefreshBlocker:Refresh") {
let win = Services.wm.getOuterWindowWithId(data.outerWindowID); let win = Services.wm.getOuterWindowWithId(data.outerWindowID);
let refreshURI = win.QueryInterface(Ci.nsIInterfaceRequestor) let refreshURI = win.docShell.QueryInterface(Ci.nsIRefreshURI);
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIRefreshURI);
let URI = Services.io.newURI(data.URI); let URI = Services.io.newURI(data.URI);

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

@ -230,11 +230,7 @@ nsContextMenu.prototype = {
this.browser = gContextMenuContentData.browser; this.browser = gContextMenuContentData.browser;
this.selectionInfo = gContextMenuContentData.selectionInfo; this.selectionInfo = gContextMenuContentData.selectionInfo;
} else { } else {
this.browser = this.ownerDoc.defaultView this.browser = this.ownerDoc.defaultView.docShell.chromeEventHandler;
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
this.selectionInfo = BrowserUtils.getSelectionDetails(window); this.selectionInfo = BrowserUtils.getSelectionDetails(window);
} }
@ -260,8 +256,7 @@ nsContextMenu.prototype = {
InlineSpellCheckerUI.initFromRemote(gContextMenuContentData.spellInfo); InlineSpellCheckerUI.initFromRemote(gContextMenuContentData.spellInfo);
} else { } else {
var targetWin = this.ownerDoc.defaultView; var targetWin = this.ownerDoc.defaultView;
var editingSession = targetWin.QueryInterface(Ci.nsIInterfaceRequestor) var editingSession = targetWin.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIEditingSession); .getInterface(Ci.nsIEditingSession);

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

@ -238,9 +238,7 @@ const nsICacheStorage = Ci.nsICacheStorage;
const cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(nsICacheStorageService); const cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(nsICacheStorageService);
var loadContextInfo = Services.loadContextInfo.fromLoadContext( var loadContextInfo = Services.loadContextInfo.fromLoadContext(
window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell.QueryInterface(Ci.nsILoadContext), false);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext), false);
var diskStorage = cacheService.diskCacheStorage(loadContextInfo, false); var diskStorage = cacheService.diskCacheStorage(loadContextInfo, false);
const nsICookiePermission = Ci.nsICookiePermission; const nsICookiePermission = Ci.nsICookiePermission;

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

@ -90,6 +90,12 @@ addMessageListener("MixedContent:ReenableProtection", function() {
XPCOMUtils.defineLazyProxy(this, "LightweightThemeChildHelper", XPCOMUtils.defineLazyProxy(this, "LightweightThemeChildHelper",
"resource:///modules/LightweightThemeChildHelper.jsm"); "resource:///modules/LightweightThemeChildHelper.jsm");
XPCOMUtils.defineLazyProxy(this, "ManifestMessages", () => {
let tmp = {};
ChromeUtils.import("resource://gre/modules/ManifestMessages.jsm", tmp);
return new tmp.ManifestMessages(global);
});
let themeablePagesWhitelist = new Set([ let themeablePagesWhitelist = new Set([
"about:home", "about:home",
"about:newtab", "about:newtab",
@ -517,3 +523,8 @@ addEventListener("MozAfterPaint", function onFirstNonBlankPaint() {
removeEventListener("MozAfterPaint", onFirstNonBlankPaint); removeEventListener("MozAfterPaint", onFirstNonBlankPaint);
sendAsyncMessage("Browser:FirstNonBlankPaint"); sendAsyncMessage("Browser:FirstNonBlankPaint");
}); });
addMessageListener("DOM:WebManifest:hasManifestLink", ManifestMessages);
addMessageListener("DOM:ManifestObtainer:Obtain", ManifestMessages);
addMessageListener("DOM:Manifest:FireAppInstalledEvent", ManifestMessages);
addMessageListener("DOM:WebManifest:fetchIcon", ManifestMessages);

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

@ -660,10 +660,7 @@ window._gBrowser = {
// directly from the content window to the browser without looping // directly from the content window to the browser without looping
// over all browsers. // over all browsers.
if (!gMultiProcessBrowser) { if (!gMultiProcessBrowser) {
let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) let browser = aWindow.docShell.chromeEventHandler;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
return this.getTabForBrowser(browser); return this.getTabForBrowser(browser);
} }
@ -3070,11 +3067,7 @@ window._gBrowser = {
win.windowUtils.suppressAnimation(true); win.windowUtils.suppressAnimation(true);
// Only suppressing window animations isn't enough to avoid // Only suppressing window animations isn't enough to avoid
// an empty content area being painted. // an empty content area being painted.
let baseWin = win.QueryInterface(Ci.nsIInterfaceRequestor) let baseWin = win.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Ci.nsIBaseWindow);
baseWin.visibility = false; baseWin.visibility = false;
} }

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

@ -18,9 +18,7 @@
"use strict"; "use strict";
function getLoadContext() { function getLoadContext() {
return window.QueryInterface(Ci.nsIInterfaceRequestor) return window.docShell.QueryInterface(Ci.nsILoadContext);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
} }
function getTransferableFromClipboard(asHTML) { function getTransferableFromClipboard(asHTML) {

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

@ -23,18 +23,12 @@ const whitelist = {
"extension-process-script.js", "extension-process-script.js",
]), ]),
modules: new Set([ modules: new Set([
// From the test harness
"chrome://mochikit/content/ShutdownLeaksCollector.jsm", "chrome://mochikit/content/ShutdownLeaksCollector.jsm",
"resource://specialpowers/MockColorPicker.jsm",
"resource://specialpowers/MockFilePicker.jsm",
"resource://specialpowers/MockPermissionPrompt.jsm",
// General utilities // General utilities
"resource://gre/modules/AppConstants.jsm", "resource://gre/modules/AppConstants.jsm",
"resource://gre/modules/AsyncShutdown.jsm", "resource://gre/modules/AsyncShutdown.jsm",
"resource://gre/modules/DeferredTask.jsm", "resource://gre/modules/DeferredTask.jsm",
"resource://gre/modules/FileUtils.jsm",
"resource://gre/modules/NetUtil.jsm",
"resource://gre/modules/PromiseUtils.jsm", "resource://gre/modules/PromiseUtils.jsm",
"resource://gre/modules/Services.jsm", // bug 1464542 "resource://gre/modules/Services.jsm", // bug 1464542
"resource://gre/modules/Timer.jsm", "resource://gre/modules/Timer.jsm",
@ -76,9 +70,6 @@ const whitelist = {
"resource://gre/modules/ExtensionUtils.jsm", "resource://gre/modules/ExtensionUtils.jsm",
"resource://gre/modules/MessageChannel.jsm", "resource://gre/modules/MessageChannel.jsm",
// Service workers
"resource://gre/modules/ServiceWorkerCleanUp.jsm",
// Shield // Shield
"resource://normandy-content/AboutPages.jsm", "resource://normandy-content/AboutPages.jsm",
]), ]),

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

@ -57,9 +57,7 @@ async function recordReflows(testPromise, win = window) {
Ci.nsISupportsWeakReference]) Ci.nsISupportsWeakReference])
}; };
let docShell = win.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = win.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.addWeakReflowObserver(observer); docShell.addWeakReflowObserver(observer);
let dirtyFrameFn = event => { let dirtyFrameFn = event => {

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

@ -12,11 +12,7 @@
<script type="text/javascript"> <script type="text/javascript">
function checkLoadStates() { function checkLoadStates() {
var ui = SpecialPowers.wrap(window) var ui = SpecialPowers.wrap(window).docShell.securityUI;
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
.securityUI;
var loadedMixedActive = ui && var loadedMixedActive = ui &&
!!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT); !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);

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

@ -12,11 +12,7 @@
<script type="text/javascript"> <script type="text/javascript">
function checkLoadStates() { function checkLoadStates() {
var ui = SpecialPowers.wrap(window) var ui = SpecialPowers.wrap(window).docShell.securityUI;
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
.securityUI;
var loadedMixedActive = ui && var loadedMixedActive = ui &&
!!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT); !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);

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

@ -12,11 +12,7 @@
<script type="text/javascript"> <script type="text/javascript">
function checkLoadStates() { function checkLoadStates() {
var ui = SpecialPowers.wrap(window) var ui = SpecialPowers.wrap(window).docShell.securityUI;
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.QueryInterface(SpecialPowers.Ci.nsIDocShell)
.securityUI;
var loadedMixedActive = ui && var loadedMixedActive = ui &&
!!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT); !!(ui.state & SpecialPowers.Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT);

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

@ -1714,11 +1714,8 @@ var CustomizableUIInternal = {
// Err, we're done. // Err, we're done.
break; break;
} }
// Cue some voodoo // Find containing browser or iframe element in the parent doc.
target = target.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) target = target.defaultView.docShell.chromeEventHandler;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
if (!target) { if (!target) {
break; break;
} }

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

@ -122,9 +122,7 @@ var DownloadsTaskbar = {
*/ */
_attachIndicator(aWindow) { _attachIndicator(aWindow) {
// Activate the indicator on the specified window. // Activate the indicator on the specified window.
let docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = aWindow.docShell.treeOwner
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow).docShell; .getInterface(Ci.nsIXULWindow).docShell;
this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell); this._taskbarProgress = gWinTaskbar.getTaskbarProgress(docShell);

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

@ -4,9 +4,7 @@
function frameScript() { function frameScript() {
function getSelectedText() { function getSelectedText() {
let frame = this.content.frames[0].frames[1]; let frame = this.content.frames[0].frames[1];
let docShell = frame.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = frame.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor) let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISelectionDisplay) .getInterface(Ci.nsISelectionDisplay)
.QueryInterface(Ci.nsISelectionController); .QueryInterface(Ci.nsISelectionController);

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

@ -118,8 +118,7 @@ add_task(async function testWindowCreate() {
"Got expected hidden chrome"); "Got expected hidden chrome");
} }
if (expected.chromeFlags) { if (expected.chromeFlags) {
let {chromeFlags} = latestWindow.QueryInterface(Ci.nsIInterfaceRequestor) let {chromeFlags} = latestWindow.docShell
.getInterface(Ci.nsIDocShell)
.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIXULWindow);
for (let flag of expected.chromeFlags) { for (let flag of expected.chromeFlags) {

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

@ -76,8 +76,7 @@ function FeedWriter() {
Services.telemetry.scalarAdd("browser.feeds.preview_loaded", 1); Services.telemetry.scalarAdd("browser.feeds.preview_loaded", 1);
XPCOMUtils.defineLazyGetter(this, "_mm", () => XPCOMUtils.defineLazyGetter(this, "_mm", () =>
this._window.QueryInterface(Ci.nsIInterfaceRequestor). this._window.docShell.
getInterface(Ci.nsIDocShell).
QueryInterface(Ci.nsIInterfaceRequestor). QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIContentFrameMessageManager)); getInterface(Ci.nsIContentFrameMessageManager));
} }
@ -710,9 +709,7 @@ FeedWriter.prototype = {
* The window of the document invoking the BrowserFeedWriter * The window of the document invoking the BrowserFeedWriter
*/ */
_getOriginalURI(aWindow) { _getOriginalURI(aWindow) {
let docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = aWindow.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let chan = docShell.currentDocumentChannel; let chan = docShell.currentDocumentChannel;
// We probably need to call Inherit() for this, but right now we can't call // We probably need to call Inherit() for this, but right now we can't call

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

@ -323,9 +323,7 @@ WebContentConverterRegistrarContent.prototype = {
registerProtocolHandler(aProtocol, aURIString, aTitle, aBrowserOrWindow) { registerProtocolHandler(aProtocol, aURIString, aTitle, aBrowserOrWindow) {
aProtocol = (aProtocol || "").toLowerCase(); aProtocol = (aProtocol || "").toLowerCase();
// aBrowserOrWindow must be a window. // aBrowserOrWindow must be a window.
let messageManager = aBrowserOrWindow.QueryInterface(Ci.nsIInterfaceRequestor) let messageManager = aBrowserOrWindow.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsITabChild) .getInterface(Ci.nsITabChild)
.messageManager; .messageManager;

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

@ -210,8 +210,7 @@ function openBrowserWindow(cmdLine, urlOrUrlList, postData = null,
win.document.documentElement.removeAttribute("windowtype"); win.document.documentElement.removeAttribute("windowtype");
if (forcePrivate) { if (forcePrivate) {
win.QueryInterface(Ci.nsIInterfaceRequestor) win.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext) .QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing = true; .usePrivateBrowsing = true;
} }
@ -420,8 +419,7 @@ nsBrowserContentHandler.prototype = {
if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) { if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) {
let win = Services.wm.getMostRecentWindow("navigator:blank"); let win = Services.wm.getMostRecentWindow("navigator:blank");
if (win) { if (win) {
win.QueryInterface(Ci.nsIInterfaceRequestor) win.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext) .QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing = true; .usePrivateBrowsing = true;
} }

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

@ -185,9 +185,7 @@ var gSearchResultsPane = {
*/ */
getFindSelection(win) { getFindSelection(win) {
// Yuck. See bug 138068. // Yuck. See bug 138068.
let docShell = win.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = win.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor) let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISelectionDisplay) .getInterface(Ci.nsISelectionDisplay)

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

@ -522,10 +522,7 @@ SubDialog.prototype = {
}, },
_getBrowser() { _getBrowser() {
return window.QueryInterface(Ci.nsIInterfaceRequestor) return window.docShell.chromeEventHandler;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
}, },
}; };

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

@ -356,10 +356,7 @@ var gSyncPane = {
// Replace the current tab with the specified URL. // Replace the current tab with the specified URL.
replaceTabWithUrl(url) { replaceTabWithUrl(url) {
// Get the <browser> element hosting us. // Get the <browser> element hosting us.
let browser = window.QueryInterface(Ci.nsIInterfaceRequestor) let browser = window.docShell.chromeEventHandler;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
// And tell it to load our URL. // And tell it to load our URL.
browser.loadURI(url); browser.loadURI(url);
}, },

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

@ -12,10 +12,8 @@
* @return Promise * @return Promise
*/ */
function assertWindowIsPrivate(win) { function assertWindowIsPrivate(win) {
let winDocShell = win.QueryInterface(Ci.nsIInterfaceRequestor) let winDocShell = win.docShell;
.getInterface(Ci.nsIDocShell); let chromeFlags = winDocShell.treeOwner
let chromeFlags = winDocShell.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIXULWindow)
.chromeFlags; .chromeFlags;

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

@ -73,9 +73,7 @@ var SessionStorageInternal = {
collect(content) { collect(content) {
let data = {}; let data = {};
let visitedOrigins = new Set(); let visitedOrigins = new Set();
let docShell = content.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = content.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
forEachNonDynamicChildFrame(content, frame => { forEachNonDynamicChildFrame(content, frame => {
let principal = getPrincipalForFrame(docShell, frame); let principal = getPrincipalForFrame(docShell, frame);

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

@ -1690,11 +1690,7 @@ var SessionStoreInternal = {
// We have to wait for these messages to come up from // We have to wait for these messages to come up from
// each window and each browser. In the meantime, hide // each window and each browser. In the meantime, hide
// the windows to improve perceived shutdown speed. // the windows to improve perceived shutdown speed.
let baseWin = window.QueryInterface(Ci.nsIInterfaceRequestor) let baseWin = window.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Ci.nsIBaseWindow);
baseWin.visibility = false; baseWin.visibility = false;
} }
@ -4473,7 +4469,7 @@ var SessionStoreInternal = {
} }
// Width and height attribute report the inner size, but we want // Width and height attribute report the inner size, but we want
// to store the outer size, so add the difference. // to store the outer size, so add the difference.
let xulWin = aWindow.getInterface(Ci.nsIDocShell) let xulWin = aWindow.docShell
.treeOwner .treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow); .getInterface(Ci.nsIXULWindow);

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

@ -5,9 +5,8 @@ add_task(async function duplicateTab() {
await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
await ContentTask.spawn(tab.linkedBrowser, null, function() { await ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.window.docShell
.getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIWebNavigation);
.QueryInterface(Ci.nsIDocShell);
let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false); let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString()); is(shEntry.docshellID.toString(), docshell.historyID.toString());
}); });
@ -16,9 +15,8 @@ add_task(async function duplicateTab() {
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser); await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
await ContentTask.spawn(tab2.linkedBrowser, null, function() { await ContentTask.spawn(tab2.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.window.docShell
.getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIWebNavigation);
.QueryInterface(Ci.nsIDocShell);
let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false); let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString()); is(shEntry.docshellID.toString(), docshell.historyID.toString());
}); });
@ -34,9 +32,8 @@ add_task(async function contentToChromeNavigate() {
await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
await ContentTask.spawn(tab.linkedBrowser, null, function() { await ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.window.docShell
.getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIWebNavigation);
.QueryInterface(Ci.nsIDocShell);
let sh = docshell.sessionHistory; let sh = docshell.sessionHistory;
is(sh.count, 1); is(sh.count, 1);
is(sh.legacySHistory.getEntryAtIndex(0, false).docshellID.toString(), docshell.historyID.toString()); is(sh.legacySHistory.getEntryAtIndex(0, false).docshellID.toString(), docshell.historyID.toString());

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

@ -2,14 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/frame-script */ var EXPORTED_SYMBOLS = ["UITourListener"];
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
const PREF_TEST_WHITELIST = "browser.uitour.testingOrigins"; const PREF_TEST_WHITELIST = "browser.uitour.testingOrigins";
const UITOUR_PERMISSION = "uitour"; const UITOUR_PERMISSION = "uitour";
var UITourListener = { class UITourListener {
constructor(mm) {
this.mm = mm;
}
handleEvent(event) { handleEvent(event) {
if (!Services.prefs.getBoolPref("browser.uitour.enabled")) { if (!Services.prefs.getBoolPref("browser.uitour.enabled")) {
return; return;
@ -17,14 +21,14 @@ var UITourListener = {
if (!this.ensureTrustedOrigin()) { if (!this.ensureTrustedOrigin()) {
return; return;
} }
addMessageListener("UITour:SendPageCallback", this); this.mm.addMessageListener("UITour:SendPageCallback", this);
addMessageListener("UITour:SendPageNotification", this); this.mm.addMessageListener("UITour:SendPageNotification", this);
sendAsyncMessage("UITour:onPageEvent", { this.mm.sendAsyncMessage("UITour:onPageEvent", {
detail: event.detail, detail: event.detail,
type: event.type, type: event.type,
pageVisibilityState: content.document.visibilityState, pageVisibilityState: this.mm.content.document.visibilityState,
}); });
}, }
isTestingOrigin(aURI) { isTestingOrigin(aURI) {
if (Services.prefs.getPrefType(PREF_TEST_WHITELIST) != Services.prefs.PREF_STRING) { if (Services.prefs.getPrefType(PREF_TEST_WHITELIST) != Services.prefs.PREF_STRING) {
@ -43,7 +47,7 @@ var UITourListener = {
} }
} }
return false; return false;
}, }
// This function is copied from UITour.jsm. // This function is copied from UITour.jsm.
isSafeScheme(aURI) { isSafeScheme(aURI) {
@ -55,9 +59,11 @@ var UITourListener = {
return false; return false;
return true; return true;
}, }
ensureTrustedOrigin() { ensureTrustedOrigin() {
let {content} = this.mm;
if (content.top != content) if (content.top != content)
return false; return false;
@ -74,7 +80,7 @@ var UITourListener = {
return true; return true;
return this.isTestingOrigin(uri); return this.isTestingOrigin(uri);
}, }
receiveMessage(aMessage) { receiveMessage(aMessage) {
switch (aMessage.name) { switch (aMessage.name) {
@ -85,21 +91,19 @@ var UITourListener = {
this.sendPageEvent("Notification", aMessage.data); this.sendPageEvent("Notification", aMessage.data);
break; break;
} }
}, }
sendPageEvent(type, detail) { sendPageEvent(type, detail) {
if (!this.ensureTrustedOrigin()) { if (!this.ensureTrustedOrigin()) {
return; return;
} }
let doc = content.document; let win = this.mm.content;
let eventName = "mozUITour" + type; let eventName = "mozUITour" + type;
let event = new doc.defaultView.CustomEvent(eventName, { let event = new win.CustomEvent(eventName, {
bubbles: true, bubbles: true,
detail: Cu.cloneInto(detail, doc.defaultView) detail: Cu.cloneInto(detail, win),
}); });
doc.dispatchEvent(event); win.document.dispatchEvent(event);
} }
}; }
addEventListener("mozUITour", UITourListener, false, true);

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

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/content-UITour.js

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

@ -3,11 +3,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_JS_MODULES += [ EXTRA_JS_MODULES += [
'ContentUITour.jsm',
'UITour.jsm', 'UITour.jsm',
] ]
JAR_MANIFESTS += ['jar.mn']
BROWSER_CHROME_MANIFESTS += [ BROWSER_CHROME_MANIFESTS += [
'test/browser.ini', 'test/browser.ini',
] ]

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

@ -266,8 +266,7 @@ let ProfileAutocomplete = {
}, },
_frameMMFromWindow(contentWindow) { _frameMMFromWindow(contentWindow) {
return contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) return contentWindow.docShell
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
}, },
@ -631,9 +630,7 @@ var FormAutofillContent = {
}, },
_messageManagerFromWindow(win) { _messageManagerFromWindow(win) {
return win.QueryInterface(Ci.nsIInterfaceRequestor) return win.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
}, },

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

@ -88,7 +88,7 @@ var FormAutofillFrameScript = {
} }
const doc = content.document; const doc = content.document;
const {chromeEventHandler} = doc.ownerGlobal.getInterface(Ci.nsIDocShell); const {chromeEventHandler} = doc.ownerGlobal.docShell;
switch (message.name) { switch (message.name) {
case "FormAutofill:PreviewProfile": { case "FormAutofill:PreviewProfile": {

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

@ -261,9 +261,7 @@ mm.addMessageListener("ppapipdf.js:save", ({ data }) => {
let listener = { let listener = {
extListener: null, extListener: null,
onStartRequest(aRequest, aContext) { onStartRequest(aRequest, aContext) {
var loadContext = containerWindow var loadContext = containerWindow.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext); .QueryInterface(Ci.nsILoadContext);
this.extListener = extHelperAppSvc.doContent( this.extListener = extHelperAppSvc.doContent(
"application/pdf", aRequest, loadContext, false); "application/pdf", aRequest, loadContext, false);

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

@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 2.0.694 Current extension version is: 2.0.719
Taken from upstream commit: 1aaeaf33 Taken from upstream commit: 35214245

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

@ -268,9 +268,7 @@ class ChromeActions {
var listener = { var listener = {
extListener: null, extListener: null,
onStartRequest(aRequest, aContext) { onStartRequest(aRequest, aContext) {
var loadContext = self.domWindow var loadContext = self.domWindow.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext); .QueryInterface(Ci.nsILoadContext);
this.extListener = extHelperAppSvc.doContent( this.extListener = extHelperAppSvc.doContent(
(data.isAttachment ? "application/octet-stream" : (data.isAttachment ? "application/octet-stream" :
@ -414,8 +412,7 @@ class ChromeActions {
getLocalizedString(strings, "open_with_different_viewer"), getLocalizedString(strings, "open_with_different_viewer"),
getLocalizedString(strings, "open_with_different_viewer", "accessKey")); getLocalizedString(strings, "open_with_different_viewer", "accessKey"));
let winmm = domWindow.QueryInterface(Ci.nsIInterfaceRequestor) let winmm = domWindow.docShell
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
@ -442,8 +439,7 @@ class ChromeActions {
return; return;
} }
var winmm = this.domWindow.QueryInterface(Ci.nsIInterfaceRequestor) var winmm = this.domWindow.docShell
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
@ -759,8 +755,7 @@ class RequestListener {
class FindEventManager { class FindEventManager {
constructor(contentWindow) { constructor(contentWindow) {
this.contentWindow = contentWindow; this.contentWindow = contentWindow;
this.winmm = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) this.winmm = contentWindow.docShell
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
} }

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

@ -91,8 +91,7 @@ var PdfjsContentUtils = {
*/ */
displayWarning(aWindow, aMessage, aLabel, aAccessKey) { displayWarning(aWindow, aMessage, aLabel, aAccessKey) {
// the child's dom frame mm associated with the window. // the child's dom frame mm associated with the window.
let winmm = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) let winmm = aWindow.docShell
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);
winmm.sendAsyncMessage("PDFJS:Parent:displayWarning", { winmm.sendAsyncMessage("PDFJS:Parent:displayWarning", {

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

@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
"use strict"; "use strict";
var pdfjsVersion = '2.0.694'; var pdfjsVersion = '2.0.719';
var pdfjsBuild = '1aaeaf33'; var pdfjsBuild = '35214245';
var pdfjsSharedUtil = __w_pdfjs_require__(1); var pdfjsSharedUtil = __w_pdfjs_require__(1);
var pdfjsDisplayAPI = __w_pdfjs_require__(7); var pdfjsDisplayAPI = __w_pdfjs_require__(7);
var pdfjsDisplayTextLayer = __w_pdfjs_require__(19); var pdfjsDisplayTextLayer = __w_pdfjs_require__(19);
@ -4223,7 +4223,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
} }
return worker.messageHandler.sendWithPromise('GetDocRequest', { return worker.messageHandler.sendWithPromise('GetDocRequest', {
docId, docId,
apiVersion: '2.0.694', apiVersion: '2.0.719',
source: { source: {
data: source.data, data: source.data,
url: source.url, url: source.url,
@ -5563,8 +5563,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '2.0.694'; exports.version = version = '2.0.719';
exports.build = build = '1aaeaf33'; exports.build = build = '35214245';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;

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

@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
"use strict"; "use strict";
var pdfjsVersion = '2.0.694'; var pdfjsVersion = '2.0.719';
var pdfjsBuild = '1aaeaf33'; var pdfjsBuild = '35214245';
var pdfjsCoreWorker = __w_pdfjs_require__(1); var pdfjsCoreWorker = __w_pdfjs_require__(1);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -327,7 +327,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null; var cancelXHRs = null;
var WorkerTasks = []; var WorkerTasks = [];
let apiVersion = docParams.apiVersion; let apiVersion = docParams.apiVersion;
let workerVersion = '2.0.694'; let workerVersion = '2.0.719';
if (apiVersion !== workerVersion) { if (apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
} }
@ -5226,12 +5226,12 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.PDFDocument = exports.Page = undefined; exports.PDFDocument = exports.Page = undefined;
var _util = __w_pdfjs_require__(2);
var _obj = __w_pdfjs_require__(11); var _obj = __w_pdfjs_require__(11);
var _primitives = __w_pdfjs_require__(12); var _primitives = __w_pdfjs_require__(12);
var _util = __w_pdfjs_require__(2);
var _stream = __w_pdfjs_require__(14); var _stream = __w_pdfjs_require__(14);
var _annotation = __w_pdfjs_require__(26); var _annotation = __w_pdfjs_require__(26);
@ -5492,6 +5492,7 @@ var PDFDocument = function PDFDocumentClosure() {
xref: this.xref, xref: this.xref,
isEvalSupported: evaluatorOptions.isEvalSupported isEvalSupported: evaluatorOptions.isEvalSupported
}); });
this._pagePromises = [];
} }
function find(stream, needle, limit, backwards) { function find(stream, needle, limit, backwards) {
var pos = stream.pos; var pos = stream.pos;
@ -5512,20 +5513,16 @@ var PDFDocument = function PDFDocumentClosure() {
stream.pos += index; stream.pos += index;
return true; return true;
} }
var DocumentInfoValidators = { const DocumentInfoValidators = {
get entries() { Title: _util.isString,
return (0, _util.shadow)(this, 'entries', { Author: _util.isString,
Title: _util.isString, Subject: _util.isString,
Author: _util.isString, Keywords: _util.isString,
Subject: _util.isString, Creator: _util.isString,
Keywords: _util.isString, Producer: _util.isString,
Creator: _util.isString, CreationDate: _util.isString,
Producer: _util.isString, ModDate: _util.isString,
CreationDate: _util.isString, Trapped: _primitives.isName
ModDate: _util.isString,
Trapped: _primitives.isName
});
}
}; };
PDFDocument.prototype = { PDFDocument.prototype = {
parse: function PDFDocument_parse(recoveryMode) { parse: function PDFDocument_parse(recoveryMode) {
@ -5552,16 +5549,14 @@ var PDFDocument = function PDFDocumentClosure() {
} }
}, },
get linearization() { get linearization() {
var linearization = null; let linearization = null;
if (this.stream.length) { try {
try { linearization = _parser.Linearization.create(this.stream);
linearization = _parser.Linearization.create(this.stream); } catch (err) {
} catch (err) { if (err instanceof _util.MissingDataException) {
if (err instanceof _util.MissingDataException) { throw err;
throw err;
}
(0, _util.info)(err);
} }
(0, _util.info)(err);
} }
return (0, _util.shadow)(this, 'linearization', linearization); return (0, _util.shadow)(this, 'linearization', linearization);
}, },
@ -5639,21 +5634,7 @@ var PDFDocument = function PDFDocumentClosure() {
}, },
setup: function PDFDocument_setup(recoveryMode) { setup: function PDFDocument_setup(recoveryMode) {
this.xref.parse(recoveryMode); this.xref.parse(recoveryMode);
var pageFactory = { this.catalog = new _obj.Catalog(this.pdfManager, this.xref);
createPage: (pageIndex, dict, ref, fontCache, builtInCMapCache) => {
return new Page({
pdfManager: this.pdfManager,
xref: this.xref,
pageIndex,
pageDict: dict,
ref,
fontCache,
builtInCMapCache,
pdfFunctionFactory: this.pdfFunctionFactory
});
}
};
this.catalog = new _obj.Catalog(this.pdfManager, this.xref, pageFactory);
}, },
get numPages() { get numPages() {
var linearization = this.linearization; var linearization = this.linearization;
@ -5661,12 +5642,13 @@ var PDFDocument = function PDFDocumentClosure() {
return (0, _util.shadow)(this, 'numPages', num); return (0, _util.shadow)(this, 'numPages', num);
}, },
get documentInfo() { get documentInfo() {
var docInfo = { const docInfo = {
PDFFormatVersion: this.pdfFormatVersion, PDFFormatVersion: this.pdfFormatVersion,
IsLinearized: !!this.linearization,
IsAcroFormPresent: !!this.acroForm, IsAcroFormPresent: !!this.acroForm,
IsXFAPresent: !!this.xfa IsXFAPresent: !!this.xfa
}; };
var infoDict; let infoDict;
try { try {
infoDict = this.xref.trailer.get('Info'); infoDict = this.xref.trailer.get('Info');
} catch (err) { } catch (err) {
@ -5675,12 +5657,11 @@ var PDFDocument = function PDFDocumentClosure() {
} }
(0, _util.info)('The document information dictionary is invalid.'); (0, _util.info)('The document information dictionary is invalid.');
} }
if (infoDict) { if ((0, _primitives.isDict)(infoDict)) {
var validEntries = DocumentInfoValidators.entries; for (let key in DocumentInfoValidators) {
for (var key in validEntries) {
if (infoDict.has(key)) { if (infoDict.has(key)) {
var value = infoDict.get(key); const value = infoDict.get(key);
if (validEntries[key](value)) { if (DocumentInfoValidators[key](value)) {
docInfo[key] = typeof value !== 'string' ? value : (0, _util.stringToPDFString)(value); docInfo[key] = typeof value !== 'string' ? value : (0, _util.stringToPDFString)(value);
} else { } else {
(0, _util.info)('Bad value in document info for "' + key + '"'); (0, _util.info)('Bad value in document info for "' + key + '"');
@ -5709,8 +5690,41 @@ var PDFDocument = function PDFDocumentClosure() {
} }
return (0, _util.shadow)(this, 'fingerprint', fileID); return (0, _util.shadow)(this, 'fingerprint', fileID);
}, },
getPage: function PDFDocument_getPage(pageIndex) { _getLinearizationPage(pageIndex) {
return this.catalog.getPage(pageIndex); const { catalog, linearization } = this;
(0, _util.assert)(linearization && linearization.pageFirst === pageIndex);
const ref = new _primitives.Ref(linearization.objectNumberFirst, 0);
return this.xref.fetchAsync(ref).then(obj => {
if ((0, _primitives.isDict)(obj, 'Page') || (0, _primitives.isDict)(obj) && !obj.has('Type') && obj.has('Contents')) {
if (ref && !catalog.pageKidsCountCache.has(ref)) {
catalog.pageKidsCountCache.put(ref, 1);
}
return [obj, ref];
}
throw new _util.FormatError('The Linearization dictionary doesn\'t point ' + 'to a valid Page dictionary.');
}).catch(reason => {
(0, _util.info)(reason);
return catalog.getPageDict(pageIndex);
});
},
getPage(pageIndex) {
if (this._pagePromises[pageIndex] !== undefined) {
return this._pagePromises[pageIndex];
}
const { catalog, linearization } = this;
const promise = linearization && linearization.pageFirst === pageIndex ? this._getLinearizationPage(pageIndex) : catalog.getPageDict(pageIndex);
return this._pagePromises[pageIndex] = promise.then(([pageDict, ref]) => {
return new Page({
pdfManager: this.pdfManager,
xref: this.xref,
pageIndex,
pageDict,
ref,
fontCache: catalog.fontCache,
builtInCMapCache: catalog.builtInCMapCache,
pdfFunctionFactory: this.pdfFunctionFactory
});
});
}, },
cleanup: function PDFDocument_cleanup() { cleanup: function PDFDocument_cleanup() {
return this.catalog.cleanup(); return this.catalog.cleanup();
@ -5746,7 +5760,7 @@ var _crypto = __w_pdfjs_require__(24);
var _colorspace = __w_pdfjs_require__(25); var _colorspace = __w_pdfjs_require__(25);
var Catalog = function CatalogClosure() { var Catalog = function CatalogClosure() {
function Catalog(pdfManager, xref, pageFactory) { function Catalog(pdfManager, xref) {
this.pdfManager = pdfManager; this.pdfManager = pdfManager;
this.xref = xref; this.xref = xref;
this.catDict = xref.getCatalogObj(); this.catDict = xref.getCatalogObj();
@ -5754,10 +5768,8 @@ var Catalog = function CatalogClosure() {
throw new _util.FormatError('catalog object is not a dictionary'); throw new _util.FormatError('catalog object is not a dictionary');
} }
this.fontCache = new _primitives.RefSetCache(); this.fontCache = new _primitives.RefSetCache();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache = new Map();
this.pageKidsCountCache = new _primitives.RefSetCache(); this.pageKidsCountCache = new _primitives.RefSetCache();
this.pageFactory = pageFactory;
this.pagePromises = [];
} }
Catalog.prototype = { Catalog.prototype = {
get metadata() { get metadata() {
@ -6133,17 +6145,9 @@ var Catalog = function CatalogClosure() {
delete font.translated; delete font.translated;
} }
this.fontCache.clear(); this.fontCache.clear();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache.clear();
}); });
}, },
getPage: function Catalog_getPage(pageIndex) {
if (!(pageIndex in this.pagePromises)) {
this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(([dict, ref]) => {
return this.pageFactory.createPage(pageIndex, dict, ref, this.fontCache, this.builtInCMapCache);
});
}
return this.pagePromises[pageIndex];
},
getPageDict: function Catalog_getPageDict(pageIndex) { getPageDict: function Catalog_getPageDict(pageIndex) {
var capability = (0, _util.createPromiseCapability)(); var capability = (0, _util.createPromiseCapability)();
var nodesToVisit = [this.catDict.getRaw('Pages')]; var nodesToVisit = [this.catDict.getRaw('Pages')];
@ -8639,6 +8643,7 @@ var StringStream = function StringStreamClosure() {
var DecodeStream = function DecodeStreamClosure() { var DecodeStream = function DecodeStreamClosure() {
var emptyBuffer = new Uint8Array(0); var emptyBuffer = new Uint8Array(0);
function DecodeStream(maybeMinBufferLength) { function DecodeStream(maybeMinBufferLength) {
this._rawMinBufferLength = maybeMinBufferLength || 0;
this.pos = 0; this.pos = 0;
this.bufferLength = 0; this.bufferLength = 0;
this.eof = false; this.eof = false;
@ -8756,7 +8761,16 @@ var DecodeStream = function DecodeStreamClosure() {
var StreamsSequenceStream = function StreamsSequenceStreamClosure() { var StreamsSequenceStream = function StreamsSequenceStreamClosure() {
function StreamsSequenceStream(streams) { function StreamsSequenceStream(streams) {
this.streams = streams; this.streams = streams;
DecodeStream.call(this, null); let maybeLength = 0;
for (let i = 0, ii = streams.length; i < ii; i++) {
const stream = streams[i];
if (stream instanceof DecodeStream) {
maybeLength += stream._rawMinBufferLength;
} else {
maybeLength += stream.length;
}
}
DecodeStream.call(this, maybeLength);
} }
StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype);
StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() { StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() {
@ -19008,13 +19022,12 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
this.options = options || DefaultPartialEvaluatorOptions; this.options = options || DefaultPartialEvaluatorOptions;
this.pdfFunctionFactory = pdfFunctionFactory; this.pdfFunctionFactory = pdfFunctionFactory;
this.fetchBuiltInCMap = name => { this.fetchBuiltInCMap = name => {
var cachedCMap = this.builtInCMapCache[name]; if (this.builtInCMapCache.has(name)) {
if (cachedCMap) { return Promise.resolve(this.builtInCMapCache.get(name));
return Promise.resolve(cachedCMap);
} }
return this.handler.sendWithPromise('FetchBuiltInCMap', { name }).then(data => { return this.handler.sendWithPromise('FetchBuiltInCMap', { name }).then(data => {
if (data.compressionType !== _util.CMapCompressionType.NONE) { if (data.compressionType !== _util.CMapCompressionType.NONE) {
this.builtInCMapCache[name] = data; this.builtInCMapCache.set(name, data);
} }
return data; return data;
}); });

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

@ -356,6 +356,10 @@ See https://github.com/adobe-type-tools/cmap-resources
<div class="row"> <div class="row">
<span data-l10n-id="document_properties_page_size">Page Size:</span> <p id="pageSizeField">-</p> <span data-l10n-id="document_properties_page_size">Page Size:</span> <p id="pageSizeField">-</p>
</div> </div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_linearized">Fast Web View:</span> <p id="linearizedField">-</p>
</div>
<div class="buttonRow"> <div class="buttonRow">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button> <button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div> </div>

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

@ -231,7 +231,8 @@ function getViewerConfiguration() {
'producer': document.getElementById('producerField'), 'producer': document.getElementById('producerField'),
'version': document.getElementById('versionField'), 'version': document.getElementById('versionField'),
'pageCount': document.getElementById('pageCountField'), 'pageCount': document.getElementById('pageCountField'),
'pageSize': document.getElementById('pageSizeField') 'pageSize': document.getElementById('pageSizeField'),
'linearized': document.getElementById('linearizedField')
} }
}, },
errorWrapper: { errorWrapper: {
@ -386,6 +387,9 @@ let PDFViewerApplication = {
}).then(() => { }).then(() => {
return this._initializeL10n(); return this._initializeL10n();
}).then(() => { }).then(() => {
if (this.isViewerEmbedded && _app_options.AppOptions.get('externalLinkTarget') === _pdfjsLib.LinkTarget.NONE) {
_app_options.AppOptions.set('externalLinkTarget', _pdfjsLib.LinkTarget.TOP);
}
return this._initializeViewerComponents(); return this._initializeViewerComponents();
}).then(() => { }).then(() => {
this.bindEvents(); this.bindEvents();
@ -394,74 +398,27 @@ let PDFViewerApplication = {
this.l10n.translate(appContainer).then(() => { this.l10n.translate(appContainer).then(() => {
this.eventBus.dispatch('localized'); this.eventBus.dispatch('localized');
}); });
if (this.isViewerEmbedded && _app_options.AppOptions.get('externalLinkTarget') === _pdfjsLib.LinkTarget.NONE) {
_app_options.AppOptions.set('externalLinkTarget', _pdfjsLib.LinkTarget.TOP);
}
this.initialized = true; this.initialized = true;
}); });
}, },
_readPreferences() { _readPreferences() {
let { preferences } = this; const OVERRIDES = {
return Promise.all([preferences.get('enableWebGL').then(function resolved(value) { disableFontFace: true,
_app_options.AppOptions.set('enableWebGL', value); disableRange: true,
}), preferences.get('sidebarViewOnLoad').then(function resolved(value) { disableStream: true,
_app_options.AppOptions.set('sidebarViewOnLoad', value); textLayerMode: _ui_utils.TextLayerMode.DISABLE
}), preferences.get('cursorToolOnLoad').then(function resolved(value) { };
_app_options.AppOptions.set('cursorToolOnLoad', value); return this.preferences.getAll().then(function (prefs) {
}), preferences.get('pdfBugEnabled').then(function resolved(value) { for (let name in prefs) {
_app_options.AppOptions.set('pdfBugEnabled', value); if (name in OVERRIDES && _app_options.AppOptions.get(name) === OVERRIDES[name]) {
}), preferences.get('showPreviousViewOnLoad').then(function resolved(value) { continue;
_app_options.AppOptions.set('showPreviousViewOnLoad', value); }
}), preferences.get('defaultZoomValue').then(function resolved(value) { _app_options.AppOptions.set(name, prefs[name]);
_app_options.AppOptions.set('defaultZoomValue', value);
}), preferences.get('textLayerMode').then(function resolved(value) {
if (_app_options.AppOptions.get('textLayerMode') === _ui_utils.TextLayerMode.DISABLE) {
return;
} }
_app_options.AppOptions.set('textLayerMode', value); }, function (reason) {});
}), preferences.get('disableRange').then(function resolved(value) {
if (_app_options.AppOptions.get('disableRange') === true) {
return;
}
_app_options.AppOptions.set('disableRange', value);
}), preferences.get('disableStream').then(function resolved(value) {
if (_app_options.AppOptions.get('disableStream') === true) {
return;
}
_app_options.AppOptions.set('disableStream', value);
}), preferences.get('disableAutoFetch').then(function resolved(value) {
_app_options.AppOptions.set('disableAutoFetch', value);
}), preferences.get('disableFontFace').then(function resolved(value) {
if (_app_options.AppOptions.get('disableFontFace') === true) {
return;
}
_app_options.AppOptions.set('disableFontFace', value);
}), preferences.get('useOnlyCssZoom').then(function resolved(value) {
_app_options.AppOptions.set('useOnlyCssZoom', value);
}), preferences.get('externalLinkTarget').then(function resolved(value) {
if (_app_options.AppOptions.get('externalLinkTarget') !== _pdfjsLib.LinkTarget.NONE) {
return;
}
_app_options.AppOptions.set('externalLinkTarget', value);
}), preferences.get('renderer').then(function resolved(value) {
_app_options.AppOptions.set('renderer', value);
}), preferences.get('renderInteractiveForms').then(function resolved(value) {
_app_options.AppOptions.set('renderInteractiveForms', value);
}), preferences.get('disablePageMode').then(function resolved(value) {
_app_options.AppOptions.set('disablePageMode', value);
}), preferences.get('disablePageLabels').then(function resolved(value) {
_app_options.AppOptions.set('disablePageLabels', value);
}), preferences.get('enablePrintAutoRotate').then(function resolved(value) {
_app_options.AppOptions.set('enablePrintAutoRotate', value);
}), preferences.get('scrollModeOnLoad').then(function resolved(value) {
_app_options.AppOptions.set('scrollModeOnLoad', value);
}), preferences.get('spreadModeOnLoad').then(function resolved(value) {
_app_options.AppOptions.set('spreadModeOnLoad', value);
})]).catch(function (reason) {});
}, },
_parseHashParameters() { _parseHashParameters() {
let { appConfig } = this; const waitOn = [];
let waitOn = [];
if (_app_options.AppOptions.get('pdfBugEnabled')) { if (_app_options.AppOptions.get('pdfBugEnabled')) {
let hash = document.location.hash.substring(1); let hash = document.location.hash.substring(1);
let hashParams = (0, _ui_utils.parseQueryString)(hash); let hashParams = (0, _ui_utils.parseQueryString)(hash);
@ -500,7 +457,7 @@ let PDFViewerApplication = {
case 'visible': case 'visible':
case 'shadow': case 'shadow':
case 'hover': case 'hover':
let viewer = appConfig.viewerContainer; let viewer = this.appConfig.viewerContainer;
viewer.classList.add('textLayer-' + hashParams['textlayer']); viewer.classList.add('textLayer-' + hashParams['textlayer']);
break; break;
} }
@ -781,7 +738,6 @@ let PDFViewerApplication = {
open(file, args) { open(file, args) {
if (this.pdfLoadingTask) { if (this.pdfLoadingTask) {
return this.close().then(() => { return this.close().then(() => {
this.preferences.reload();
return this.open(file, args); return this.open(file, args);
}); });
} }
@ -3821,8 +3777,8 @@ class PDFDocumentProperties {
this.pdfDocument.getMetadata().then(({ info, metadata, contentDispositionFilename }) => { this.pdfDocument.getMetadata().then(({ info, metadata, contentDispositionFilename }) => {
return Promise.all([info, metadata, contentDispositionFilename || (0, _ui_utils.getPDFFileNameFromURL)(this.url), this._parseFileSize(this.maybeFileSize), this._parseDate(info.CreationDate), this._parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => { return Promise.all([info, metadata, contentDispositionFilename || (0, _ui_utils.getPDFFileNameFromURL)(this.url), this._parseFileSize(this.maybeFileSize), this._parseDate(info.CreationDate), this._parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {
return this._parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation); return this._parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation);
})]); }), this._parseLinearization(info.IsLinearized)]);
}).then(([info, metadata, fileName, fileSize, creationDate, modDate, pageSize]) => { }).then(([info, metadata, fileName, fileSize, creationDate, modDate, pageSize, isLinearized]) => {
freezeFieldData({ freezeFieldData({
'fileName': fileName, 'fileName': fileName,
'fileSize': fileSize, 'fileSize': fileSize,
@ -3837,6 +3793,7 @@ class PDFDocumentProperties {
'version': info.PDFFormatVersion, 'version': info.PDFFormatVersion,
'pageCount': this.pdfDocument.numPages, 'pageCount': this.pdfDocument.numPages,
'pageSize': pageSize, 'pageSize': pageSize,
'linearized': isLinearized,
'_currentPageNumber': currentPageNumber, '_currentPageNumber': currentPageNumber,
'_pagesRotation': pagesRotation '_pagesRotation': pagesRotation
}); });
@ -4001,6 +3958,9 @@ class PDFDocumentProperties {
time: timeString time: timeString
}, '{{date}}, {{time}}'); }, '{{date}}, {{time}}');
} }
_parseLinearization(isLinearized) {
return this.l10n.get('document_properties_linearized_' + (isLinearized ? 'yes' : 'no'), null, isLinearized ? 'Yes' : 'No');
}
} }
exports.PDFDocumentProperties = PDFDocumentProperties; exports.PDFDocumentProperties = PDFDocumentProperties;
@ -9113,9 +9073,17 @@ class BasePreferences {
}); });
this.prefs = Object.assign(Object.create(null), defaults); this.prefs = Object.assign(Object.create(null), defaults);
return this._readFromStorage(defaults); return this._readFromStorage(defaults);
}).then(prefObj => { }).then(prefs => {
if (prefObj) { if (!prefs) {
this.prefs = prefObj; return;
}
for (let name in prefs) {
const defaultValue = this.defaults[name],
prefValue = prefs[name];
if (defaultValue === undefined || typeof prefValue !== typeof defaultValue) {
continue;
}
this.prefs[name] = prefValue;
} }
}); });
} }
@ -9131,15 +9099,6 @@ class BasePreferences {
return this._writeToStorage(this.defaults); return this._writeToStorage(this.defaults);
}); });
} }
reload() {
return this._initializedPromise.then(() => {
return this._readFromStorage(this.defaults);
}).then(prefObj => {
if (prefObj) {
this.prefs = prefObj;
}
});
}
set(name, value) { set(name, value) {
return this._initializedPromise.then(() => { return this._initializedPromise.then(() => {
if (this.defaults[name] === undefined) { if (this.defaults[name] === undefined) {
@ -9178,6 +9137,11 @@ class BasePreferences {
return defaultValue; return defaultValue;
}); });
} }
getAll() {
return this._initializedPromise.then(() => {
return Object.assign(Object.create(null), this.defaults, this.prefs);
});
}
} }
exports.BasePreferences = BasePreferences; exports.BasePreferences = BasePreferences;

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

@ -20,7 +20,7 @@ origin:
# Human-readable identifier for this version/release # Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS" # Generally "version NNN", "tag SSS", "bookmark SSS"
release: version 2.0.688 release: version 2.0.719
# The package's license, where possible using the mnemonic from # The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/ # https://spdx.org/licenses/

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

@ -120,6 +120,11 @@ document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}}
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by # "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page. # the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}}) document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
# LOCALIZATION NOTE (document_properties_linearized): The linearization status of
# the document; usually called "Fast Web View" in English locales of Adobe software.
document_properties_linearized=Fast Web View:
document_properties_linearized_yes=Yes
document_properties_linearized_no=No
document_properties_close=Close document_properties_close=Close
print_progress_message=Preparing document for printing… print_progress_message=Preparing document for printing…

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

@ -132,9 +132,7 @@ var BlockedSiteContent = {
reason = "harmful"; reason = "harmful";
} }
let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = ownerDoc.defaultView.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
global.sendAsyncMessage("Browser:SiteBlockedError", { global.sendAsyncMessage("Browser:SiteBlockedError", {
location: ownerDoc.location.href, location: ownerDoc.location.href,

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

@ -37,8 +37,7 @@ var gDecoderDoctorObserver = function(subject, topic, data) {
}; };
function getMessageManagerForWindow(aContentWindow) { function getMessageManagerForWindow(aContentWindow) {
let ir = aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor) let ir = aContentWindow.docShell
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor); .QueryInterface(Ci.nsIInterfaceRequestor);
try { try {

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

@ -419,17 +419,10 @@ function getInnerWindowIDForWindow(aContentWindow) {
} }
function getMessageManagerForWindow(aContentWindow) { function getMessageManagerForWindow(aContentWindow) {
aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor); let docShell = aContentWindow.docShell;
if (!docShell) {
let docShell; // Closed tab.
try { return null;
// This throws NS_NOINTERFACE for closed tabs.
docShell = aContentWindow.getInterface(Ci.nsIDocShell);
} catch (e) {
if (e.result == Cr.NS_NOINTERFACE) {
return null;
}
throw e;
} }
let ir = docShell.sameTypeRootTreeItem let ir = docShell.sameTypeRootTreeItem

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

@ -36,10 +36,8 @@ FormSubmitObserver.prototype =
this._content = aWindow; this._content = aWindow;
this._tab = aTabChildGlobal; this._tab = aTabChildGlobal;
this._mm = this._mm =
this._content.QueryInterface(Ci.nsIInterfaceRequestor) this._content.docShell
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);

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

@ -51,8 +51,7 @@ var LightWeightThemeWebInstallListener = {
}; };
function getMessageManagerForContent(content) { function getMessageManagerForContent(content) {
return content.QueryInterface(Ci.nsIInterfaceRequestor) return content.docShell
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);

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

@ -41,8 +41,7 @@ var LightweightThemeChildHelper = {
const windowEnumerator = Services.ww.getWindowEnumerator(); const windowEnumerator = Services.ww.getWindowEnumerator();
while (windowEnumerator.hasMoreElements()) { while (windowEnumerator.hasMoreElements()) {
const window = windowEnumerator.getNext().QueryInterface(Ci.nsIDOMWindow); const window = windowEnumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
const tabChildGlobal = window.QueryInterface(Ci.nsIInterfaceRequestor) const tabChildGlobal = window.docShell
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);

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

@ -408,12 +408,7 @@ var PermissionPromptForRequestPrototype = {
if (this.request.element) { if (this.request.element) {
return this.request.element; return this.request.element;
} }
return this.request return this.request.window.docShell.chromeEventHandler;
.window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
}, },
get principal() { get principal() {

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

@ -429,10 +429,7 @@ TabWindow.prototype = {
}, },
createTabPreview(controller) { createTabPreview(controller) {
let docShell = this.win let docShell = this.win.docShell;
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let preview = AeroPeek.taskbar.createTaskbarTabPreview(docShell, controller); let preview = AeroPeek.taskbar.createTaskbarTabPreview(docShell, controller);
preview.visible = AeroPeek.enabled; preview.visible = AeroPeek.enabled;
preview.active = this.tabbrowser.selectedTab == controller.tab; preview.active = this.tabbrowser.selectedTab == controller.tab;

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

@ -5,8 +5,8 @@
"use strict"; "use strict";
add_task(async function() { add_task(async function() {
const scale = window.QueryInterface(Ci.nsIInterfaceRequestor) const scale = window.docShell
.getInterface(Ci.nsIDocShell).QueryInterface(Ci.nsIBaseWindow) .QueryInterface(Ci.nsIBaseWindow)
.devicePixelsPerDesktopPixel; .devicePixelsPerDesktopPixel;
let {bounds, rects} = TestRunner._findBoundingBox(["#tabbrowser-tabs"]); let {bounds, rects} = TestRunner._findBoundingBox(["#tabbrowser-tabs"]);
let element = document.querySelector("#tabbrowser-tabs"); let element = document.querySelector("#tabbrowser-tabs");

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

@ -1,49 +0,0 @@
ThinLTO build fix from https://bugs.llvm.org/show_bug.cgi?id=38105#c4 and https://reviews.llvm.org/D49138
--- a/llvm/include/llvm/LTO/LTO.h
+++ b/llvm/include/llvm/LTO/LTO.h
@@ -365,7 +365,7 @@
void addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
ArrayRef<SymbolResolution> Res, unsigned Partition,
- bool InSummary);
+ bool InSummary, const Triple &TT);
// These functions take a range of symbol resolutions [ResI, ResE) and consume
// the resolutions used by a single input module by incrementing ResI. After
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -420,7 +420,8 @@
// their partitions.
void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
ArrayRef<SymbolResolution> Res,
- unsigned Partition, bool InSummary) {
+ unsigned Partition, bool InSummary,
+ const Triple &TT) {
auto *ResI = Res.begin();
auto *ResE = Res.end();
(void)ResE;
@@ -428,7 +429,13 @@
assert(ResI != ResE);
SymbolResolution Res = *ResI++;
- auto &GlobalRes = GlobalResolutions[Sym.getName()];
+ StringRef Name = Sym.getName();
+ // Strip the __imp_ prefix from COFF dllimport symbols (similar to the
+ // way they are handled by lld), otherwise we can end up with two
+ // global resolutions (one with and one for a copy of the symbol without).
+ if (TT.isOSBinFormatCOFF() && Name.startswith("__imp_"))
+ Name = Name.substr(strlen("__imp_"));
+ auto &GlobalRes = GlobalResolutions[Name];
GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();
if (Res.Prevailing) {
assert(!GlobalRes.Prevailing &&
@@ -518,7 +525,7 @@
auto ModSyms = Input.module_symbols(ModI);
addModuleToGlobalRes(ModSyms, {ResI, ResE},
LTOInfo->IsThinLTO ? ThinLTO.ModuleMap.size() + 1 : 0,
- LTOInfo->HasSummary);
+ LTOInfo->HasSummary, Triple(Input.getTargetTriple()));
if (LTOInfo->IsThinLTO)
return addThinLTO(BM, ModSyms, ResI, ResE);

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

@ -1,15 +0,0 @@
ThinLTO build fix from https://bugs.llvm.org/show_bug.cgi?id=38139#c5
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -904,6 +904,9 @@
legacy::PassManagerBase &PM) {
PerformThinLTO = true;
+ if (LibraryInfo)
+ PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
+
if (VerifyInput)
PM.add(createVerifierPass());

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

@ -1,5 +1,5 @@
{ {
"llvm_revision": "336407", "llvm_revision": "338614",
"stages": "3", "stages": "3",
"build_libcxx": false, "build_libcxx": false,
"build_type": "Release", "build_type": "Release",
@ -14,8 +14,6 @@
"cxx": "cl.exe", "cxx": "cl.exe",
"ml": "ml64.exe", "ml": "ml64.exe",
"patches": [ "patches": [
"bug38139.patch",
"bug38105.patch",
"loosen-msvc-detection.patch" "loosen-msvc-detection.patch"
] ]
} }

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

@ -872,6 +872,7 @@ add_old_configure_assignment('CPU_ARCH', target.cpu)
set_config('INTEL_ARCHITECTURE', target_variables.INTEL_ARCHITECTURE) set_config('INTEL_ARCHITECTURE', target_variables.INTEL_ARCHITECTURE)
set_config('TARGET_CPU', target.raw_cpu) set_config('TARGET_CPU', target.raw_cpu)
set_config('TARGET_OS', target.raw_os) set_config('TARGET_OS', target.raw_os)
set_config('TARGET_ENDIANNESS', target.endianness)
@depends(host) @depends(host)

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

@ -65,6 +65,7 @@ mozilla.pth:testing/web-platform/tests/tools/wptserve
mozilla.pth:testing/web-platform/tests/tools/six mozilla.pth:testing/web-platform/tests/tools/six
mozilla.pth:testing/xpcshell mozilla.pth:testing/xpcshell
mozilla.pth:third_party/python/mock-1.0.0 mozilla.pth:third_party/python/mock-1.0.0
mozilla.pth:xpcom/ds/tools
mozilla.pth:xpcom/typelib/xpt/tools mozilla.pth:xpcom/typelib/xpt/tools
mozilla.pth:tools/docs mozilla.pth:tools/docs
mozilla.pth:third_party/python/cbor2 mozilla.pth:third_party/python/cbor2

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

@ -51,11 +51,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840488
// pageshow events don't fire on the iframe element, so we need to use the // pageshow events don't fire on the iframe element, so we need to use the
// chrome event handler for the docshell. // chrome event handler for the docshell.
var browser = ifr.contentWindow var browser = ifr.contentWindow.docShell.chromeEventHandler;
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
function onpageshow(evt) { function onpageshow(evt) {
info("Navigated back. Persisted: " + evt.persisted); info("Navigated back. Persisted: " + evt.persisted);
browser.removeEventListener('pageshow', onpageshow); browser.removeEventListener('pageshow', onpageshow);
@ -89,9 +85,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840488
} }
function setScriptEnabledForDocShell(win, enabled) { function setScriptEnabledForDocShell(win, enabled) {
win.QueryInterface(Ci.nsIInterfaceRequestor) win.docShell.allowJavascript = enabled;
.getInterface(Ci.nsIDocShell)
.allowJavascript = enabled;
} }
function testList(expectEnabled, win, list, idx) { function testList(expectEnabled, win, list, idx) {

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

@ -32,7 +32,7 @@ dist_xpcrs_dir := $(DIST)/xpcrs
process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
generated_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp generated_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp
code_gen_py := $(topsrcdir)/xpcom/reflect/xptinfo/xptcodegen.py code_gen_py := $(topsrcdir)/xpcom/reflect/xptinfo/xptcodegen.py
code_gen_deps := $(topsrcdir)/xpcom/reflect/xptinfo/perfecthash.py code_gen_deps := $(topsrcdir)/xpcom/ds/tools/perfecthash.py
# TODO we should use py_action, but that would require extra directories to be # TODO we should use py_action, but that would require extra directories to be
# in the virtualenv. # in the virtualenv.

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

@ -23,9 +23,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
info("Setting docShell.deviceSizeIsPageSize to false"); info("Setting docShell.deviceSizeIsPageSize to false");
await ContentTask.spawn(ui.getViewportBrowser(), {}, async function() { await ContentTask.spawn(ui.getViewportBrowser(), {}, async function() {
const docShell = content.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = content.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.deviceSizeIsPageSize = false; docShell.deviceSizeIsPageSize = false;
}); });

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

@ -143,9 +143,7 @@ DOMHelpers.prototype = {
*/ */
onceDOMReady: function Helpers_onLocationChange(callback, targetURL) { onceDOMReady: function Helpers_onLocationChange(callback, targetURL) {
const window = this.window; const window = this.window;
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
const onReady = function(event) { const onReady = function(event) {
if (event.target == window.document) { if (event.target == window.document) {
docShell.chromeEventHandler.removeEventListener("DOMContentLoaded", onReady); docShell.chromeEventHandler.removeEventListener("DOMContentLoaded", onReady);

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

@ -454,9 +454,7 @@ var TestActor = exports.TestActor = protocol.ActorClassWithSpec(testSpec, {
resolve(); resolve();
} }
const docShell = this.content.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = this.content.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.contentViewer.fullZoom = level; docShell.contentViewer.fullZoom = level;
}); });
}, },

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

@ -4,7 +4,6 @@
"use strict"; "use strict";
const { Ci } = require("chrome");
const Services = require("Services"); const Services = require("Services");
const KeyShortcuts = require("devtools/client/shared/key-shortcuts"); const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
@ -26,9 +25,7 @@ exports.register = function(window) {
const shortcuts = new KeyShortcuts({ const shortcuts = new KeyShortcuts({
window window
}); });
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
const contViewer = docShell.contentViewer; const contViewer = docShell.contentViewer;
let zoomValue = parseFloat(Services.prefs.getCharPref(ZOOM_PREF)); let zoomValue = parseFloat(Services.prefs.getCharPref(ZOOM_PREF));
const zoomIn = function(event) { const zoomIn = function(event) {

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

@ -192,9 +192,7 @@ exports.createContextMenu = createContextMenu;
* @returns {Menu} * @returns {Menu}
*/ */
function createEditContextMenu() { function createEditContextMenu() {
const docshell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docshell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
const menu = new Menu({ const menu = new Menu({
id: "webconsole-menu" id: "webconsole-menu"
}); });

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

@ -91,10 +91,7 @@ var UI = {
this.setupDeck(); this.setupDeck();
this.contentViewer = window.QueryInterface(Ci.nsIInterfaceRequestor) this.contentViewer = window.docShell.contentViewer;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.contentViewer;
this.contentViewer.fullZoom = Services.prefs.getCharPref("devtools.webide.zoom"); this.contentViewer.fullZoom = Services.prefs.getCharPref("devtools.webide.zoom");
gDevToolsBrowser.isWebIDEInitialized.resolve(); gDevToolsBrowser.isWebIDEInitialized.resolve();

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

@ -20,10 +20,7 @@
(async function() { (async function() {
let win = await openWebIDE(); let win = await openWebIDE();
let viewer = win.QueryInterface(Ci.nsIInterfaceRequestor) let viewer = win.docShell.contentViewer;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.contentViewer;
win.Cmds.zoomOut(); win.Cmds.zoomOut();
win.Cmds.zoomOut(); win.Cmds.zoomOut();
@ -55,10 +52,7 @@
await closeWebIDE(win); await closeWebIDE(win);
win = await openWebIDE(); win = await openWebIDE();
viewer = win.QueryInterface(Ci.nsIInterfaceRequestor) viewer = win.docShell.contentViewer;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.contentViewer;
roundZoom = Math.round(10 * viewer.fullZoom) / 10; roundZoom = Math.round(10 * viewer.fullZoom) / 10;
is(roundZoom, 1.4, "Zoom restored"); is(roundZoom, 1.4, "Zoom restored");

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

@ -92,9 +92,7 @@ function logAccessDeniedWarning(window, callerInfo, extensionPolicy) {
} }
function CustomizedReload(params) { function CustomizedReload(params) {
this.docShell = params.targetActor.window this.docShell = params.targetActor.window.docShell;
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell);
this.docShell.QueryInterface(Ci.nsIWebProgress); this.docShell.QueryInterface(Ci.nsIWebProgress);
this.inspectedWindowEval = params.inspectedWindowEval; this.inspectedWindowEval = params.inspectedWindowEval;
@ -173,9 +171,7 @@ CustomizedReload.prototype = {
return; return;
} }
const subjectDocShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const subjectDocShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
// Keep track of the set of window objects where we are going to inject // Keep track of the set of window objects where we are going to inject
// the injectedScript: the top level window and all its descendant // the injectedScript: the top level window and all its descendant

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

@ -640,9 +640,7 @@ HighlighterEnvironment.prototype = {
get docShell() { get docShell() {
return this.window && return this.window &&
this.window.QueryInterface(Ci.nsIInterfaceRequestor) this.window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
}, },
get webProgress() { get webProgress() {

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

@ -430,20 +430,14 @@ class ReflowObserver extends Observable {
_startListeners(windows) { _startListeners(windows) {
for (const window of windows) { for (const window of windows) {
const docshell = window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell.addWeakReflowObserver(this);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docshell.addWeakReflowObserver(this);
} }
} }
_stopListeners(windows) { _stopListeners(windows) {
for (const window of windows) { for (const window of windows) {
try { try {
const docshell = window.QueryInterface(Ci.nsIInterfaceRequestor) window.docShell.removeWeakReflowObserver(this);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docshell.removeWeakReflowObserver(this);
} catch (e) { } catch (e) {
// Corner cases where a global has already been freed may happen, in // Corner cases where a global has already been freed may happen, in
// which case, no need to remove the observer. // which case, no need to remove the observer.

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

@ -402,16 +402,15 @@ const SourceActor = ActorClassWithSpec(sourceSpec, {
let principal, cacheKey; let principal, cacheKey;
// On xpcshell, we don't have a window but a Sandbox // On xpcshell, we don't have a window but a Sandbox
if (!isWorker && win instanceof Ci.nsIDOMWindow) { if (!isWorker && win instanceof Ci.nsIDOMWindow) {
const webNav = win.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = win.docShell;
.getInterface(Ci.nsIWebNavigation); const channel = docShell.currentDocumentChannel;
const channel = webNav.currentDocumentChannel;
principal = channel.loadInfo.loadingPrincipal; principal = channel.loadInfo.loadingPrincipal;
// Retrieve the cacheKey in order to load POST requests from cache // Retrieve the cacheKey in order to load POST requests from cache
// Note that chrome:// URLs don't support this interface. // Note that chrome:// URLs don't support this interface.
if (loadFromCache && if (loadFromCache &&
webNav.currentDocumentChannel instanceof Ci.nsICacheInfoChannel) { docShell.currentDocumentChannel instanceof Ci.nsICacheInfoChannel) {
cacheKey = webNav.currentDocumentChannel.cacheKey; cacheKey = docShell.currentDocumentChannel.cacheKey;
} }
} }

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

@ -395,9 +395,7 @@ const browsingContextTargetPrototype = {
return this.docShell; return this.docShell;
} }
return this._originalWindow.QueryInterface(Ci.nsIInterfaceRequestor) return this._originalWindow.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
}, },
/** /**
@ -424,9 +422,7 @@ const browsingContextTargetPrototype = {
* Getter for the nsIWebNavigation for the target. * Getter for the nsIWebNavigation for the target.
*/ */
get webNavigation() { get webNavigation() {
return this.docShell return this.docShell.QueryInterface(Ci.nsIWebNavigation);
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
}, },
/** /**
@ -1216,9 +1212,7 @@ const browsingContextTargetPrototype = {
}, },
_setWindow(window) { _setWindow(window) {
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
// Here is the very important call where we switch the currently targeted // Here is the very important call where we switch the currently targeted
// browsing context (it will indirectly update this.window and many other // browsing context (it will indirectly update this.window and many other
// attributes defined from docShell). // attributes defined from docShell).

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

@ -54,8 +54,7 @@ const chromeWindowTargetPrototype = extend({}, browsingContextTargetPrototype);
chromeWindowTargetPrototype.initialize = function(connection, window) { chromeWindowTargetPrototype.initialize = function(connection, window) {
BrowsingContextTargetActor.prototype.initialize.call(this, connection); BrowsingContextTargetActor.prototype.initialize.call(this, connection);
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIDocShell);
Object.defineProperty(this, "docShell", { Object.defineProperty(this, "docShell", {
value: docShell, value: docShell,
configurable: true configurable: true

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

@ -42,8 +42,7 @@ function ContentProcessTargetActor(connection) {
const windowEnumerator = Services.ww.getWindowEnumerator(); const windowEnumerator = Services.ww.getWindowEnumerator();
while (windowEnumerator.hasMoreElements()) { while (windowEnumerator.hasMoreElements()) {
const window = windowEnumerator.getNext().QueryInterface(Ci.nsIDOMWindow); const window = windowEnumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
const tabChildGlobal = window.QueryInterface(Ci.nsIInterfaceRequestor) const tabChildGlobal = window.docShell
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem .sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager); .getInterface(Ci.nsIContentFrameMessageManager);

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

@ -76,9 +76,7 @@ parentProcessTargetPrototype.initialize = function(connection) {
} }
// On XPCShell, there is no window/docshell // On XPCShell, there is no window/docshell
const docShell = window ? window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window ? window.docShell : null;
.getInterface(Ci.nsIDocShell)
: null;
Object.defineProperty(this, "docShell", { Object.defineProperty(this, "docShell", {
value: docShell, value: docShell,
configurable: true configurable: true
@ -98,9 +96,7 @@ Object.defineProperty(parentProcessTargetPrototype, "docShells", {
const e = Services.ww.getWindowEnumerator(); const e = Services.ww.getWindowEnumerator();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
const window = e.getNext(); const window = e.getNext();
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShells = docShells.concat(getChildDocShells(docShell)); docShells = docShells.concat(getChildDocShells(docShell));
} }
@ -138,9 +134,7 @@ parentProcessTargetPrototype._attach = function() {
const e = Services.ww.getWindowEnumerator(); const e = Services.ww.getWindowEnumerator();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
const window = e.getNext(); const window = e.getNext();
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
if (docShell == this.docShell) { if (docShell == this.docShell) {
continue; continue;
} }
@ -161,9 +155,7 @@ parentProcessTargetPrototype._detach = function() {
const e = Services.ww.getWindowEnumerator(); const e = Services.ww.getWindowEnumerator();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
const window = e.getNext(); const window = e.getNext();
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
if (docShell == this.docShell) { if (docShell == this.docShell) {
continue; continue;
} }

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

@ -1922,9 +1922,7 @@ WebConsoleActor.prototype =
chromeWindow: function() { chromeWindow: function() {
let window = null; let window = null;
try { try {
window = this.window.QueryInterface(Ci.nsIInterfaceRequestor) window = this.window.docShell.chromeEventHandler.ownerGlobal;
.getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShell)
.chromeEventHandler.ownerGlobal;
} catch (ex) { } catch (ex) {
// The above can fail because chromeEventHandler is not available for all // The above can fail because chromeEventHandler is not available for all
// kinds of |this.window|. // kinds of |this.window|.

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

@ -379,9 +379,7 @@ ConsoleAPIListener.prototype =
*/ */
function ConsoleReflowListener(window, listener) { function ConsoleReflowListener(window, listener) {
this.docshell = window.QueryInterface(Ci.nsIInterfaceRequestor) this.docshell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
this.listener = listener; this.listener = listener;
this.docshell.addWeakReflowObserver(this); this.docshell.addWeakReflowObserver(this);
} }

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

@ -315,9 +315,7 @@ Timeline.prototype = {
*/ */
_onWindowReady: function({ window }) { _onWindowReady: function({ window }) {
if (this._isRecording) { if (this._isRecording) {
const docShell = window.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = window.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.recordProfileTimelineMarkers = true; docShell.recordProfileTimelineMarkers = true;
} }
}, },

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

@ -546,8 +546,7 @@ function mainThreadFetch(urlIn, aOptions = { loadFromCache: true,
if (aOptions.window) { if (aOptions.window) {
// Respect private browsing. // Respect private browsing.
channel.loadGroup = aOptions.window.QueryInterface(Ci.nsIInterfaceRequestor) channel.loadGroup = aOptions.window.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocumentLoader) .QueryInterface(Ci.nsIDocumentLoader)
.loadGroup; .loadGroup;
} }

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

@ -373,9 +373,7 @@ function saveToClipboard(context, reply) {
}); });
const input = channel.open2(); const input = channel.open2();
const loadContext = context.environment.chromeWindow const loadContext = context.environment.chromeWindow.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext); .QueryInterface(Ci.nsILoadContext);
const callback = { const callback = {

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

@ -41,9 +41,7 @@ function utilsFor(win) {
* @return {DOMWindow} * @return {DOMWindow}
*/ */
function getTopWindow(win) { function getTopWindow(win) {
const docShell = win.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = win.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
if (!docShell.isMozBrowser) { if (!docShell.isMozBrowser) {
return win.top; return win.top;
@ -102,9 +100,7 @@ function getParentWindow(win) {
return null; return null;
} }
const docShell = win.QueryInterface(Ci.nsIInterfaceRequestor) const docShell = win.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
if (!docShell.isMozBrowser) { if (!docShell.isMozBrowser) {
return win.parent; return win.parent;

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

@ -1341,8 +1341,7 @@ NetworkMonitor.prototype = {
// function is called for image requests as well but these // function is called for image requests as well but these
// are not web pages and as such don't store the posted text // are not web pages and as such don't store the posted text
// in the cache of the webpage. // in the cache of the webpage.
const webNav = this.window.QueryInterface(Ci.nsIInterfaceRequestor) const webNav = this.window.docShell.QueryInterface(Ci.nsIWebNavigation);
.getInterface(Ci.nsIWebNavigation);
sentBody = NetworkHelper sentBody = NetworkHelper
.readPostTextFromPageViaWebNav(webNav, httpActivity.charset); .readPostTextFromPageViaWebNav(webNav, httpActivity.charset);
} }
@ -2113,9 +2112,7 @@ ConsoleProgressListener.prototype = {
return; return;
} }
this._webProgress = this.window.QueryInterface(Ci.nsIInterfaceRequestor) this._webProgress = this.window.docShell.QueryInterface(Ci.nsIWebProgress);
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIWebProgress);
this._webProgress.addProgressListener(this, this._webProgress.addProgressListener(this,
Ci.nsIWebProgress.NOTIFY_STATE_ALL); Ci.nsIWebProgress.NOTIFY_STATE_ALL);

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

@ -19,8 +19,8 @@ add_task(async function test() {
ok(oldTitle, 'Content window should initially have a title.'); ok(oldTitle, 'Content window should initially have a title.');
cw.history.pushState('', '', 'new_page'); cw.history.pushState('', '', 'new_page');
let shistory = cw.QueryInterface(Ci.nsIInterfaceRequestor) let shistory = cw.docShell
.getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
is(shistory.legacySHistory.getEntryAtIndex(shistory.index, false).title, is(shistory.legacySHistory.getEntryAtIndex(shistory.index, false).title,

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

@ -34,9 +34,8 @@ function test() {
return; return;
iframe.removeEventListener('load', listener, true); iframe.removeEventListener('load', listener, true);
let shistory = content let shistory = content.docShell
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIWebNavigation)
.getInterface(Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
Assert.equal(shistory.count, 1, "shistory count should be 1."); Assert.equal(shistory.count, 1, "shistory count should be 1.");

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

@ -22,9 +22,7 @@ async function test_body() {
"touchEventsOverride flag should be changed to DISABLED"); "touchEventsOverride flag should be changed to DISABLED");
let frameWin = content.document.querySelector("#test-iframe").contentWindow; let frameWin = content.document.querySelector("#test-iframe").contentWindow;
docshell = frameWin.QueryInterface(Ci.nsIInterfaceRequestor) docshell = frameWin.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED, is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"touchEventsOverride flag should be passed on to frames."); "touchEventsOverride flag should be passed on to frames.");
@ -32,18 +30,14 @@ async function test_body() {
content.document.body.appendChild(newFrame); content.document.body.appendChild(newFrame);
let newFrameWin = newFrame.contentWindow; let newFrameWin = newFrame.contentWindow;
docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor) docshell = newFrameWin.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED, is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"Newly created frames should use the new touchEventsOverride flag"); "Newly created frames should use the new touchEventsOverride flag");
newFrameWin.location.reload(); newFrameWin.location.reload();
await ContentTaskUtils.waitForEvent(newFrameWin, "load"); await ContentTaskUtils.waitForEvent(newFrameWin, "load");
docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor) docshell = newFrameWin.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED, is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"New touchEventsOverride flag should persist across reloads"); "New touchEventsOverride flag should persist across reloads");
} }

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

@ -47,9 +47,7 @@ this.finish = function() {
*/ */
this.timelineContentTest = function(tests) { this.timelineContentTest = function(tests) {
(async function() { (async function() {
let docShell = content.QueryInterface(Ci.nsIInterfaceRequestor) let docShell = content.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
info("Start recording"); info("Start recording");
docShell.recordProfileTimelineMarkers = true; docShell.recordProfileTimelineMarkers = true;

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

@ -87,12 +87,10 @@
doPageNavigation(navData); doPageNavigation(navData);
yield undefined; yield undefined;
var docshell = TestWindow.getWindow() var docshell = TestWindow.getWindow().docShell;
.QueryInterface(Ci.nsIInterfaceRequestor) var shistory = docshell.QueryInterface(Ci.nsIWebNavigation)
.getInterface(Ci.nsIWebNavigation) .sessionHistory
.QueryInterface(Ci.nsIDocShell); .legacySHistory
var shistory = docshell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISHistory)
.QueryInterface(Ci.nsIWebNavigation); .QueryInterface(Ci.nsIWebNavigation);
// Reload. // Reload.

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

@ -16,10 +16,7 @@
let SimpleTest = opener.wrappedJSObject.SimpleTest; let SimpleTest = opener.wrappedJSObject.SimpleTest;
function getDocShellType(frame) { function getDocShellType(frame) {
return frame.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) return frame.contentWindow.docShell.itemType;
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIDocShellTreeItem)
.itemType;
} }
var normalFrame = document.getElementById("normalFrame"); var normalFrame = document.getElementById("normalFrame");

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

@ -26,26 +26,19 @@ var tests = [
// downloadable stops loading. // downloadable stops loading.
function basic() { function basic() {
var iframe = insertIframe(); var iframe = insertIframe();
docshellForWindow(iframe.contentWindow).allowContentRetargeting = false; iframe.contentWindow.docShell.allowContentRetargeting = false;
loadIframe(iframe); loadIframe(iframe);
}, },
// Set allowContentRetargeting = false on parent docshell, load a downloadable // Set allowContentRetargeting = false on parent docshell, load a downloadable
// URL, verify the downloadable stops loading. // URL, verify the downloadable stops loading.
function inherit() { function inherit() {
var docshell = docshellForWindow(window); var docshell = window.docShell;
docshell.allowContentRetargeting = false; docshell.allowContentRetargeting = false;
loadIframe(insertIframe()); loadIframe(insertIframe());
}, },
]; ];
function docshellForWindow(win) {
return win.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShell);
}
function insertIframe() { function insertIframe() {
var iframe = document.createElement("iframe"); var iframe = document.createElement("iframe");
document.body.appendChild(iframe); document.body.appendChild(iframe);
@ -54,7 +47,7 @@ function insertIframe() {
function loadIframe(iframe) { function loadIframe(iframe) {
iframe.setAttribute("src", TEST_URL); iframe.setAttribute("src", TEST_URL);
docshellForWindow(iframe.contentWindow). iframe.contentWindow.docShell.
QueryInterface(Ci.nsIInterfaceRequestor). QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebProgress). getInterface(Ci.nsIWebProgress).
addProgressListener(progressListener, addProgressListener(progressListener,

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

@ -30,7 +30,7 @@ var TEST_URL = "http://mochi.test:8888/chrome/docshell/test/chrome/bug909218.htm
function test() { function test() {
var iframe = document.createElement("iframe"); var iframe = document.createElement("iframe");
document.body.appendChild(iframe); document.body.appendChild(iframe);
var docShell = docshellForWindow(iframe.contentWindow); var docShell = iframe.contentWindow.docShell;
// Add our progress listener - when it notices the top-level document is // Add our progress listener - when it notices the top-level document is
// complete, the test will end. // complete, the test will end.
RequestWatcher.init(docShell, SimpleTest.finish); RequestWatcher.init(docShell, SimpleTest.finish);
@ -115,13 +115,6 @@ RequestWatcher = {
]) ])
} }
function docshellForWindow(win) {
return win.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShell);
}
</script> </script>
</head> </head>
</html> </html>

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

@ -63,8 +63,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=624883
Ci.nsISupportsWeakReference]) Ci.nsISupportsWeakReference])
}; };
frame.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor) frame.contentWindow.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress) .getInterface(Ci.nsIWebProgress)
.addProgressListener(progressListener, .addProgressListener(progressListener,

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

@ -109,9 +109,7 @@ function xpcEnumerateContentWindows(callback) {
while (enumerator.hasMoreElements()) { while (enumerator.hasMoreElements()) {
var win = enumerator.getNext(); var win = enumerator.getNext();
if (win.isChromeWindow) { if (win.isChromeWindow) {
var docshellTreeNode = win.QueryInterface(Ci.nsIInterfaceRequestor) var docshellTreeNode = win.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem);
var childCount = docshellTreeNode.childCount; var childCount = docshellTreeNode.childCount;
for (var i = 0; i < childCount; ++i) { for (var i = 0; i < childCount; ++i) {
var childTreeNode = docshellTreeNode.getChildAt(i); var childTreeNode = docshellTreeNode.getChildAt(i);

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

@ -95,9 +95,7 @@ function step3() {
Assert.equal(content.frames.length, 2, "Tab 2 should have 2 iframes"); Assert.equal(content.frames.length, 2, "Tab 2 should have 2 iframes");
for (var i = 0; i < content.frames.length; i++) { for (var i = 0; i < content.frames.length; i++) {
info("step 3, frame " + i + " info: " + content.frames[i].location); info("step 3, frame " + i + " info: " + content.frames[i].location);
let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.frames[i].docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`); Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
} }
@ -115,9 +113,7 @@ function step4() {
function checkTab2Active(expected) { function checkTab2Active(expected) {
return ContentTask.spawn(ctx.tab2Browser, expected, async function(expected) { return ContentTask.spawn(ctx.tab2Browser, expected, async function(expected) {
function isActive(aWindow) { function isActive(aWindow) {
var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) var docshell = aWindow.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
return docshell.isActive; return docshell.isActive;
} }
@ -165,9 +161,7 @@ function step5() {
ok(ctx.tab2Browser.docShellIsActive, "Tab 2 should be active"); ok(ctx.tab2Browser.docShellIsActive, "Tab 2 should be active");
ContentTask.spawn(ctx.tab2Browser, null, async function() { ContentTask.spawn(ctx.tab2Browser, null, async function() {
for (var i = 0; i < content.frames.length; i++) { for (var i = 0; i < content.frames.length; i++) {
let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.frames[i].docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
Assert.ok(docShell.isActive, `Tab2 iframe ${i} should be active`); Assert.ok(docShell.isActive, `Tab2 iframe ${i} should be active`);
} }
@ -191,9 +185,7 @@ function step6() {
ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active"); ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
ContentTask.spawn(ctx.tab1Browser, null, async function() { ContentTask.spawn(ctx.tab1Browser, null, async function() {
function isActive(aWindow) { function isActive(aWindow) {
var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) var docshell = aWindow.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
return docshell.isActive; return docshell.isActive;
} }
@ -204,9 +196,7 @@ function step6() {
ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive"); ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
return ContentTask.spawn(ctx.tab2Browser, null, async function() { return ContentTask.spawn(ctx.tab2Browser, null, async function() {
for (var i = 0; i < content.frames.length; i++) { for (var i = 0; i < content.frames.length; i++) {
let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor) let docshell = content.frames[i].docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`); Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
} }
@ -223,9 +213,7 @@ function step7() {
return ContentTask.spawn(browser, { tabNum, active }, return ContentTask.spawn(browser, { tabNum, active },
async function({ tabNum, active }) { async function({ tabNum, active }) {
function isActive(aWindow) { function isActive(aWindow) {
var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) var docshell = aWindow.docShell;
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
return docshell.isActive; return docshell.isActive;
} }

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

@ -25,9 +25,7 @@ add_task(async function() {
BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser); BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser);
let win = await openedPromise; let win = await openedPromise;
let chromeFlags = win.QueryInterface(Ci.nsIInterfaceRequestor) let chromeFlags = win.docShell
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner .treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor) .QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow) .getInterface(Ci.nsIXULWindow)

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

@ -25,8 +25,8 @@
*/ */
let Ci = SpecialPowers.Ci; let Ci = SpecialPowers.Ci;
let webNav = SpecialPowers.wrap(window) let webNav = SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor) .docShell
.getInterface(Ci.nsIWebNavigation); .QueryInterface(Ci.nsIWebNavigation);
let shistory = webNav.sessionHistory; let shistory = webNav.sessionHistory;
let testSteps = [ let testSteps = [
function() { function() {

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

@ -9,8 +9,8 @@
<script> <script>
let Ci = SpecialPowers.Ci; let Ci = SpecialPowers.Ci;
let webNav = SpecialPowers.wrap(window) let webNav = SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor) .docShell
.getInterface(Ci.nsIWebNavigation); .QueryInterface(Ci.nsIWebNavigation);
let shistory = webNav.sessionHistory; let shistory = webNav.sessionHistory;
function test() { function test() {
if (opener) { if (opener) {

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

@ -22,8 +22,8 @@
}, },
async function() { async function() {
let webNav = SpecialPowers.wrap(window) let webNav = SpecialPowers.wrap(window)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) .docShell
.getInterface(SpecialPowers.Ci.nsIWebNavigation); .QueryInterface(SpecialPowers.Ci.nsIWebNavigation);
let shistory = webNav.sessionHistory; let shistory = webNav.sessionHistory;
opener.is(webNav.canGoForward, true, 'canGoForward'); opener.is(webNav.canGoForward, true, 'canGoForward');
opener.is(shistory.index, 4, 'shistory.index'); opener.is(shistory.index, 4, 'shistory.index');
@ -44,11 +44,10 @@
window.location = 'goback.html'; window.location = 'goback.html';
}, },
async function() { async function() {
let windowWrap = SpecialPowers.wrap(window) let windowWrap = SpecialPowers.wrap(window);
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor); let docShell = windowWrap.docShell;
let docShell = windowWrap.getInterface(SpecialPowers.Ci.nsIDocShell); let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
let shistory = windowWrap.getInterface(SpecialPowers.Ci.nsIWebNavigation) .sessionHistory;
.sessionHistory;
// Now staticFrame has frame0 -> frame1 -> frame2. // Now staticFrame has frame0 -> frame1 -> frame2.
opener.is(docShell.previousTransIndex, 3, 'docShell.previousTransIndex'); opener.is(docShell.previousTransIndex, 3, 'docShell.previousTransIndex');
opener.is(docShell.loadedTransIndex, 2, 'docShell.loadedTransIndex'); opener.is(docShell.loadedTransIndex, 2, 'docShell.loadedTransIndex');
@ -104,11 +103,10 @@
window.location = 'file_bug1326251_evict_cache.html'; window.location = 'file_bug1326251_evict_cache.html';
}, },
async function() { async function() {
let windowWrap = SpecialPowers.wrap(window) let windowWrap = SpecialPowers.wrap(window);
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor); let docShell = windowWrap.docShell;
let docShell = windowWrap.getInterface(SpecialPowers.Ci.nsIDocShell); let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
let shistory = windowWrap.getInterface(SpecialPowers.Ci.nsIWebNavigation) .sessionHistory;
.sessionHistory;
// staticFrame: frame0 -> frame1 -> frame2 -> iframe_static // staticFrame: frame0 -> frame1 -> frame2 -> iframe_static
// innerStaticFrame: frame0 -> frame1 // innerStaticFrame: frame0 -> frame1
opener.is(docShell.previousTransIndex, 5, 'docShell.previousTransIndex'); opener.is(docShell.previousTransIndex, 5, 'docShell.previousTransIndex');

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

@ -9,8 +9,8 @@
// Evict bfcache and then go back. // Evict bfcache and then go back.
async function evictCache() { async function evictCache() {
let shistory = SpecialPowers.wrap(window) let shistory = SpecialPowers.wrap(window)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) .docShell
.getInterface(SpecialPowers.Ci.nsIWebNavigation) .QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
let shPrivate = shistory.legacySHistory.QueryInterface(SpecialPowers.Ci.nsISHistoryInternal); let shPrivate = shistory.legacySHistory.QueryInterface(SpecialPowers.Ci.nsISHistoryInternal);
shPrivate.evictAllContentViewers(); shPrivate.evictAllContentViewers();

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

@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375833
ok(e.data.endsWith("file_bug1375833-frame2.html"), "check location"); ok(e.data.endsWith("file_bug1375833-frame2.html"), "check location");
webNav = SpecialPowers.wrap(testWin) webNav = SpecialPowers.wrap(testWin)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) .docShell
.getInterface(SpecialPowers.Ci.nsIWebNavigation); .QueryInterface(SpecialPowers.Ci.nsIWebNavigation);
shistory = webNav.sessionHistory; shistory = webNav.sessionHistory;
is(shistory.count, 2, "check history length"); is(shistory.count, 2, "check history length");
is(shistory.index, 1, "check history index"); is(shistory.index, 1, "check history index");
@ -82,9 +82,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375833
}); });
function getFrameDocShell() { function getFrameDocShell() {
return SpecialPowers.wrap(testWin.window[0]) return SpecialPowers.wrap(testWin.window[0]).docShell;
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDocShell)
} }
</script> </script>

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

@ -71,8 +71,8 @@ function* runTest() {
yield undefined; yield undefined;
var sh = SpecialPowers.wrap(popup) var sh = SpecialPowers.wrap(popup)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) .docShell
.getInterface(SpecialPowers.Ci.nsIWebNavigation) .QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
// Get the title of the inner popup's current SHEntry // Get the title of the inner popup's current SHEntry

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

@ -96,8 +96,8 @@ function page2PageShow()
function dumpSHistory(theWindow) function dumpSHistory(theWindow)
{ {
let sh = SpecialPowers.wrap(theWindow).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) let sh = SpecialPowers.wrap(theWindow).docShell
.getInterface(SpecialPowers.Ci.nsIWebNavigation) .QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
.sessionHistory; .sessionHistory;
if (!sh) { if (!sh) {
dump(" window has no shistory.\n"); dump(" window has no shistory.\n");

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