-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: element disappears when cross the bound of the PDF footer #12301
Comments
The issue has been labeled as confirmed by the automatic analyser. |
I believe styling the footer this way relies on the internal implementation of the footer so you need to expect the default styles https://source.chromium.org/chromium/chromium/src/+/main:components/printing/resources/print_header_footer_template_page.html;l=13;drc=f6529c7990744370869e4ab2794caae6c46ba044 To make sure, it does not break in the future, I'd recommend only styling the content inside the footer. |
Tested, it doesn't make a difference as long as at least a part of an element is caught outside of the footer area.
|
I am able to reproduce and I not sure why PDF printing excludes the elements with negative margins from the view. Could you report it to crbug.com/new please? (it is an issue in the browser implementation it seems). |
Submitted at https://issues.chromium.org/issues/336164418 My theory is the rendering engine tries to preserve an element in one piece, and pushes it to the "next page" which may work for the regular content, but fails for the footer. But I'm not common with the internals to say how realistic this assumption is. |
Minimal, reproducible example
Error string
no error
Bug behavior
Background
I've been trying to adjust some dynamic footer element positions. The CSS includes a negative margin. At some point between Puppeteer v18.2.1 and v21.7.0 an element started to disappear even while 1px out of the Footer space.
Footer margin: 0
Footer margin: -1px
Expectation
A visible part of the element to be displayed
Reality
An element completely disappears
Puppeteer configuration file (if used)
No response
Puppeteer version
22.6.5
Node version
20.11.0
Package manager
npm
Package manager version
10.2.4
Operating system
macOS
The text was updated successfully, but these errors were encountered: