Update page range validation code to use rawNumPages attribute
Categories
(Toolkit :: Printing, defect, P1)
Tracking
()
People
(Reporter: dholbert, Assigned: sfoster)
References
Details
(Whiteboard: [print2020_v81])
Attachments
(2 files)
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
(deleted),
patch
|
RyanVM
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Once nsIWebBrowserPrint gets a rawNumPages
attribute (being added in bug 1660502), we need to update the page-range validation code to use that.
Otherwise we end up in a catch-22 scenario. The existing printPreviewNumPages
attribute is really poorly named given the way that this interface is evolving -- nowadays, it is really "how many sheets will be printed", and that's not the right value to use for page range validation.
To see this, here's one scenario where this matters: Suppose e.g. you've got a 12-page document and the user chooses a range "from:6 to:10" (5 pages). Then after we've rendered their chosen selection, we'll suddenly start reporting a printPreviewNumPages
of 5
, which then will cause the user's selected range to be invalid, since 6 and 10 are both out-of-bounds.
Anyway - there's no better option right now, but once bug 1660502 has landed, we should migrate the range validation code to use the new rawNumPages
API.
Reporter | ||
Comment 1•4 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0)
To see this, here's one scenario where this matters: Suppose e.g. you've got a 12-page document and the user chooses a range "from:6 to:10" (5 pages). Then after we've rendered their chosen selection, we'll suddenly start reporting a
printPreviewNumPages
of5
, which then will cause the user's selected range to be invalid, since 6 and 10 are both out-of-bounds.
To clarify: this^ scenario doesn't actually play out with this sort of bad outcome yet, simply because we don't honor the page range in print preview right now. But it does play out this way in a build with my local patch for bug 1659005 (which reduces the number of pages/sheets shown due to honoring the requested page range).
Reporter | ||
Comment 2•4 years ago
|
||
(which means: I think we need to address this before bug 1659005 can land.)
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Comment 5•4 years ago
|
||
bugherder |
Assignee | ||
Comment 7•4 years ago
|
||
Comment on attachment 9172046 [details]
Bug 1660908 - Use rawNumPages rather than printPreviewNumPages for the total number of pages. r?emalysz,dholbert
Beta/Release Uplift Approval Request
- User impact if declined: Page range validation when printing will be incorrect when the start of the range is greater than the total number of pages
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: 1. Open print dialog for a page with enough content to span multiple pages
- Select "custom" in the page-range dropdown
- Enter a start and end page number towards the top of the possible range. E.g. 9-10 on a 10 page document.
ER: With this patch, the range should not be marked invalid, printing can proceed and the "sheet count" accurately sums the number of sheets that will be printed (2 in this example)
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Small front-end change to which page count total we use when setting min/max in the print UI.
- String changes made/needed: NOne.
Assignee | ||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
This is verified fixed using Firefox 82.0a1 (BuildId:20200827212940) on Windows 10 64bit, macOS 10.14 and Ubuntu 18.04 64bit.
Leaving a ni? on myself and the qe-verify+ until this gets uplifted & verified in beta as well.
Comment 9•4 years ago
|
||
Comment on attachment 9172046 [details]
Bug 1660908 - Use rawNumPages rather than printPreviewNumPages for the total number of pages. r?emalysz,dholbert
Approved for 81.0b4.
Comment 10•4 years ago
|
||
Comment on attachment 9172046 [details]
Bug 1660908 - Use rawNumPages rather than printPreviewNumPages for the total number of pages. r?emalysz,dholbert
Actually, this needs rebasing for Beta due to conflicts with bug 1636728.
Assignee | ||
Comment 11•4 years ago
|
||
Approval Request Comment
[Feature/Bug causing the regression]:
[User impact if declined]: Page range validation when printing will be incorrect when the start of the range is greater than the total number of pages
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]:
- Open print dialog for a page with enough content to span multiple pages
- Select "custom" in the page-range dropdown
- Enter a start and end page number towards the top of the possible range. E.g. 9-10 on a 10 page document.
ER: With this patch, the range should not be marked invalid, printing can proceed and the "sheet count" accurately sums the number of sheets that will be printed (2 in this example)
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: Low
[Why is the change risky/not risky?]:
Small front-end change to which page count total we use when setting min/max in the print UI.
[String changes made/needed]: None
Comment 12•4 years ago
|
||
Comment on attachment 9172784 [details] [diff] [review]
bug-1660908-beta.patch (attachment 9172046 [details] / revision D88223 rebased on beta)
Thanks for doing the rebase. Approved for 81.0b4.
Comment 13•4 years ago
|
||
bugherder uplift |
Updated•4 years ago
|
Comment 14•4 years ago
|
||
This issue is verified fixed using Firefox 81.0b4 (BuildId:20200829200810) on Windows 10 64bit, macOS 10.14 & Ubuntu 20.04.
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Comment on attachment 9172046 [details]
Bug 1660908 - Use rawNumPages rather than printPreviewNumPages for the total number of pages. r?emalysz,dholbert
Approved for 81.0b6 (no functional change, but we had to re-do this on account of bug 1660739 being uplifted to Beta).
Comment 16•4 years ago
|
||
bugherder uplift |
Description
•