@page :first doesn't work if the first page uses the auto page name (e.g. if `page` is never specified)
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: alaskanemily)
References
Details
Attachments
(8 files)
STR:
- Print-preview the attached testcase (or any testcase with :first and with no declared
page:
value for content on the first page)
EXPECTED RESULTS:
The testcase's huge margins should show up in the print preview.
ACTUAL RESULTS:
No huge margins are used.
If I add page:a
to the div, then suddenly the margin does get picked up, as shown in the soon-to-be-attached reference case.
I think this is the reason behind the test-failure in bug 1859823, on my local Linux machine at least.
Reporter | ||
Comment 1•8 months ago
|
||
Reporter | ||
Comment 2•8 months ago
|
||
Here's the testcase vs. reference case in Nightly 120.0a1 (2023-10-17)
Reporter | ||
Updated•8 months ago
|
Reporter | ||
Comment 3•8 months ago
•
|
||
More specifically, it looks like we honor the size
from the :first
page style, when determining the paper size. But we don't honor the margin
or page-orientation
. And we don't honor the size
when determining the page size; we just use whatever we get from the paper (which happens to be correct if we're using the save-to-pdf print target).
Updated testcase coming to demonstrate that.
Reporter | ||
Comment 4•8 months ago
|
||
Reporter | ||
Comment 5•8 months ago
|
||
Reporter | ||
Comment 6•8 months ago
|
||
If you print-preview testcase 2 with the "Save to PDF" print target, then it looks like we get the page size correct (10x9, disregarding the requested page-orientation). But in fact we only get things correct because we use the specified size to determine the PDF "paper-size" in that case, and then we default to matching the paper size when we go to lay out our page.
If you use a physical print target instead, you can see more-clearly that we do in fact disregard the size (when comparing against how we render the reference case with a physical print target, where you can see the edge of the headers/footers as an indication of the scaled-down-to-fit-the-paper-whose-ratio-doesn't-quite-match page-size)
Reporter | ||
Comment 7•8 months ago
|
||
Reporter | ||
Comment 8•8 months ago
•
|
||
Note: there are two unrelated cosmetic issues shown in the header/footer in the right half of comment 7's screenshot.
- I filed bug 1859926 on the fact that the header/footer are clipped (at the bottom edge of the screenshot -- e.g. timestamp
4:15 P
, missingM
) - There appears to be a overlapping-header issue (on the right edge of the screenshot, with the two copies of the URL stomping on top of each other), but I think that's just a version of bug 1112298; that overlap only shows up in Print Preview and only as a side-effect of that bug. There's no overlap in the actual physical printout, which just shows
Nightly
in place of the first URL. Nor does any overlap happen in print-preview or print output if I use an actual extremely-long-<title>
-- we ellipsize the title to avoid overlapping the URL.)
Assignee | ||
Comment 9•8 months ago
|
||
Well that's clearly not correct now that we care about page-rule pseudo classes. I'll make a patch to fix that.
Assignee | ||
Comment 10•8 months ago
|
||
Assignee | ||
Comment 11•8 months ago
|
||
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Comment 12•8 months ago
|
||
Pushed by emcdonough@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/618a42246cb8 Part 1 - Apply resolved page style for :first @page, even if it has no specified page name r=dholbert https://hg.mozilla.org/integration/autoland/rev/fe6bbd79621a Part 2 - Add a test for a :first @page rules when the first page doesn't have a page name set. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42852 for changes under testing/web-platform/tests
Comment 14•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/618a42246cb8
https://hg.mozilla.org/mozilla-central/rev/fe6bbd79621a
Upstream PR merged by moz-wptsync-bot
Upstream PR was closed without merging
Updated•7 months ago
|
Comment 17•6 months ago
|
||
Reproducible on a 2023-10-18 Nightly build on Windows 10.
Verified as fixed on Firefox 121.0b8 and Nightly 122.0a1 on Windows 10, macOS 12, Ubuntu 22.
Description
•