Bug 266386

Summary: REGRESSION (Safari 17): Document with break-after:page is printed incorrectly
Product: WebKit Reporter: ayasdewe
Component: PrintingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: ap, richard_robinson2, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: All   
OS: iOS 17   
Attachments:
Description Flags
screenshoot while print in Safari 17 when use break-after:page;
none
naive test case, not reproducing the issue none

Description ayasdewe 2023-12-13 18:41:14 PST
break-after : page; not working in Safari 17

When the printing process is carried out, the page cannot be made into 2 or more pages
Comment 1 ayasdewe 2023-12-13 18:45:31 PST
Created attachment 469032 [details]
screenshoot while print in Safari 17 when use break-after:page;
Comment 2 Alexey Proskuryakov 2023-12-13 20:08:43 PST
Created attachment 469034 [details]
naive test case, not reproducing the issue
Comment 3 Alexey Proskuryakov 2023-12-13 20:10:33 PST
Thank you for the report. I cannot reproduce this with the above test case. 

Could you please provide steps to reproduce that we could follow, including a test case at a publicly accessible URL?
Comment 4 ayasdewe 2023-12-13 22:25:14 PST
(In reply to Alexey Proskuryakov from comment #3)
> Thank you for the report. I cannot reproduce this with the above test case. 
> 
> Could you please provide steps to reproduce that we could follow, including
> a test case at a publicly accessible URL?

https://klinikrespirasimalang.com/pdf/tampil.php?f=resep1-16398-AlanLukitoGunawan.pdf&t=resep

This is a website that I created to display PDF results and print them. When printed, it should produce 2 pages. For other browsers it can still use this code, but for Safari 17 it can't, the output is like the one in the attached image above.
Comment 5 Alexey Proskuryakov 2023-12-14 08:33:20 PST
Thank you! I can reproduce in iOS 17.2, and this works correctly in iOS 16.7.2. I can also reproduce on macOS.

It looks like page break happens correctly, but positioning the content on the paper is wrong, so the second page is partly printed on the first sheet.

Additionally (and it may need a separate investigation), I sometimes only get one page on print preview, not two.

Please keep the test page up for investigation, as we don't have a reduced test case yet.
Comment 6 Radar WebKit Bug Importer 2023-12-14 08:33:31 PST
<rdar://problem/119669466>
Comment 7 ayasdewe 2023-12-14 16:36:35 PST
(In reply to Alexey Proskuryakov from comment #5)
> Thank you! I can reproduce in iOS 17.2, and this works correctly in iOS
> 16.7.2. I can also reproduce on macOS.
> 
> It looks like page break happens correctly, but positioning the content on
> the paper is wrong, so the second page is partly printed on the first sheet.
> 
> Additionally (and it may need a separate investigation), I sometimes only
> get one page on print preview, not two.
> 
> Please keep the test page up for investigation, as we don't have a reduced
> test case yet.

That's right, previously it wasn't a problem, then one of the users updated iOS to version 17 and then this case appeared

For other users can still use this code