Closed Bug 1911948 Opened 3 months ago Closed 3 months ago

Current tab crashes when printing an iframe with "break-inside: avoid"

Categories

(Core :: Print Preview, defect)

Firefox 118
Desktop
Unspecified
defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- fixed
firefox129 --- wontfix
firefox130 --- fixed
firefox131 --- fixed

People

(Reporter: tspradli, Assigned: jfkthame, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files)

Attached file index.html

Steps to reproduce:

Printing an iframe with sections using break-inside: avoid. Commenting/uncommenting the last paragraph seems to enable/disable the issue, so it appears to be related to the view port dimensions and width of content.

This was first identified using https://github.com/futurepress/epub.js to view epubs, so the page width and column widths are set in a similar fashion. The iframe width is set to 1942px, the iframe body is 1942 / 2 = 971px (two pages), with column-width being 971 / 2 = 405.5px. I'm not sure if this matters.

I've attached an html test file to demonstrate.

I used mozregression to narrow this down to 118, and before this release it just previews a blank page (a whole other issue). I've tested this on Fedora 40 and MacOS 14.4.1.

Actual results:

The print window loads, but the preview never renders and is stuck "Preparing Preview". There is no output when saving as PDF, and this ends up crashing the current tab.

Expected results:

Current tab doesn't crash, print preview renders, and I'm able to print what's visible in the viewport.

Hardware: Unspecified → Desktop

I've also tested & verified this on release 128, and on nightly as of August 6th, 2024.

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 didn't see a crash (though maybe I just didn't wait long enough....), but the issue of being stuck at "Preparing Preview" reproduces for me (on macOS) going back considerably before v.118; mozregression gave me this range, which suggests it regressed in 115:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ffee8e3a7870875ab78af162638548f72cdabddf&tochange=375c5940c253b38f65792c847de04bc50b990b22

Yeah, from the range in comment 3, that looks like the most plausible candidate.

I don't think we have the ability to paginate a multicol-inside-an-<iframe> nicely (prior to the regression, the preview shows the entire iframe being scaled to fit within the page), so at least until that is handled, we should exclude this case from being considered as "paginated" here.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 1831829
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

Without the patch, this fails with a timeout when it attempts to print.

Set release status flags based on info from the regressing bug 1831829

Attachment #9418297 - Attachment description: Bug 1911948 - A multicol isn't paginated if it is inside a subdocument. r=tylin → Bug 1911948 - Don't let top-level multicol be paginated if it is inside a subdocument. r=tylin
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4ef68788e380 Don't let top-level multicol be paginated if it is inside a subdocument. r=TYLin,emilio https://hg.mozilla.org/integration/autoland/rev/42dd1bd7ae7e Add the testcase to WPT. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47532 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:jfkthame, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox130 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jfkthame)
Attachment #9418596 - Flags: approval-mozilla-beta?

Without the patch, this fails with a timeout when it attempts to print.

Original Revision: https://phabricator.services.mozilla.com/D218825

Attachment #9418597 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Possible infinite-loop (hang)/crash when attempting to preview/print
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: n/a
  • Risk associated with taking this patch: minimal
  • Explanation of risk level: Patch avoids the issue by narrowing the scope of the regressing change to exclude iframe'd subdocuments, so reverting to previous behavior for this case
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: needinfo?(jfkthame)
Attachment #9418596 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9418597 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Component: Printing: Output → Print Preview

This grafts cleanly to ESR128. Did you want to nominate for uplift there also?

Flags: needinfo?(jfkthame)
Flags: in-testsuite+
Flags: qe-verify-
Attachment #9430146 - Flags: approval-mozilla-esr128?

esr128 Uplift Approval Request

  • User impact if declined: Possible infinite-loop (hang)/crash when attempting to preview/print
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: n/a
  • Risk associated with taking this patch: minimal
  • Explanation of risk level: just avoids trying to handle pagination of iframe'd documents, which led to the problem case
  • String changes made/needed: none
  • Is Android affected?: yes
Attachment #9430146 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: