зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b5a3e838eaec (bug 1654935) for nsPrintObject.cpp related bustage CLOSED TREE
This commit is contained in:
Родитель
b6115988e8
Коммит
ebb07c5b3a
|
@ -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
|
Загрузка…
Ссылка в новой задаче