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() {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
return window.docShell.QueryInterface(Ci.nsILoadContext);
}
/**

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

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

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

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

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

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

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

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

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

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

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

@ -90,6 +90,12 @@ addMessageListener("MixedContent:ReenableProtection", function() {
XPCOMUtils.defineLazyProxy(this, "LightweightThemeChildHelper",
"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([
"about:home",
"about:newtab",
@ -517,3 +523,8 @@ addEventListener("MozAfterPaint", function onFirstNonBlankPaint() {
removeEventListener("MozAfterPaint", onFirstNonBlankPaint);
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
// over all browsers.
if (!gMultiProcessBrowser) {
let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
let browser = aWindow.docShell.chromeEventHandler;
return this.getTabForBrowser(browser);
}
@ -3070,11 +3067,7 @@ window._gBrowser = {
win.windowUtils.suppressAnimation(true);
// Only suppressing window animations isn't enough to avoid
// an empty content area being painted.
let baseWin = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Ci.nsIBaseWindow);
let baseWin = win.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
baseWin.visibility = false;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -76,8 +76,7 @@ function FeedWriter() {
Services.telemetry.scalarAdd("browser.feeds.preview_loaded", 1);
XPCOMUtils.defineLazyGetter(this, "_mm", () =>
this._window.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDocShell).
this._window.docShell.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIContentFrameMessageManager));
}
@ -710,9 +709,7 @@ FeedWriter.prototype = {
* The window of the document invoking the BrowserFeedWriter
*/
_getOriginalURI(aWindow) {
let docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let docShell = aWindow.docShell;
let chan = docShell.currentDocumentChannel;
// 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) {
aProtocol = (aProtocol || "").toLowerCase();
// aBrowserOrWindow must be a window.
let messageManager = aBrowserOrWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
let messageManager = aBrowserOrWindow.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsITabChild)
.messageManager;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -5,9 +5,8 @@ add_task(async function duplicateTab() {
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
await ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let docshell = content.window.docShell
.QueryInterface(Ci.nsIWebNavigation);
let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString());
});
@ -16,9 +15,8 @@ add_task(async function duplicateTab() {
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
await ContentTask.spawn(tab2.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let docshell = content.window.docShell
.QueryInterface(Ci.nsIWebNavigation);
let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0, false);
is(shEntry.docshellID.toString(), docshell.historyID.toString());
});
@ -34,9 +32,8 @@ add_task(async function contentToChromeNavigate() {
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
await ContentTask.spawn(tab.linkedBrowser, null, function() {
let docshell = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let docshell = content.window.docShell
.QueryInterface(Ci.nsIWebNavigation);
let sh = docshell.sessionHistory;
is(sh.count, 1);
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
* 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");
const PREF_TEST_WHITELIST = "browser.uitour.testingOrigins";
const UITOUR_PERMISSION = "uitour";
var UITourListener = {
class UITourListener {
constructor(mm) {
this.mm = mm;
}
handleEvent(event) {
if (!Services.prefs.getBoolPref("browser.uitour.enabled")) {
return;
@ -17,14 +21,14 @@ var UITourListener = {
if (!this.ensureTrustedOrigin()) {
return;
}
addMessageListener("UITour:SendPageCallback", this);
addMessageListener("UITour:SendPageNotification", this);
sendAsyncMessage("UITour:onPageEvent", {
this.mm.addMessageListener("UITour:SendPageCallback", this);
this.mm.addMessageListener("UITour:SendPageNotification", this);
this.mm.sendAsyncMessage("UITour:onPageEvent", {
detail: event.detail,
type: event.type,
pageVisibilityState: content.document.visibilityState,
pageVisibilityState: this.mm.content.document.visibilityState,
});
},
}
isTestingOrigin(aURI) {
if (Services.prefs.getPrefType(PREF_TEST_WHITELIST) != Services.prefs.PREF_STRING) {
@ -43,7 +47,7 @@ var UITourListener = {
}
}
return false;
},
}
// This function is copied from UITour.jsm.
isSafeScheme(aURI) {
@ -55,9 +59,11 @@ var UITourListener = {
return false;
return true;
},
}
ensureTrustedOrigin() {
let {content} = this.mm;
if (content.top != content)
return false;
@ -74,7 +80,7 @@ var UITourListener = {
return true;
return this.isTestingOrigin(uri);
},
}
receiveMessage(aMessage) {
switch (aMessage.name) {
@ -85,21 +91,19 @@ var UITourListener = {
this.sendPageEvent("Notification", aMessage.data);
break;
}
},
}
sendPageEvent(type, detail) {
if (!this.ensureTrustedOrigin()) {
return;
}
let doc = content.document;
let win = this.mm.content;
let eventName = "mozUITour" + type;
let event = new doc.defaultView.CustomEvent(eventName, {
let event = new win.CustomEvent(eventName, {
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/.
EXTRA_JS_MODULES += [
'ContentUITour.jsm',
'UITour.jsm',
]
JAR_MANIFESTS += ['jar.mn']
BROWSER_CHROME_MANIFESTS += [
'test/browser.ini',
]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -356,6 +356,10 @@ See https://github.com/adobe-type-tools/cmap-resources
<div class="row">
<span data-l10n-id="document_properties_page_size">Page Size:</span> <p id="pageSizeField">-</p>
</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">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div>

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

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

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

@ -20,7 +20,7 @@ origin:
# Human-readable identifier for this version/release
# 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
# 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
# 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}})
# 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
print_progress_message=Preparing document for printing…

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

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

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

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

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

@ -419,17 +419,10 @@ function getInnerWindowIDForWindow(aContentWindow) {
}
function getMessageManagerForWindow(aContentWindow) {
aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
let docShell;
try {
// 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 docShell = aContentWindow.docShell;
if (!docShell) {
// Closed tab.
return null;
}
let ir = docShell.sameTypeRootTreeItem

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

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

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

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

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

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

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

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

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

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

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

@ -5,8 +5,8 @@
"use strict";
add_task(async function() {
const scale = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell).QueryInterface(Ci.nsIBaseWindow)
const scale = window.docShell
.QueryInterface(Ci.nsIBaseWindow)
.devicePixelsPerDesktopPixel;
let {bounds, rects} = TestRunner._findBoundingBox(["#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",
"build_libcxx": false,
"build_type": "Release",
@ -14,8 +14,6 @@
"cxx": "cl.exe",
"ml": "ml64.exe",
"patches": [
"bug38139.patch",
"bug38105.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('TARGET_CPU', target.raw_cpu)
set_config('TARGET_OS', target.raw_os)
set_config('TARGET_ENDIANNESS', target.endianness)
@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/xpcshell
mozilla.pth:third_party/python/mock-1.0.0
mozilla.pth:xpcom/ds/tools
mozilla.pth:xpcom/typelib/xpt/tools
mozilla.pth:tools/docs
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
// chrome event handler for the docshell.
var browser = ifr.contentWindow
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
var browser = ifr.contentWindow.docShell.chromeEventHandler;
function onpageshow(evt) {
info("Navigated back. Persisted: " + evt.persisted);
browser.removeEventListener('pageshow', onpageshow);
@ -89,9 +85,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840488
}
function setScriptEnabledForDocShell(win, enabled) {
win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.allowJavascript = enabled;
win.docShell.allowJavascript = enabled;
}
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
generated_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp
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
# in the virtualenv.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -34,9 +34,8 @@ function test() {
return;
iframe.removeEventListener('load', listener, true);
let shistory = content
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
let shistory = content.docShell
.QueryInterface(Ci.nsIWebNavigation)
.sessionHistory;
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");
let frameWin = content.document.querySelector("#test-iframe").contentWindow;
docshell = frameWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docshell = frameWin.docShell;
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"touchEventsOverride flag should be passed on to frames.");
@ -32,18 +30,14 @@ async function test_body() {
content.document.body.appendChild(newFrame);
let newFrameWin = newFrame.contentWindow;
docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docshell = newFrameWin.docShell;
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"Newly created frames should use the new touchEventsOverride flag");
newFrameWin.location.reload();
await ContentTaskUtils.waitForEvent(newFrameWin, "load");
docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docshell = newFrameWin.docShell;
is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
"New touchEventsOverride flag should persist across reloads");
}

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

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

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

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

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

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

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

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

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

@ -30,7 +30,7 @@ var TEST_URL = "http://mochi.test:8888/chrome/docshell/test/chrome/bug909218.htm
function test() {
var iframe = document.createElement("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
// complete, the test will end.
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>
</head>
</html>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -9,8 +9,8 @@
// Evict bfcache and then go back.
async function evictCache() {
let shistory = SpecialPowers.wrap(window)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation)
.docShell
.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
.sessionHistory;
let shPrivate = shistory.legacySHistory.QueryInterface(SpecialPowers.Ci.nsISHistoryInternal);
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");
webNav = SpecialPowers.wrap(testWin)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIWebNavigation);
.docShell
.QueryInterface(SpecialPowers.Ci.nsIWebNavigation);
shistory = webNav.sessionHistory;
is(shistory.count, 2, "check history length");
is(shistory.index, 1, "check history index");
@ -82,9 +82,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375833
});
function getFrameDocShell() {
return SpecialPowers.wrap(testWin.window[0])
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDocShell)
return SpecialPowers.wrap(testWin.window[0]).docShell;
}
</script>

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

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

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

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

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