Closed Bug 1710822 Opened 3 years ago Closed 2 years ago

Image not visible when printing from iframe with srcdoc

Categories

(Core :: Printing: Output, defect)

Firefox 88
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: vrichter, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image firefox.jpg

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

I create an iframe with a srcdoc set as single image element. The img element's src is set to a path that doesn't have the domain name. So something like <iframe srcdoc="<img src=&quot;/image.png&quot;>">. I then get a reference to the iframe and try to print its contents with myiframe.contentWindow.print().

Actual results:

In the browser, the image is visible within the iframe. In the print-preview, the image is not shown. The print process completes successfully. However, the result (using "Save to PDF ") appears to be missing the image.

Expected results:

The print-preview and resulting pdf should contain the image referenced in the iframe.
This works with my versions of chromium-browser, microsoft-edge & opera.

Attached file 1345588.html

Such a problem was previously reported and fixed in
https://bugzilla.mozilla.org/show_bug.cgi?id=1345588

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Printing: Output
Product: Firefox → Core
Assignee: nobody → emilio
Status: UNCONFIRMED → NEW
Ever confirmed: true
Regressed by: 1648064
Has Regression Range: --- → yes

So that we correctly avoid choosing about:srcdoc as a base URI.

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28979 for changes under testing/web-platform/tests
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7baec26f3e18
Copy mIsSrcdocDocument for print clones. r=smaug
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Upstream PR merged by moz-wptsync-bot

Hi,

I still can reproduce the error with my user agent.

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Ah, my patch fixed the image when printing the top-level page, not when printing the iframe itself via window.print(). Let's fix that in a separate bug, so that tracking it isn't confusing.

Status: REOPENED → RESOLVED
Closed: 3 years ago2 years ago
Resolution: --- → FIXED
Blocks: 1752298
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: