Closed Bug 1699605 Opened 3 years ago Closed 3 years ago

Printing HTML file to PDF takes a long time and produces many blank pages

Categories

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

Firefox 86
defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox86 - wontfix
firefox87 + wontfix
firefox88 + fixed

People

(Reporter: justin1018, Assigned: MatsPalmgren_bugz)

References

(Regression)

Details

(Keywords: regression, testcase)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0

Steps to reproduce:

Windows 10 (latest version)
Firefox (86.0)

  1. Open HTML file I converted from jupyter notebook (.ipynb) file.
  2. Click 3 bar menu at top right corner and go to <Print>
  3. The print preview takes about 3-4 minutes to load and when it does it shows 14,000 blank pages. The HTML file should only be about 4-5 pages.
  4. All PDF options have same output (Save as PDF, Microsoft Print to PDF etc).

I have installed and updated Firefox, jupyter notebook to latest versions. I have concluded that this problem is not on my end with the HTML file and is on Firefox's end because I was able to reproduce it on another laptop running Windows 10 as well. Also, opening up the file in Google Chrome works with no problems.

Actual results:

The print preview takes about 3-4 minutes to load and when it does it shows 14,000 blank pages. The HTML file should only be about 4-5 pages. The preview still has the correct file at the top of the document so I can change the number of pages I want to print (which also takes 3-4 min to load).

Sometimes (rarer) the HTML file will load instantly, but there would only be 1 page (when there should be multiple). Most of the text would be cutoff at the bottom of the page

Expected results:

The print preview should take about 2 seconds to load and display an amount of pages, usually below 10 pages.

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

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

Yeah, this looks borked. Thanks for the test-case! This looks pretty fast in older versions of Firefox, so it seems a regression.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)

[Tracking Requested - why for this release]: Pretty bad printing perf regression.

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=0bcc7f83fbab751e6b929f908ac5f7c01dde86bc&tochange=429a4d022ade4b99563b08473e2f16ac18507bae

Mats, can you take a look? Please return the ni? if not and I can take a look, thank you!

Severity: -- → S2
Flags: needinfo?(emilio) → needinfo?(mats)
Priority: -- → P2
Regressed by: 1686310
Has Regression Range: --- → yes
Attached file Testcase #1
Flags: needinfo?(mats)

Oops, I missed a !GetPrevInFlow() condition when replacing NS_CSS_FRAME_TYPE_ABSOLUTE here:
https://phabricator.services.mozilla.com/D101551#C3496350NL2049
because the original code sets it to NS_CSS_FRAME_TYPE_BLOCK when there's a prev-in-flow:
https://phabricator.services.mozilla.com/D101551#C3496350OL778

Assignee: nobody → mats
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d72e2c488e25
Add missing !GetPrevInFlow() check.  r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28160 for changes under testing/web-platform/tests

Comment on attachment 9210562 [details]
Bug 1699605 - Add missing !GetPrevInFlow() check. r=emilio

Beta/Release Uplift Approval Request

  • User impact if declined: Many extra blank pages when printing some documents containing overflowing abs.pos. elements.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It's a one-liner to restore old behavior.
  • String changes made/needed:
Attachment #9210562 - Flags: approval-mozilla-beta?
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch

Comment on attachment 9210562 [details]
Bug 1699605 - Add missing !GetPrevInFlow() check. r=emilio

It's too late for 87.0; presumably not a release blocker since 86 is also affected, but will keep on the radar for a dot release.

Attachment #9210562 - Flags: approval-mozilla-beta? → approval-mozilla-release?
Upstream PR merged by moz-wptsync-bot

Comment on attachment 9210562 [details]
Bug 1699605 - Add missing !GetPrevInFlow() check. r=emilio

88 is in RC now and there are no plans for an 87 dot release.

Attachment #9210562 - Flags: approval-mozilla-release? → approval-mozilla-release-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: