Bug 1602410 - Make window.print() work with tab-modal printing. r=nika,geckoview-reviewers,agi

Do this by spinning the event loop until we've done the clone for
preview as appropriate.

This should be much less risky than finishing the previous patches
which would still be nice, but realistically landing them for 81 is not
going to happen.

This just returns without doing nothing in a couple cases, like when
there's already another modal dialog or such. That seems acceptable to
me, it's not clear what better way to do would be.

Differential Revision: https://phabricator.services.mozilla.com/D87484
This commit is contained in:
Emilio Cobos Álvarez
2020-08-19 09:27:18 +00:00
parent e0a41d5aa2
commit 04fb12730e
13 changed files with 173 additions and 40 deletions

View File

@@ -6019,6 +6019,10 @@ nsBrowserAccess.prototype = {
);
},
print(aBrowsingContext) {
PrintUtils.startPrintWindow(aBrowsingContext);
},
openURI(aURI, aOpenWindowInfo, aWhere, aFlags, aTriggeringPrincipal, aCsp) {
if (!aURI) {
Cu.reportError("openURI should only be called with a valid URI");