зеркало из https://github.com/mozilla/gecko-dev.git
Bug 980766 - [e10s] Send document content type to remote-browser.xml (r=felipe)
This commit is contained in:
Родитель
28f31675e3
Коммит
f03d9fc63e
|
@ -3497,15 +3497,17 @@ var XULBrowserWindow = {
|
|||
const nsIWebProgressListener = Ci.nsIWebProgressListener;
|
||||
const nsIChannel = Ci.nsIChannel;
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
||||
if (aStateFlags & nsIWebProgressListener.STATE_START &&
|
||||
aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
|
||||
|
||||
if (aRequest && aWebProgress.isTopLevel) {
|
||||
// clear out feed data
|
||||
gBrowser.selectedBrowser.feeds = null;
|
||||
browser.feeds = null;
|
||||
|
||||
// clear out search-engine data
|
||||
gBrowser.selectedBrowser.engines = null;
|
||||
browser.engines = null;
|
||||
}
|
||||
|
||||
this.isBusy = true;
|
||||
|
@ -3546,7 +3548,7 @@ var XULBrowserWindow = {
|
|||
this.setDefaultStatus(msg);
|
||||
|
||||
// Disable menu entries for images, enable otherwise
|
||||
if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
|
||||
if (browser.documentContentType && mimeTypeIsTextBased(browser.documentContentType))
|
||||
this.isImage.removeAttribute('disabled');
|
||||
else
|
||||
this.isImage.setAttribute('disabled', 'true');
|
||||
|
@ -3590,8 +3592,10 @@ var XULBrowserWindow = {
|
|||
}
|
||||
}
|
||||
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
||||
// Disable menu entries for images, enable otherwise
|
||||
if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
|
||||
if (browser.documentContentType && mimeTypeIsTextBased(browser.documentContentType))
|
||||
this.isImage.removeAttribute('disabled');
|
||||
else
|
||||
this.isImage.setAttribute('disabled', 'true');
|
||||
|
@ -3605,7 +3609,6 @@ var XULBrowserWindow = {
|
|||
// Update urlbar only if a new page was loaded on the primary content area
|
||||
// Do not update urlbar if there was a subframe navigation
|
||||
|
||||
var browser = gBrowser.selectedBrowser;
|
||||
if (aWebProgress.isTopLevel) {
|
||||
if ((location == "about:blank" && (gMultiProcessBrowser || !content.opener)) ||
|
||||
location == "") { // Second condition is for new tabs, otherwise
|
||||
|
|
|
@ -45,7 +45,8 @@ let WebProgressListener = {
|
|||
isTopLevel: aWebProgress.isTopLevel,
|
||||
isLoadingDocument: aWebProgress.isLoadingDocument,
|
||||
requestURI: this._requestSpec(aRequest),
|
||||
loadType: aWebProgress.loadType
|
||||
loadType: aWebProgress.loadType,
|
||||
documentContentType: content.document && content.document.contentType
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -223,6 +223,10 @@
|
|||
onget="return this.contentDocument.documentURIObject;"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="documentContentType"
|
||||
onget="return this.contentDocument ? this.contentDocument.contentType : null;"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="preferences"
|
||||
onget="return this.mPrefs.QueryInterface(Components.interfaces.nsIPrefService);"
|
||||
readonly="true"/>
|
||||
|
|
|
@ -68,6 +68,8 @@
|
|||
|
||||
<field name="_documentURI">null</field>
|
||||
|
||||
<field name="_documentContentType">null</field>
|
||||
|
||||
<!--
|
||||
Used by session restore to ensure that currentURI is set so
|
||||
that switch-to-tab works before the tab is fully
|
||||
|
@ -85,6 +87,10 @@
|
|||
onget="return this._documentURI;"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="documentContentType"
|
||||
onget="return this._documentContentType;"
|
||||
readonly="true"/>
|
||||
|
||||
<field name="_contentTitle">""</field>
|
||||
|
||||
<property name="contentTitle"
|
||||
|
|
|
@ -152,8 +152,10 @@ RemoteWebProgressManager.prototype = {
|
|||
webProgress._DOMWindow = objects.DOMWindow;
|
||||
webProgress._loadType = json.loadType;
|
||||
|
||||
if (json.isTopLevel)
|
||||
if (json.isTopLevel) {
|
||||
this._browser._contentWindow = objects.contentWindow;
|
||||
this._browser._documentContentType = json.documentContentType;
|
||||
}
|
||||
|
||||
switch (aMessage.name) {
|
||||
case "Content:StateChange":
|
||||
|
|
Загрузка…
Ссылка в новой задаче