forked from mirrors/gecko-dev
Backed out changeset 6036b8acdab5 (bug 1284395) for asserting in ChromeUtils::IsOriginAttributesEqualIgnoringAddonId at nsDocShell.cpp:8007 for Windows debug builds. r=backout
This commit is contained in:
parent
8abbf66ced
commit
e183b1ce5d
11 changed files with 15 additions and 104 deletions
|
|
@ -1128,7 +1128,6 @@ var gBrowserInit = {
|
||||||
// [4]: allowThirdPartyFixup (bool)
|
// [4]: allowThirdPartyFixup (bool)
|
||||||
// [5]: referrerPolicy (int)
|
// [5]: referrerPolicy (int)
|
||||||
// [6]: userContextId (int)
|
// [6]: userContextId (int)
|
||||||
// [7]: originPrincipal (nsIPrincipal)
|
|
||||||
else if (window.arguments.length >= 3) {
|
else if (window.arguments.length >= 3) {
|
||||||
let referrerURI = window.arguments[2];
|
let referrerURI = window.arguments[2];
|
||||||
if (typeof(referrerURI) == "string") {
|
if (typeof(referrerURI) == "string") {
|
||||||
|
|
@ -1143,10 +1142,7 @@ var gBrowserInit = {
|
||||||
let userContextId = (window.arguments[6] != undefined ?
|
let userContextId = (window.arguments[6] != undefined ?
|
||||||
window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
|
window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
|
||||||
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
|
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
|
||||||
window.arguments[4] || false, referrerPolicy, userContextId,
|
window.arguments[4] || false, referrerPolicy, userContextId);
|
||||||
// pass the origin principal (if any) and force its use to create
|
|
||||||
// an initial about:blank viewer if present:
|
|
||||||
window.arguments[7], !!window.arguments[7]);
|
|
||||||
window.focus();
|
window.focus();
|
||||||
}
|
}
|
||||||
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
|
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
|
||||||
|
|
@ -2037,17 +2033,14 @@ function BrowserTryToCloseWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
||||||
userContextId, originPrincipal, forceAboutBlankViewerInCurrent) {
|
userContextId) {
|
||||||
try {
|
try {
|
||||||
openLinkIn(uri, "current",
|
openLinkIn(uri, "current",
|
||||||
{ referrerURI: referrer,
|
{ referrerURI: referrer,
|
||||||
referrerPolicy: referrerPolicy,
|
referrerPolicy: referrerPolicy,
|
||||||
postData: postData,
|
postData: postData,
|
||||||
allowThirdPartyFixup: allowThirdPartyFixup,
|
allowThirdPartyFixup: allowThirdPartyFixup,
|
||||||
userContextId: userContextId,
|
userContextId: userContextId });
|
||||||
originPrincipal,
|
|
||||||
forceAboutBlankViewerInCurrent,
|
|
||||||
});
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5577,14 +5570,11 @@ function handleLinkClick(event, href, linkNode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
urlSecurityCheck(href, doc.nodePrincipal);
|
urlSecurityCheck(href, doc.nodePrincipal);
|
||||||
let params = {
|
let params = { charset: doc.characterSet,
|
||||||
charset: doc.characterSet,
|
allowMixedContent: persistAllowMixedContentInChildTab,
|
||||||
allowMixedContent: persistAllowMixedContentInChildTab,
|
referrerURI: referrerURI,
|
||||||
referrerURI: referrerURI,
|
referrerPolicy: referrerPolicy,
|
||||||
referrerPolicy: referrerPolicy,
|
noReferrer: BrowserUtils.linkHasNoReferrer(linkNode) };
|
||||||
noReferrer: BrowserUtils.linkHasNoReferrer(linkNode),
|
|
||||||
originPrincipal: doc.nodePrincipal,
|
|
||||||
};
|
|
||||||
|
|
||||||
// The new tab/window must use the same userContextId
|
// The new tab/window must use the same userContextId
|
||||||
if (doc.nodePrincipal.originAttributes.userContextId) {
|
if (doc.nodePrincipal.originAttributes.userContextId) {
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,6 @@ var ClickEventHandler = {
|
||||||
json.allowMixedContent = true;
|
json.allowMixedContent = true;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
json.originPrincipal = ownerDoc.nodePrincipal;
|
|
||||||
|
|
||||||
sendAsyncMessage("Content:Click", json);
|
sendAsyncMessage("Content:Click", json);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -965,7 +965,6 @@ nsContextMenu.prototype = {
|
||||||
|
|
||||||
_openLinkInParameters : function (extra) {
|
_openLinkInParameters : function (extra) {
|
||||||
let params = { charset: gContextMenuContentData.charSet,
|
let params = { charset: gContextMenuContentData.charSet,
|
||||||
originPrincipal: this.principal,
|
|
||||||
referrerURI: gContextMenuContentData.documentURIObject,
|
referrerURI: gContextMenuContentData.documentURIObject,
|
||||||
referrerPolicy: gContextMenuContentData.referrerPolicy,
|
referrerPolicy: gContextMenuContentData.referrerPolicy,
|
||||||
noReferrer: this.linkHasNoReferrer };
|
noReferrer: this.linkHasNoReferrer };
|
||||||
|
|
|
||||||
|
|
@ -1500,7 +1500,6 @@
|
||||||
var aNoReferrer;
|
var aNoReferrer;
|
||||||
var aUserContextId;
|
var aUserContextId;
|
||||||
var aRelatedBrowser;
|
var aRelatedBrowser;
|
||||||
var aOriginPrincipal;
|
|
||||||
if (arguments.length == 2 &&
|
if (arguments.length == 2 &&
|
||||||
typeof arguments[1] == "object" &&
|
typeof arguments[1] == "object" &&
|
||||||
!(arguments[1] instanceof Ci.nsIURI)) {
|
!(arguments[1] instanceof Ci.nsIURI)) {
|
||||||
|
|
@ -1519,7 +1518,6 @@
|
||||||
aNoReferrer = params.noReferrer;
|
aNoReferrer = params.noReferrer;
|
||||||
aUserContextId = params.userContextId;
|
aUserContextId = params.userContextId;
|
||||||
aRelatedBrowser = params.relatedBrowser;
|
aRelatedBrowser = params.relatedBrowser;
|
||||||
aOriginPrincipal = params.originPrincipal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
|
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
|
||||||
|
|
@ -1539,7 +1537,6 @@
|
||||||
forceNotRemote: aForceNotRemote,
|
forceNotRemote: aForceNotRemote,
|
||||||
noReferrer: aNoReferrer,
|
noReferrer: aNoReferrer,
|
||||||
userContextId: aUserContextId,
|
userContextId: aUserContextId,
|
||||||
originPrincipal: aOriginPrincipal,
|
|
||||||
relatedBrowser: aRelatedBrowser });
|
relatedBrowser: aRelatedBrowser });
|
||||||
if (!bgLoad)
|
if (!bgLoad)
|
||||||
this.selectedTab = tab;
|
this.selectedTab = tab;
|
||||||
|
|
@ -1997,7 +1994,6 @@
|
||||||
var aUserContextId;
|
var aUserContextId;
|
||||||
var aEventDetail;
|
var aEventDetail;
|
||||||
var aRelatedBrowser;
|
var aRelatedBrowser;
|
||||||
var aOriginPrincipal;
|
|
||||||
if (arguments.length == 2 &&
|
if (arguments.length == 2 &&
|
||||||
typeof arguments[1] == "object" &&
|
typeof arguments[1] == "object" &&
|
||||||
!(arguments[1] instanceof Ci.nsIURI)) {
|
!(arguments[1] instanceof Ci.nsIURI)) {
|
||||||
|
|
@ -2017,7 +2013,6 @@
|
||||||
aUserContextId = params.userContextId;
|
aUserContextId = params.userContextId;
|
||||||
aEventDetail = params.eventDetail;
|
aEventDetail = params.eventDetail;
|
||||||
aRelatedBrowser = params.relatedBrowser;
|
aRelatedBrowser = params.relatedBrowser;
|
||||||
aOriginPrincipal = params.originPrincipal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we're adding tabs, we're past interrupt mode, ditch the owner
|
// if we're adding tabs, we're past interrupt mode, ditch the owner
|
||||||
|
|
@ -2097,10 +2092,6 @@
|
||||||
var evt = new CustomEvent("TabOpen", { bubbles: true, detail });
|
var evt = new CustomEvent("TabOpen", { bubbles: true, detail });
|
||||||
t.dispatchEvent(evt);
|
t.dispatchEvent(evt);
|
||||||
|
|
||||||
if (!usingPreloadedContent && aOriginPrincipal) {
|
|
||||||
b.createAboutBlankContentViewer(aOriginPrincipal);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we didn't swap docShells with a preloaded browser
|
// If we didn't swap docShells with a preloaded browser
|
||||||
// then let's just continue loading the page normally.
|
// then let's just continue loading the page normally.
|
||||||
if (!usingPreloadedContent && !uriIsAboutBlank) {
|
if (!usingPreloadedContent && !uriIsAboutBlank) {
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,6 @@ subsuite = clipboard
|
||||||
[browser_mixed_content_cert_override.js]
|
[browser_mixed_content_cert_override.js]
|
||||||
[browser_mixedcontent_securityflags.js]
|
[browser_mixedcontent_securityflags.js]
|
||||||
tags = mcb
|
tags = mcb
|
||||||
[browser_modifiedclick_inherit_principal.js]
|
|
||||||
[browser_offlineQuotaNotification.js]
|
[browser_offlineQuotaNotification.js]
|
||||||
skip-if = buildapp == 'mulet'
|
skip-if = buildapp == 'mulet'
|
||||||
[browser_feed_discovery.js]
|
[browser_feed_discovery.js]
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const kURL =
|
|
||||||
"http://example.com/browser/browser/base/content/test/general/dummy_page.html";
|
|
||||||
"data:text/html,<a href=''>Middle-click me</a>";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check that when manually opening content JS links in new tabs/windows,
|
|
||||||
* we use the correct principal, and we don't clear the URL bar.
|
|
||||||
*/
|
|
||||||
add_task(function* () {
|
|
||||||
yield BrowserTestUtils.withNewTab(kURL, function* (browser) {
|
|
||||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
|
|
||||||
yield ContentTask.spawn(browser, null, function* () {
|
|
||||||
let a = content.document.createElement("a");
|
|
||||||
a.href = "javascript:document.write('spoof'); void(0);";
|
|
||||||
a.textContent = "Some link";
|
|
||||||
content.document.body.appendChild(a);
|
|
||||||
});
|
|
||||||
info("Added element");
|
|
||||||
yield BrowserTestUtils.synthesizeMouseAtCenter("a", {button: 1}, browser);
|
|
||||||
let newTab = yield newTabPromise;
|
|
||||||
is(newTab.linkedBrowser.contentPrincipal.origin, "http://example.com",
|
|
||||||
"Principal should be for example.com");
|
|
||||||
yield BrowserTestUtils.switchTab(gBrowser, newTab);
|
|
||||||
info(gURLBar.value);
|
|
||||||
isnot(gURLBar.value, "", "URL bar should not be empty.");
|
|
||||||
yield BrowserTestUtils.removeTab(newTab);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -222,9 +222,6 @@ function openLinkIn(url, where, params) {
|
||||||
var aAllowPopups = !!params.allowPopups;
|
var aAllowPopups = !!params.allowPopups;
|
||||||
var aUserContextId = params.userContextId;
|
var aUserContextId = params.userContextId;
|
||||||
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
|
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
|
||||||
var aPrincipal = params.originPrincipal;
|
|
||||||
var aForceAboutBlankViewerInCurrent =
|
|
||||||
params.forceAboutBlankViewerInCurrent;
|
|
||||||
|
|
||||||
if (where == "save") {
|
if (where == "save") {
|
||||||
// TODO(1073187): propagate referrerPolicy.
|
// TODO(1073187): propagate referrerPolicy.
|
||||||
|
|
@ -293,7 +290,6 @@ function openLinkIn(url, where, params) {
|
||||||
sa.AppendElement(allowThirdPartyFixupSupports);
|
sa.AppendElement(allowThirdPartyFixupSupports);
|
||||||
sa.AppendElement(referrerPolicySupports);
|
sa.AppendElement(referrerPolicySupports);
|
||||||
sa.AppendElement(userContextIdSupports);
|
sa.AppendElement(userContextIdSupports);
|
||||||
sa.AppendElement(aPrincipal);
|
|
||||||
|
|
||||||
let features = "chrome,dialog=no,all";
|
let features = "chrome,dialog=no,all";
|
||||||
if (aIsPrivate) {
|
if (aIsPrivate) {
|
||||||
|
|
@ -361,10 +357,6 @@ function openLinkIn(url, where, params) {
|
||||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
|
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aForceAboutBlankViewerInCurrent) {
|
|
||||||
w.gBrowser.selectedBrowser.createAboutBlankContentViewer(aPrincipal);
|
|
||||||
}
|
|
||||||
|
|
||||||
w.gBrowser.loadURIWithFlags(url, {
|
w.gBrowser.loadURIWithFlags(url, {
|
||||||
flags: flags,
|
flags: flags,
|
||||||
referrerURI: aNoReferrer ? null : aReferrerURI,
|
referrerURI: aNoReferrer ? null : aReferrerURI,
|
||||||
|
|
@ -388,8 +380,7 @@ function openLinkIn(url, where, params) {
|
||||||
skipAnimation: aSkipTabAnimation,
|
skipAnimation: aSkipTabAnimation,
|
||||||
allowMixedContent: aAllowMixedContent,
|
allowMixedContent: aAllowMixedContent,
|
||||||
noReferrer: aNoReferrer,
|
noReferrer: aNoReferrer,
|
||||||
userContextId: aUserContextId,
|
userContextId: aUserContextId
|
||||||
originPrincipal: aPrincipal,
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,15 +77,12 @@ var ContentClick = {
|
||||||
|
|
||||||
// Todo(903022): code for where == save
|
// Todo(903022): code for where == save
|
||||||
|
|
||||||
let params = {
|
let params = { charset: browser.characterSet,
|
||||||
charset: browser.characterSet,
|
referrerURI: browser.documentURI,
|
||||||
referrerURI: browser.documentURI,
|
referrerPolicy: json.referrerPolicy,
|
||||||
referrerPolicy: json.referrerPolicy,
|
noReferrer: json.noReferrer,
|
||||||
noReferrer: json.noReferrer,
|
allowMixedContent: json.allowMixedContent,
|
||||||
allowMixedContent: json.allowMixedContent,
|
isContentWindowPrivate: json.isContentWindowPrivate};
|
||||||
isContentWindowPrivate: json.isContentWindowPrivate,
|
|
||||||
originPrincipal: json.originPrincipal,
|
|
||||||
};
|
|
||||||
|
|
||||||
// The new tab/window must use the same userContextId.
|
// The new tab/window must use the same userContextId.
|
||||||
if (json.originAttributes.userContextId) {
|
if (json.originAttributes.userContextId) {
|
||||||
|
|
|
||||||
|
|
@ -565,13 +565,6 @@ addMessageListener("Browser:Thumbnail:GetOriginalURL", function (aMessage) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Remote createAboutBlankContentViewer request handler.
|
|
||||||
*/
|
|
||||||
addMessageListener("Browser:CreateAboutBlank", function(aMessage) {
|
|
||||||
docShell.createAboutBlankContentViewer(aMessage.data);
|
|
||||||
});
|
|
||||||
|
|
||||||
// The AddonsChild needs to be rooted so that it stays alive as long as
|
// The AddonsChild needs to be rooted so that it stays alive as long as
|
||||||
// the tab.
|
// the tab.
|
||||||
var AddonsChild = RemoteAddonsChild.init(this);
|
var AddonsChild = RemoteAddonsChild.init(this);
|
||||||
|
|
|
||||||
|
|
@ -1038,15 +1038,6 @@
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
<method name="createAboutBlankContentViewer">
|
|
||||||
<parameter name="aPrincipal"/>
|
|
||||||
<body>
|
|
||||||
<![CDATA[
|
|
||||||
this.docShell.createAboutBlankContentViewer(aPrincipal);
|
|
||||||
]]>
|
|
||||||
</body>
|
|
||||||
</method>
|
|
||||||
|
|
||||||
<field name="_AUTOSCROLL_SNAP">10</field>
|
<field name="_AUTOSCROLL_SNAP">10</field>
|
||||||
<field name="_scrolling">false</field>
|
<field name="_scrolling">false</field>
|
||||||
<field name="_startX">null</field>
|
<field name="_startX">null</field>
|
||||||
|
|
|
||||||
|
|
@ -561,15 +561,6 @@
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
<method name="createAboutBlankContentViewer">
|
|
||||||
<parameter name="aPrincipal"/>
|
|
||||||
<body>
|
|
||||||
<![CDATA[
|
|
||||||
this.messageManager.sendAsyncMessage("Browser:CreateAboutBlank", aPrincipal);
|
|
||||||
]]>
|
|
||||||
</body>
|
|
||||||
</method>
|
|
||||||
</implementation>
|
</implementation>
|
||||||
<handlers>
|
<handlers>
|
||||||
<handler event="dragstart">
|
<handler event="dragstart">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue