Cross origin iframe’s content is not displayed while using window.print() with fission enabled
Categories
(Core :: Print Preview, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: emilghitta, Assigned: emilio)
References
(Blocks 1 open bug)
Details
(Whiteboard: [print2020][old-ui+])
Attachments
(3 files)
Affected versions
- Firefox 84.0a1 (BuildId:20201108212832)
Affected platforms
- Windows 10 64bit
- Ubuntu 20.04 64bit
- macOS 10.14
Preconditions
Enable the following prefs:
fission.autostart
gfx.webrender.all
Steps to reproduce
- Launch Firefox.
- Access the following link.
- Open the web console and input
window.print()
.
Expected result
- The print preview is displayed and the content from the Cross origin Iframe is successfully displayed.
Actual result
- The print preview is displayed and the content from the Cross origin Iframe is not displayed. The actual print output seems to be affected as well.
Regression Window
- I'll further investigate asap.
Additional Information
- Please observe the attached screenshot for further information regarding this issue.
- [Suggested Severity] S3
- This issue is reproducible only with Fission enabled.
- The old UI seems to be affected as well (this can be visible on Windows & Linux by opening the print preview via the hamburger menu).
- This issue doesn’t seem to be reproducible on the new ui while opening the print preview via the hamburger menu, CTR+P or via menu bar print option.
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Seems like a regression because I thought cross-origin iframes were working in print preview, but now I don't recall testing with window.print()
. ni? to Emilio.
Assignee | ||
Comment 2•4 years ago
|
||
Hmm yeah, not sure why window.print() would be different. Ctrl+P works just fine.
Assignee | ||
Comment 3•4 years ago
|
||
So this seems to be a race between the docshell swap that happens when window.print "swaps" into our dialog, and the process swap... If I delay enough the docshell swap like this, then it works:
diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js
index cb09179c7146..5e45f88fae30 100644
--- a/toolkit/components/printing/content/printUtils.js
+++ b/toolkit/components/printing/content/printUtils.js
@@ -216,6 +216,8 @@ var PrintUtils = {
return Promise.reject();
}
+ await new Promise(resolve => setTimeout(() => resolve(), 1000));
+
// Create a preview browser.
let args = PromptUtils.objectToPropBag({
previewBrowser: aExistingPreviewBrowser,
Not sure yet where things are going wrong, though here's a pernosco recording of the problem: https://pernos.co/debug/WWLjbsuKOPlwmRh0pBKX7A/index.html
Assignee | ||
Comment 4•4 years ago
|
||
This doesn't fix the root cause of the issue, but it does fix the issue,
and I think it's worth it, because it's both less work, and less brittle
code (not involving swapDocShells() is always a win in any context).
I'll file a bug for the original problem (which is a Gecko race with the
compositor).
I had to tweak some tests because we insert the preview browser sooner
now, and abortAllDialogs() and such only work after the frame's
DOMContentLoaded event has fired.
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Moving my ni? to bug 1676721, where I'll keep digging on the root cause.
Assignee | ||
Comment 6•4 years ago
|
||
As there's no incremental reflow for non-print documents, we can't rely
on FinishReflow getting called.
Not ultra-pretty, better ideas welcome.
Assignee | ||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
It looks fixed now, but I still want to land the swapDocShells change, which would be a nice simplification.
Comment 11•4 years ago
|
||
Moving to Fission Future as the issue is now fixed and only a nice-to-have simplification is left.
Updated•4 years ago
|
Comment 12•3 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:emilio, maybe it's time to close this bug?
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•