Bug 237656 - IFrame Content only prints if IFrame is in viewport
Summary: IFrame Content only prints if IFrame is in viewport
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Windows 8
: P2 Normal
Assignee: Nobody
URL:
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2022-03-09 07:31 PST by Trevor Fayas
Modified: 2022-03-09 13:51 PST (History)
1 user (show)

See Also:


Attachments
Screen shot and sample HTML file that shows the issue (55.25 KB, application/x-zip-compressed)
2022-03-09 07:31 PST, Trevor Fayas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Fayas 2022-03-09 07:31:39 PST
Created attachment 454236 [details]
Screen shot and sample HTML file that shows the issue

The content of an iframe on a page will only print if the iframe itself is within the viewport (as in they are looking at it on the screen).  Any iframe that is outside of the screen will not print.  This seems to be a relatively new bug as our client reported it used to work fine.  Firefox works fine, Edge/Chrome do not (Webkit), could not test on safari.  On both Chrome 99 and Edge 99.

To replicate, simply use the below (it's html encoded), or use the attached:

<h1>This iframe will print because it's in viewport</h1>
<iframe src="https://via.placeholder.com/600" width="600" height="600"></iframe>
<div style="height: 5000px;">Spacer to push other iframe lower on page</div>
<h1>This iframe won't print because it's out of viewport</h1>
<iframe src="https://via.placeholder.com/600" width="600" height="600"></iframe>
Comment 1 Alexey Proskuryakov 2022-03-09 13:51:18 PST
Safari works fine. As a reminder, Edge/Chrome use an old WebKit fork from 2013, so they've diverged a lot.