Open Bug 2003822 Opened 21 hours ago Updated 14 hours ago

container queries don't work when printing (aside from paint-time effects), due to nsPageSequenceFrame refusuing to reflow more than once

Categories

(Core :: Printing: Output, defect)

Firefox 145
defect

Tracking

()

People

(Reporter: pinage404+bugzilla.mozilla.org, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached file bug.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0

Steps to reproduce:

I have a container query that add a display grid

I attached a file to reproduce

Actual results:

Everything is fine on a screen but the element with a display: grid; appears empty in print mode

I tried on Firefox 145.0.1 (64 bits) and Zen Browser 1.17.9b (Firefox 145.0.1) (64 bits) on :

  • system: "x86_64-linux"
  • host os: Linux 6.12.58, NixOS, 25.05 (Warbler), 25.05.20251124.1c8ba8d
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.28.5
  • nixpkgs: /nix/store/79nihxkkd2gix5y4ijf0zmyznx04lghn-source

Expected results:

The print mode should display like the screen mode

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.

Component: Untriaged → Printing: Output
Product: Firefox → Core

I suspect this has to do with how container-queries work with layout/restyle/layout interleaving, mixed with the fact that our print-reflow codepath avoids incremental reflow entirely -- specifically this early-return where nsPageSequenceFrame::Reflow bails if it's been reflowed previously:
https://searchfox.org/firefox-main/rev/5a5b3741981250310f4327537f18879559779f9c/layout/generic/nsPageSequenceFrame.cpp#294-299

Attached file testcase 2

Here's a testcase with a container-query that has some paint effects (changing color/background) as well as some layout effects (changing height/width)

We successfully apply the paint effects but not the layout effects. So this is a good clue that we're successfully restyling but not managing to make it through another reflow to update the frame tree sizes, as suspected in my previous comment.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: print issue with container query and display grid → container queries don't work when printing (aside from paint-time effects), due to nsPageSequenceFrame refusuing to reflow more than once
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: