Closed Bug 1811548 Opened 1 year ago Closed 1 year ago

Print: content is restricted to narrow width on MacOS

Categories

(Core :: Printing: Output, defect)

Firefox 109
defect

Tracking

()

VERIFIED FIXED
112 Branch
Tracking Status
firefox112 --- verified
firefox113 --- verified

People

(Reporter: fonsvdplas, Assigned: TYLin)

Details

Attachments

(7 files)

Steps to reproduce:

Open the HTML file attached (with file://...) and press Cmd+P. You can see the issue in the print preview, and in the generated PDF (example output available at https://github.com/fonsp/disorganised-mess/files/10468998/Tower.of.Hanoi.pdf ).

The HTML file is a version-pinned file generated by https://github.com/fonsp/Pluto.jl , a Julia programming environment.

Tested on Firefox MacOS, 105-109 with browserstack.com, and Firefox 109 MacOS locally.

Actual results:

The first pages are correct, but the last pages are mostly blank, and contain squished and occluded content (2 characters wide).

Expected results:

Printing the same document on Firefox Windows or another browser gives the correct result: no blank pages, no squished content.

Attached file Tower of Hanoi.pdf

Example of erroneous output.

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

This seems to be related to the use of display: flex... if I remove that property from the top-level <div> element, the print preview looks fine and no longer has the "bad" pages at the end.

cc'ing Daniel, in case this looks at all familiar as a flexbox/fragmentation issue.

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

I just got the same bug report on Windows, Firefox 109. So it looks like it's not just MacOS.

Yup, it's not macOS-specific -- I think any apparent platform-specific behavior here is just due to font differences which have subtle impacts on the layout.

I'm intending to look at this in more depth soon (hopefully later today), but I did notice earlier that I was able to make it reproduce on Linux with the attached testcase if I increased the print "Scale" to 140 (in the Print Preview dialog "more settings")

Flags: needinfo?(dholbert)
Attachment #9313312 - Attachment description: Tower of Hanoi.html → testcase 1 (from reporter): Tower of Hanoi.html
Flags: needinfo?(dholbert)
Attached file testcase 2 (reduced)

Here's a reduced testcase, I think.

EXPECTED RESULTS: The colorful borders should be on the left & right edges of each page.

ACTUAL RESULTS: On pages 5 and 6, the orange borders are collapsed together; i.e. we think the element has zero (or near-zero) width.

As noted in the testcase, if you set width:100% to the teal element (the flex item), then the bug goes away. (Which is odd, because that doesn't actually impact the sizing of the element. It has flex:1 which is effectively equivalent to width:100% in this context.)

Testcase 001 and 002 test row-oriented and column-oriented flex container,
respectively. The "a" and "b" variant test box-sizing:border-box and
box-sizing:content-box, respectively.

Depends on D170034

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6364c09acf06
Part 1 - Don't evaluate physical available size when aContainerSize is provided. r=emilio
https://hg.mozilla.org/integration/autoland/rev/d8a321301178
Part 2 - Provide size overrides when creating ReflowInput for an overflow container flex item. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38637 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Upstream PR merged by moz-wptsync-bot
Flags: qe-verify+

Reproducible on a 2023-02-20 Nightly build on macOS 12 using the attached testcase.
Verified as fixed on Firefox 112.0b7(build ID: 20230326180212) and Nightly 113.0a1(build ID: 20230327211143) on macOS 12, Windows 10, Ubuntu 22.

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: