Backed out 3 changesets (bug 1109146) for being the likely cause of browser_documentnavigation.js bustage CLOSED TREE

Backed out changeset 77ed89a0e8ba (bug 1109146)
Backed out changeset 65d2a173cb20 (bug 1109146)
Backed out changeset 0212e01c7769 (bug 1109146)
This commit is contained in:
Wes Kocher 2016-07-29 14:48:04 -07:00
parent b353b9c140
commit 456eb8e899
5 changed files with 8 additions and 115 deletions

View File

@ -500,8 +500,7 @@ var ClickEventHandler = {
ctrlKey: event.ctrlKey, metaKey: event.metaKey,
altKey: event.altKey, href: null, title: null,
bookmark: false, referrerPolicy: referrerPolicy,
originAttributes: principal ? principal.originAttributes : {},
isContentWindowPrivate: PrivateBrowsingUtils.isContentWindowPrivate(ownerDoc.defaultView)};
originAttributes: principal ? principal.originAttributes : {} };
if (href) {
try {

View File

@ -280,7 +280,6 @@ subsuite = clipboard
[browser_clipboard_pastefile.js]
[browser_contentAreaClick.js]
skip-if = e10s # Clicks in content don't go through contentAreaClick with e10s.
[browser_contentAltClick.js]
[browser_contextmenu.js]
subsuite = clipboard
tags = fullscreen

View File

@ -1,97 +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/. */
/**
* Test for Bug 1109146.
* The tests opens a new tab and alt + clicks to download files
* and confirms those files are on the download list.
*
* The difference between this and the test "browser_contentAreaClick.js" is that
* the code path in e10s uses ContentClick.jsm instead of browser.js::contentAreaClick() util.
*/
"use strict";
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
"resource://gre/modules/Downloads.jsm");
function setup(){
gPrefService.setBoolPref("browser.altClickSave", true);
let testPage =
'data:text/html,' +
'<p><a id="commonlink" href="http://mochi.test/moz/">Common link</a></p>' +
'<p><math id="mathxlink" xmlns="http://www.w3.org/1998/Math/MathML" xlink:type="simple" xlink:href="http://mochi.test/moz/"><mtext>MathML XLink</mtext></math></p>' +
'<p><svg id="svgxlink" xmlns="http://www.w3.org/2000/svg" width="100px" height="50px" version="1.1"><a xlink:type="simple" xlink:href="http://mochi.test/moz/"><text transform="translate(10, 25)">SVG XLink</text></a></svg></p>';
return BrowserTestUtils.openNewForegroundTab(gBrowser, testPage);
}
function clean_up(){
gBrowser.removeCurrentTab();
gPrefService.clearUserPref("browser.altClickSave");
}
add_task(function* test_alt_click()
{
yield setup();
let downloadList = yield Downloads.getList(Downloads.ALL);
let downloads = [];
let downloadView;
// When the 1 download has been attempted then resolve the promise.
let finishedAllDownloads = new Promise( (resolve)=> {
downloadView = {
onDownloadAdded: function (aDownload) {
downloads.push(aDownload);
downloadList.remove(aDownload); // Remove from download list.
resolve();
},
};
});
yield downloadList.addView(downloadView);
yield BrowserTestUtils.synthesizeMouseAtCenter("#commonlink", {altKey: true}, gBrowser.selectedBrowser);
// Wait for all downloads to be added to the download list
yield finishedAllDownloads;
is(downloads.length, 1, "1 downloads");
is(downloads[0].source.url, "http://mochi.test/moz/", "Downloaded #commonlink element");
clean_up();
});
add_task(function* test_alt_click_on_xlinks()
{
yield setup();
let downloadList = yield Downloads.getList(Downloads.ALL);
let downloads = [];
let downloadView;
// When all 2 downloads have been attempted then resolve the promise.
let finishedAllDownloads = new Promise( (resolve)=> {
downloadView = {
onDownloadAdded: function (aDownload) {
downloads.push(aDownload);
downloadList.remove(aDownload); // Remove from download list.
if (downloads.length==2) {
resolve();
}
},
};
});
yield downloadList.addView(downloadView);
yield BrowserTestUtils.synthesizeMouseAtCenter("#mathxlink", {altKey: true}, gBrowser.selectedBrowser);
yield BrowserTestUtils.synthesizeMouseAtCenter("#svgxlink", {altKey: true}, gBrowser.selectedBrowser);
// Wait for all downloads to be added to the download list
yield finishedAllDownloads;
is(downloads.length, 2, "2 downloads");
is(downloads[0].source.url, "http://mochi.test/moz/", "Downloaded #mathxlink element");
is(downloads[1].source.url, "http://mochi.test/moz/", "Downloaded #svgxlink element");
clean_up();
});

View File

@ -224,20 +224,13 @@ function openLinkIn(url, where, params) {
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
if (where == "save") {
if (!aInitiatingDoc) {
Components.utils.reportError("openUILink/openLinkIn was called with " +
"where == 'save' but without initiatingDoc. See bug 814264.");
return;
}
// TODO(1073187): propagate referrerPolicy.
// ContentClick.jsm passes isContentWindowPrivate for saveURL instead of passing a CPOW initiatingDoc
if ("isContentWindowPrivate" in params) {
saveURL(url, null, null, true, true, aNoReferrer ? null : aReferrerURI, null, params.isContentWindowPrivate);
}
else {
if (!aInitiatingDoc) {
Components.utils.reportError("openUILink/openLinkIn was called with " +
"where == 'save' but without initiatingDoc. See bug 814264.");
return;
}
saveURL(url, null, null, true, true, aNoReferrer ? null : aReferrerURI, aInitiatingDoc);
}
saveURL(url, null, null, true, null, aNoReferrer ? null : aReferrerURI, aInitiatingDoc);
return;
}

View File

@ -81,8 +81,7 @@ var ContentClick = {
referrerURI: browser.documentURI,
referrerPolicy: json.referrerPolicy,
noReferrer: json.noReferrer,
allowMixedContent: json.allowMixedContent,
isContentWindowPrivate: json.isContentWindowPrivate};
allowMixedContent: json.allowMixedContent };
// The new tab/window must use the same userContextId.
if (json.originAttributes.userContextId) {