Bug 237656

Summary: IFrame Content only prints if IFrame is in viewport
Product: WebKit Reporter: Trevor Fayas <tfayas>
Component: PrintingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: tfayas
Priority: P2 Keywords: Regression
Version: WebKit Nightly Build   
Hardware: PC   
OS: Windows 8   
Attachments:
Description Flags
Screen shot and sample HTML file that shows the issue none

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:

&lt;h1&gt;This iframe will print because it&#39;s in viewport&lt;/h1&gt;
&lt;iframe src=&quot;https://via.placeholder.com/600&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/iframe&gt;
&lt;div style=&quot;height: 5000px;&quot;&gt;Spacer to push other iframe lower on page&lt;/div&gt;
&lt;h1&gt;This iframe won&#39;t print because it&#39;s out of viewport&lt;/h1&gt;
&lt;iframe src=&quot;https://via.placeholder.com/600&quot; width=&quot;600&quot; height=&quot;600&quot;&gt;&lt;/iframe&gt;
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.