Backed out changeset b5a3e838eaec (bug 1654935) for nsPrintObject.cpp related bustage CLOSED TREE

This commit is contained in:
Bogdan Tara 2020-08-04 22:21:45 +03:00
Родитель b6115988e8
Коммит ebb07c5b3a
5 изменённых файлов: 0 добавлений и 65 удалений

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

@ -206,20 +206,6 @@ nsresult nsPrintObject::InitAsRootObject(nsIDocShell* aDocShell, Document* aDoc,
mozilla::Unused << nsDocShell::Cast(mDocShell)->GetDocument();
}
// If we are cloning from a document in a different BrowsingContext, we need
// to make sure to copy over our opener policy information from that
// BrowsingContext.
BrowsingContext* targetBC = mDocShell->GetBrowsingContext();
BrowsingContext* sourceBC = aDoc->GetBrowsingContext();
NS_ENSURE_STATE(sourceBC);
if (targetBC != sourceBC) {
MOZ_ASSERT(targetBC->IsTopContent());
// In the case where the source is an iframe, this information needs to be
// copied from the toplevel source BrowsingContext, as we may be making a
// static clone of a single subframe.
targetBC->SetOpenerPolicy(sourceBC->Top()->GetOpenerPolicy());
}
mDocument = aDoc->CreateStaticClone(mDocShell);
NS_ENSURE_STATE(mDocument);
mHasSelection = CachePrintSelectionRanges(*aDoc, *mDocument);

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

@ -18,11 +18,6 @@ support-files =
simplifyNonArticleSample.html
skip-if = os == "mac" || (verify && (os == 'win' || os == 'linux'))
[browser_preview_print_coop.js]
support-files =
file_coop_header.html
file_coop_header.html^headers^
[browser_preview_switch_print_selected.js]
support-files =
simplifyArticleSample.html

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

@ -1,39 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"https://example.com"
);
/**
* Verify if the page with a COOP header can be used for printing preview.
*/
add_task(async function test() {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
`${TEST_PATH}file_coop_header.html`
);
// Enter print preview
let ppBrowser = PrintPreviewListener.getPrintPreviewBrowser();
let printPreviewEntered = BrowserTestUtils.waitForMessage(
ppBrowser.messageManager,
"Printing:Preview:Entered"
);
document.getElementById("cmd_printPreview").doCommand();
await printPreviewEntered;
await BrowserTestUtils.waitForCondition(
() => gInPrintPreviewMode,
"Should be in print preview mode now."
);
ok(true, "We did not crash.");
PrintUtils.exitPrintPreview();
BrowserTestUtils.removeTab(tab);
});

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

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<p>Hello world</p>
</body>
</html>

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

@ -1 +0,0 @@
Cross-Origin-Opener-Policy: same-origin