In fragmentation fallback codepath, content with `clip-path` doesn't render at all after page 1
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: pestophagous, Unassigned)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0
Steps to reproduce:
Try to print this page: https://openstax.org/books/calculus-volume-1/pages/2-3-the-limit-laws
It may be necessary to restrict/customize the page numbers being printed so that you are requesting only the last 4 or 5 pages of the doc.
(others from that same openstax book showcase same issue)
Actual results:
print preview shows math formulas (I am particulary interested in the final few pages of exercises). But when I print-to-pdf, the resulting pdf does not contain the formulas, but only blank spaces. [other browsers that i have installed side-by-side can generate the pdf properly]
Expected results:
The pdf should contain math formulas.
| Reporter | ||
Comment 1•9 months ago
|
||
The user agent string does not seem to indicate that I am on NIGHTLY.
I am using: 149.0a1 (2026-02-01) (64-bit) NIGHTLY on Ubuntu 22.04.5 LTS "jammy"
Comment 2•9 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•9 months ago
•
|
||
Thanks for the bug report. A few diagnostic things I've observed when poking at the page:
-
When Firefox prints / print-previews this document, it also looks like we slice some lines of text in half at pagebreaks (if the text happens to overlap a pagebreak), so this is likely triggering Firefox's "fragmentation fallback", probably because it's wrapped in a giant single-row grid item (
.fRDSoc) -- more notes on this in bug 1759926. -
If I untick that
display:griddeclaration in DevTools, this avoids the fragmentation-fallback codepath that I discussed above (as expected) and it also seems to make the formulas print nicely. -
Or, instead: if I add
* {clip-path: initial !important }to override some MathJax styles[1], then the formulas print nicely.
So: this seems to be a bug where we're getting confused about the geometry of clip-path styles in our "fragmentation fallback" codepath.
[1] e.g. here's one example MathJax style that's applying a clip-path to some of the content here:
mjx-mo > mjx-c, mjx-mi > mjx-c, mjx-mn > mjx-c, mjx-ms > mjx-c, mjx-mtext > mjx-c {
clip-path: padding-box xywh(-1em -2px calc(100% + 2em) calc(100% + 4px));
}
Comment 4•9 months ago
|
||
Here's a reduced testcase.
When I print this testcase to Firefox's save-to-PDF backend, the clipped content doesn't end up painting at all on page 2 in the resulting PDF (even though it shows up in print preview).
Comment 5•9 months ago
|
||
Comment 6•9 months ago
|
||
I'm using a recent Nightly 149 on Ubuntu 25.04, in case it ends up being relevant.
Updated•9 months ago
|
Description
•