Open Bug 1869211 Opened 7 months ago Updated 7 months ago

[css3-page] @page :first pseudo-class resulting in wrong sheet orientation when printing ranges

Categories

(Core :: Printing: Output, defect, P3)

defect

Tracking

()

People

(Reporter: jwatt, Unassigned)

References

(Blocks 2 open bugs)

Details

An @page :first rule should apply only to the first page in the full list of pages that are visible in print preview, before the user changes the Pages field to Custom and enters a range that does not include the first page. If the user selects a range that does not include that original first page then the rule should not be applied to the first page that is visible in print preview.

This is happening because in nsPageSequenceFrame::Reflow we try to get the dimensions we'll use for the PrintedSheetFrame by calling sheet->ComputeSheetSize() before reflowing the sheet and its pages. PrintedSheetFrame::ComputeSheetSize just looks at its PrincipalChildList().FirstChild() and gets the style from that, without any knowledge of which pages may be skipped. It isn't until TagIfSkippedByCustomRange is called when PrintedSheetFrame reflows its nsPageFrames that we know whether pages are going to be skipped or not.

To fix this we really need to stop trying to calculate the sheet dimensions ahead of time to pass down when reflowing sheets and pages. They should be ignoring that information nowadays anyway, now that we scale pages to fit into their sheet/sheet grid properly.

Summary: [css3-page] @page :first selectors (pseudo-class) incorrectly applied when printing range → [css3-page] @page :first pseudo-class resulting in wrong sheet orientation when printing ranges
Blocks: 1867261

Ugh, ComputeSinglePPSPageSizeScale is still called during reflow, and relies on the reflow input.

You need to log in before you can comment on or make changes to this bug.