Closed Bug 1667510 Opened 4 years ago Closed 4 years ago

ff calculates print number of pages wrong

Categories

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

Firefox 81
defect

Tracking

()

VERIFIED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox81 + verified
firefox82 + verified
firefox83 + verified

People

(Reporter: ploufus, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [print2020_v83][old-ui+], [wptsync upstream])

Attachments

(4 files)

Attached file bug_.zip

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

Steps to reproduce:

press print or print preview in specific pages,( like the sample provided)
problem occur in version 81, work flawless until 80.0.1
offcource i tried uninstall (including profile delete) and reinstall
in 10 diffirent computers running win10 / win7

problem exist in 82b3 and latest nightly @ 25-9-2020
but not in 80 /79 and older

Actual results:

opens a "preparing page" forever (or at least for many hours),
i let it once for about 30 minutes and finaly something open a preview of about 32000 pages,
so actually it thinks its 32000 page document

Expected results:

open immediately page preview / print

trying to figure out i have done the following research so far.. and i think i am in deadend from my side

  • to crosscheck its core issue and installation i have try to
    • change locale in windows to English US
    • try ff US version (not Greek)
    • try 32 bit ff
      no solution focus goes in page code
  • try renaming css's no

i found that REMOVING <!DOCTYPE html> or change it to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
page renders to only 4 pages (should be 1 page), and one table seems extreme long

Severity: -- → S2

[Tracking Requested - why for this release]: Unusable print. Recent regression.

Bisecting yields this regression range:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=2d312d48381007fd9df3b53a6edc9a3ddb8db2b6&tochange=72ef55c14a4c2167a35254020b4c1192334f1913

So this was regressed by bug 1658469... Which is a bit odd, tbf, maybe this was a pre-existing bug... Removing the <input type=date> elements "fixes" it...

Will take a look on monday. Thank you for reporting this!

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(emilio)
Priority: -- → P1
Regressed by: 1658469
Has Regression Range: --- → yes

maybe you mean the same thing and i dont understand, but i test removing date and yes renders in ONLY 4 pages
yet again fieldset labeled "1o Προϊόν-τα" is 3 pages long

correct layout in ff <80.0.1 is like this
https://pasteboard.co/JsUcQpN.png

Whiteboard: [print2020_v83][old-ui+]

(In reply to Christos from comment #3)
Yeah. A better workaround to get the correct layout for now could be:

input { vertical-align: top !important }

It's a hack of course, I'll try to land a fix asap.

So the underlying bug is that we're not applying the UA widget styles, but another underlying bug is that this line of code is doing math on BlockStartAscent() without checking it first, which means that we end up with a baseline that makes no sense (past nscoord_MAX), and we try to vertically align based on that and things go boom.

This ensures that styles from UA widgets apply. Turns out they look
pretty much right without them, but there's a bug in nsDateTimeBoxFrame
where we rely on the styles in order for the baseline to be sensible.

This is not needed to fix the bug, but just makes the code a bit less
prone to this stuff.

Right now we rely on the child being a flex container and having a
concrete BlockStartAscent(). When that breaks, we do math with
nscoord_MAX (ASK_FOR_BASELINE), which causes all sorts of weird stuff to
happen.

Sanity-check the value code. If the child has no concrete baseline,
keeping the ASK_FOR_BASELINE in our own ReflowOutput will end up
synthesizing one as normal from the child, which is ok.

Comment on attachment 9178255 [details]
Bug 1667510 - Make UA widgets in print documents more static. r=smaug

Beta/Release Uplift Approval Request

  • User impact if declined: Pages with <input type=date> in certain circumstances will print really odd / hang.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0, or the test-case attached to the bug.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Very simple patch to avoid doing UA widget initialization on static documents instead of avoiding cloning the widget to begin with.
  • String changes made/needed: none
Flags: needinfo?(emilio)
Attachment #9178255 - Flags: approval-mozilla-release?
Attachment #9178255 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/482bd861c745 Make UA widgets in print documents more static. r=smaug
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dd1a9d5f7ae0 Make nsDateTimeControlFrame not do math on nscoord_MAX. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/25823 for changes under testing/web-platform/tests
Whiteboard: [print2020_v83][old-ui+] → [print2020_v83][old-ui+], [wptsync upstream]

Backed out changeset 482bd861c745 (bug 1667510) for causing mochitest leaks.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&selectedTaskRun=ThBDcdB1TPm2_mYgI509zg.0&searchStr=mochitests%2Cwithout%2Ce10s&fromchange=9cdbf4e04e1980201fe33114f6296857f321a14f&tochange=247e39817687890e2af6d5dd2293842b667a2d14

Backout link: https://hg.mozilla.org/integration/autoland/rev/247e39817687890e2af6d5dd2293842b667a2d14

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=316948066&repo=autoland&lineNumber=127683

...
[task 2020-09-28T22:06:15.297Z] 22:06:15     INFO - TEST-INFO | leakcheck | default leaked 1 nsZipArchive
[task 2020-09-28T22:06:15.298Z] 22:06:15     INFO - TEST-INFO | leakcheck | default leaked 1 nsZipReaderCache
[task 2020-09-28T22:06:15.298Z] 22:06:15     INFO - TEST-INFO | leakcheck | default leaked 7 xpc::CompartmentPrivate
[task 2020-09-28T22:06:15.298Z] 22:06:15     INFO - TEST-INFO | leakcheck | default leaked 3 xpcJSWeakReference
[task 2020-09-28T22:06:15.299Z] 22:06:15     INFO - TEST-UNEXPECTED-FAIL | leakcheck | default 4037824 bytes leaked (AbstractThread, AbstractWatcher, AnimationTimeline, AsyncFreeSnowWhite, AtomSet, ...)
[task 2020-09-28T22:06:15.299Z] 22:06:15     INFO - 
[task 2020-09-28T22:06:15.299Z] 22:06:15     INFO - runtests.py | Running tests: end.
Flags: needinfo?(emilio)
Upstream PR was closed without merging
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Status: RESOLVED → REOPENED
Flags: needinfo?(emilio)
Resolution: FIXED → ---
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e2626970f49b Make UA widgets in print documents more static. r=smaug
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED

Comment on attachment 9178255 [details]
Bug 1667510 - Make UA widgets in print documents more static. r=smaug

P1 printing regression, approved for 82.0b5

Attachment #9178255 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triaged]

Comment on attachment 9178255 [details]
Bug 1667510 - Make UA widgets in print documents more static. r=smaug

Approved for 81.0.1.

Attachment #9178255 - Flags: approval-mozilla-release? → approval-mozilla-release+

Confirming this issue as verified fixed on 81.0.1(20200930150533), 82.0b5(20200929175845) and 83.0a1(20200930214529) with Windows 10x64 and Ubuntu 18.04.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

ok

i also test and its working

i also would like to thank everyone involved !

Thank you for reporting it!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: