Closed Bug 1670876 Opened 4 years ago Closed 4 years ago

Infinite print preview loading state if printing an XML selection via context menu

Categories

(Core :: Print Preview, defect, P2)

Firefox 83
defect

Tracking

()

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

People

(Reporter: emilghitta, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v83] [old-ui-])

Attachments

(2 files)

Attached image SelectionContext.gif

Affected versions

  • Firefox 83.0a1 (BuildId:20201012113229)

Affected platforms

  • Windows 10 64bit
  • Windows 7 64bit
  • Ubuntu 18.04 64bit
  • macOS 10.14

Steps to reproduce

  1. Launch Firefox.
  2. Access the following link
  3. Perform a selection and right click in order to open the context menu.
  4. Select the “Print Selection” option.

Expected result

  • The “Print Selection” option is disabled (as in pdf documents).

Actual result

  • The “Print Selection” option is enabled and if the user selects the option, it will open the print preview with the “There was an unexpected problem while printing” error message and the print preview remains in an infinite loading state.

Regression Window
This is not a regression. The Print Selection option was implemented in Bug 140718

Additional Information

  • [Suggested severity] S2
  • The following error message is displayed inside the browser console Uncaught (in promise) DOMException: Print preview failed print.js:657:10
Has STR: --- → yes

:emilghitta, if you think that's a regression, then could you try to find a regression range in using for example mozregression?

Component: Printing → Print Preview
Product: Toolkit → Core
Assignee: nobody → emilio

Recursive the things all :^)

The fix to the "corresponding node" bits in Document.cpp should be
pretty straight-forward. The fix in nsPrintJob is a bit more subtle:

The way printing selection works is literally "select everything else,
then call Selection.deleteFromDocument on that". We need to do the same
with shadow DOM, which involves skipping over shadow trees, and dealing
with selecting bits in ancestor trees as needed.

Note that for multi-range-selection case this technically relies on the
order of the ranges being shadow-tree-inclusive. We don't support
multi-range selection in shadow dom well, afaict, but I've added a
comment to the code to that effect.

Severity: -- → S2
Priority: -- → P2
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3f838a5d991c
Add support for printing selection in shadow dom. r=nordzilla
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Flags: qe-verify+

This issue is verified fixed using Firefox 83.0b2 (BuildId:20201020173725) on Windows 10 64bit, macOS 10.15 and Ubuntu 20.04

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

Attachment

General

Created:
Updated:
Size: