Closed Bug 1907081 Opened 2 months ago Closed 2 months ago

content-visibility: auto invisible in printing/preview

Categories

(Core :: Printing: Output, defect)

Firefox 127
defect

Tracking

()

VERIFIED FIXED
130 Branch
Tracking Status
firefox130 --- verified

People

(Reporter: kronthto, Assigned: jfkthame)

Details

Attachments

(2 files)

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

Steps to reproduce:

Tried to print a webpage which optimises performance using content-visibility:auto on a list of elements/articles.

Demo: https://kronthto.de/content-visibility-example.html

Actual results:

The contents are not visible in the print preview. However, the height is reserved, resulting in a few empty pages. It appears that the page does not "know" that something bigger than the browser viewport is looking at it.

Expected results:

Chrome renders and paints all content when entering print mode, I expected to also see the contents / the skipping of painting should not happen.

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

Yeah, this is rather broken. If I adjust settings in the print preview panel (causing the preview to update), some of the content does start to appear -- but still not all of it, generally. And it's absent from the actual output (tested with Save to PDF) as well.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

A simple fix here would be to check for print/preview mode in nsStyleDisplay::ContentVisibility(), and resolve auto to visible there.

(Alternatively, maybe this should be handled in style_adjuster.rs? But the Gecko-side fix seems particularly trivial.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e33939841781 In print/preview context, always treat content-visibility:auto as visible. r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47111 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
Upstream PR merged by moz-wptsync-bot

I was able to reproduce the issue using Firefox 127.0.2 on Windows 11, while following the steps described in Comment 0.
Verified as fixed using Firefox 130.0b5, on Windows 11, MacOS 14.4 and Ubuntu 22.04. The content is now visible in Print Preview (and also in the saved PDF).

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: