Closed Bug 1662940 Opened 4 years ago Closed 4 years ago

Add back assertion to ensure numPagesOnThisSheet is > 0

Categories

(Core :: Print Preview, defect, P2)

defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox82 --- verified

People

(Reporter: emmamalysz, Assigned: dholbert)

Details

(Whiteboard: [print2020_v82])

Attachments

(1 file)

Bug 1661852 removed the assertion that numPagesOnThisSheet > 0 in PrintedSheetFrame. We had to remove this for causing a tab crash on mac.

STR:

  1. Open https://fr.wikipedia.org/wiki/Gr%C3%A8ce
  2. Print page (with print.tab_modal.enabled turned on)
  3. Specify landscape mode (or change a setting that increases the number of pages)
  4. Change page range from "all" to "custom"
  5. Specify page range to print the last page (i.e. 105 to 105)
  6. Switch back to orientation mode (or change a setting that decreases the number of pages)
  7. Notice the preview will start to render, and the tab will then crash

The crash was avoided by removing this assertion, but we should probably figure out why that's happening/if we need to put it back.

This is because the out of the range page number isn't counted.

(In reply to Emma Malysz from comment #0)

  1. Switch back to orientation mode (or change a setting that decreases the number of pages)

When out-of-range page numbers are specified, the orientation mode UI is disabled basically, but somtimes I can interact it, then the assertion happened.

CCing Daniel.

Whiteboard: [print2020_v81] → [print2020_v82]
Assignee: nobody → dholbert
Status: NEW → ASSIGNED

Per the comment in the patch: if we're given a bogus range, we can technically
end up with a single PrintedSheetFrame that contains no displayable
pages. Luckily, that's a situation that the frontend should detect & recover
from quickly & gracefully, so it's not really a problem. So: in that scenario,
we'll now spam a non-fatal warning; and we'll fatally assert if any sheet
beyond the first page has zero displayable pages. (That still shouldn't be
possible.)

We could hypothetically uplift this to beta, but it doesn't matter too much either way -- it's just adding some assertions, which by definition are only active in debug builds. So this has zero impact/change for actual users running our opt builds.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aab24a61ed83 Add back assertion to ensure we don't create printed sheets with no pages on them (softened for the first sheet). r=hiro
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Flags: qe-verify+

Confirmed issue with 82.0a1 (2020-09-02) on Windows 10.
Patch verified with 82.0b7 on Windows 10, macOS 11.0.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: