Commit graph

246 commits

Author SHA1 Message Date
Jonathan Watt
2a9a0b264a Bug 1702501 - Remove print.tab_modal.enabled pref and old frontend print preview code. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D134699
2022-01-06 18:55:38 +00:00
Jonathan Watt
0046f5aaf4 Bug 1741698 - Fix silent printing for both window.print() and print to file. r=emilio
Printing was failing for silent window.print() printing because we need a
RemotePrintJobChild. The content process side of the print now asks the parent
process to send a valid nsIPrintSettings object and a RemotePrintJobChild
before it starts printing.

Printing was also failing for silent print-to-file printing in the case that
the user omits to set the `printer.print_to_filename` pref. That was because
we weren't setting a fallback value for nsIPrintSettings.toFileName.

Differential Revision: https://phabricator.services.mozilla.com/D134799
2022-01-02 13:05:54 +00:00
criss
f92b19ea73 Backed out changeset 8105d0c98b35 (bug 1741698) for causing wpt failures on Devices-without-focus.https.html. CLOSED TREE 2021-12-31 23:10:31 +02:00
Jonathan Watt
04de14bd49 Bug 1741698 - Fix silent printing for both window.print() and print to file. r=emilio
Printing was failing for silent window.print() printing because we need a
RemotePrintJobChild. The content process side of the print now asks the parent
process to send a valid nsIPrintSettings object and a RemotePrintJobChild
before it starts printing.

Printing was also failing for silent print-to-file printing in the case that
the user omits to set the `printer.print_to_filename` pref. That was because
we weren't setting a fallback value for nsIPrintSettings.toFileName.

Differential Revision: https://phabricator.services.mozilla.com/D134799
2021-12-31 14:50:35 +00:00
Jonathan Watt
ac90ddff59 Bug 1745452 - Remove the print progress dialog code. r=mstriemer,bobowen,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D133500
2021-12-16 15:12:33 +00:00
Butkovits Atila
7d46682c0e Backed out changeset 51d7c5d96ceb (bug 1745452) for causing failures at browser_all_files_referenced.js. CLOSED TREE 2021-12-16 15:13:34 +02:00
Jonathan Watt
f2d22001b0 Bug 1745452 - Remove the print progress dialog code. r=mstriemer,bobowen,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D133500
2021-12-16 11:45:59 +00:00
Jonathan Watt
385f49415f Bug 1745465 - Add a pref to enable the Page Setup menu. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D133502
2021-12-10 19:02:48 +00:00
Geoff Lankow
7f1cae8d68 Bug 1740630 - Fix and enable printing the selection from a parent process browser. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130938
2021-11-18 21:56:02 +00:00
Niklas Baumgardner
cf3a438f13 Bug 1733427 - Toggle print preview dialog when pressing print toolbar button. r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D129275
2021-11-01 13:55:09 +00:00
Emilio Cobos Álvarez
edb16ba59a Bug 1714639 - Don't call FrameLoader.printPreview in hidden frames. r=mstriemer,jwatt
We need to be displayed when cloning into a same-process frame, so that
the preview code hooks up to the view tree correctly and the frame is
correctly painted.

This works for out-of-process frames, but mostly by chance.

Fortify the printPreview() API code to gracefully handle that case, and
remove the sessionrestore special-case which is not really special.

Differential Revision: https://phabricator.services.mozilla.com/D119980
2021-07-22 10:18:26 +00:00
Mark Striemer
1add3985d3 Bug 1666247 - Part 3: Disable tab modal print on about:sessionrestore r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D116877
2021-07-08 03:54:20 +00:00
Mark Striemer
4809cc2277 Bug 1666247 - Part 2: Return dialog from tabDialogBox.open r=pbz
Depends on D102356

Differential Revision: https://phabricator.services.mozilla.com/D103525
2021-07-08 03:54:19 +00:00
Mark Striemer
222e434cd2 Bug 1666247 - Part 1: Add a simplify page checkbox r=emalysz,flod
Differential Revision: https://phabricator.services.mozilla.com/D102356
2021-07-08 03:54:19 +00:00
Geoff Lankow
2b549b87c7 Bug 1711805 - Extract uses of gBrowser in PrintUtils in a way that can be easily overridden. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D115433
2021-05-19 10:45:01 +00:00
Emilio Cobos Álvarez
d14a43f487 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
We were using the top BrowsingContextGroup id in this case, which is
obviously wrong. Also make the API take a BrowsingContext directly,
rather than passing outerwindowids around.

Differential Revision: https://phabricator.services.mozilla.com/D112413
2021-04-17 18:41:11 +00:00
Emilio Cobos Álvarez
9afefdd884 Bug 1705757 - Move FrameLoader.print to BrowsingContext.print. r=nika,remote-protocol-reviewers,marionette-reviewers,extension-reviewers,zombie
This makes it trivial to choose the right BrowserParent to print a
browsing context, by removing the OuterWindowID / FrameLoader
indirections.

Differential Revision: https://phabricator.services.mozilla.com/D112412
2021-04-17 18:41:11 +00:00
Emilio Cobos Álvarez
06b663afd4 Bug 1697836 - Avoid throwing when asking for a selection. r=emalysz
Selection may be null if the page got hidden in e.g., the afterprint
event listener or somewhere else.

Add a try catch for good measure, assuming there's no selection is
always safe.

I'll try to get an automated test-case for this working, though it might
be tricky.

Depends on D109714

Differential Revision: https://phabricator.services.mozilla.com/D109715
2021-03-27 10:22:55 +00:00
Emilio Cobos Álvarez
188f91724f Bug 1697836 - Improve error handling when failing to window.print(). r=emalysz
Ensure we report the error to the web console, and that the print
browser gets removed, as that is what will exit the modal state in the
page that's printing.

Differential Revision: https://phabricator.services.mozilla.com/D109714
2021-03-27 10:22:54 +00:00
Emilio Cobos Álvarez
915f02d25c Bug 1694951 - Remove printing.trigger telemetry. r=jwatt,marionette-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106465
2021-03-01 11:36:43 +00:00
Emilio Cobos Álvarez
505c441303 Bug 1572798 - Make content browsing contexts for tabs start as inactive. r=nika
Otherwise autoplay blocking until-in-foreground breaks with the other
patch in this bug, because it unblocks media playback once a browsing
context is active for the first time.

Differential Revision: https://phabricator.services.mozilla.com/D42329
2021-01-21 20:20:57 +00:00
Emma Malysz
f3948b301e Bug 1683279, fix intermittent test error and use the focused window in PrintingSelectionChild.jsm r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D102618
2021-01-21 19:29:10 +00:00
Cosmin Sabou
c2cbf590a6 Backed out changeset 975f6057245a (bug 1572798) for turning bug 1511706 to perma. CLOSED TREE 2021-01-21 21:35:33 +02:00
Emilio Cobos Álvarez
a713e37be6 Bug 1572798 - Make content browsing contexts for tabs start as inactive. r=nika
Otherwise autoplay blocking until-in-foreground breaks with the other
patch in this bug, because it unblocks media playback once a browsing
context is active for the first time.

Differential Revision: https://phabricator.services.mozilla.com/D42329
2021-01-21 17:40:12 +00:00
Dorel Luca
f3c332c453 Backed out 2 changesets (bug 1572798) for multiple failures. CLOSED TREE
Backed out changeset cfdebb863454 (bug 1572798)
Backed out changeset f2d3a6800638 (bug 1572798)
2021-01-20 00:15:48 +02:00
Emilio Cobos Álvarez
333b73de84 Bug 1572798 - Make content browsing contexts for tabs start as inactive. r=nika
Otherwise autoplay blocking until-in-foreground breaks with the other
patch in this bug, because it unblocks media playback once a browsing
context is active for the first time.

Differential Revision: https://phabricator.services.mozilla.com/D42329
2021-01-19 19:14:33 +00:00
Micah Tigley
4210332570 Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-14 06:55:55 +00:00
Butkovits Atila
7742c03714 Backed out 4 changesets (bug 1680637, bug 1682395) for causing Marionette failures. CLOSED TREE
Backed out changeset 073e0be7db95 (bug 1680637)
Backed out changeset 552b91b31b0f (bug 1682395)
Backed out changeset c80de6c72779 (bug 1680637)
Backed out changeset d513e228b0ad (bug 1680637)
2021-01-13 02:13:06 +02:00
Micah Tigley
c0ec6961ed Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-11 20:55:19 +00:00
Bogdan Tara
6101a13054 Backed out 3 changesets (bug 1680637, bug 1682395) for browser/base/content/* failures CLOSED TREE
Backed out changeset 270e2e3183de (bug 1682395)
Backed out changeset e3566f596187 (bug 1680637)
Backed out changeset 66563136c84e (bug 1680637)
2021-01-11 21:36:20 +02:00
Micah Tigley
a3faaf4c5d Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-11 05:13:00 +00:00
Emma Malysz
c04c6333bc Bug 1685184, print selected frame when selecting Print Frame from context menu r=marionette-reviewers,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D100842
2021-01-07 19:34:56 +00:00
Emma Malysz
31f8e81a16 Bug 1683318, use focused browsing context for print preview if it is currently active r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D100133
2021-01-05 20:42:27 +00:00
Emma Malysz
ae87050b91 Bug 1670122: add check box in print UI to print selection only. r=mstriemer,fluent-reviewers,flod
Uses a new printing actor to determine if there was a selection within
the browsing context.

We now create two browsers, the primary browser and a selected browser,
and will use the appropriate browser depending on the settings value
for printSelectionOnly.

Differential Revision: https://phabricator.services.mozilla.com/D94467
2020-12-17 23:14:43 +00:00
Sam Foster
fa664601db Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-09 20:56:28 +00:00
Csoregi Natalia
4eae934956 Backed out 2 changesets (bug 1654684) for browser chrome failures with .printPreviewCurrentPageNumber. CLOSED TREE
Backed out changeset 2fdc1b5569e1 (bug 1654684)
Backed out changeset 8ae1d037aa9c (bug 1654684)
2020-12-09 16:11:42 +02:00
Sam Foster
0c4bb65e4d Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-09 02:59:26 +00:00
Brindusan Cristian
6474307318 Backed out 2 changesets (bug 1654684) for bc failures at browser_ext_tabs_printPreview. CLOSED TREE
Backed out changeset 5a0333ca8a19 (bug 1654684)
Backed out changeset 87d06a4d6ab6 (bug 1654684)
2020-12-07 12:59:10 +02:00
Sam Foster
61cfb019d9 Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-07 08:44:14 +00:00
Neil Deakin
8773757bb3 Bug 1669369, remove legacy actor from PrintingChild and replace with JSWindowActor, r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D92519
2020-10-28 19:19:52 +00:00
Narcis Beleuzu
57cc17836f Backed out changeset ab6c1419da26 (bug 1669369) for bc failures on browser_all_files_referenced.js CLOSED TREE 2020-10-28 17:32:34 +02:00
Neil Deakin
a1d6faff00 Bug 1669369, remove legacy actor from PrintingChild and replace with JSWindowActor, r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D92519
2020-10-28 13:58:27 +00:00
Emilio Cobos Álvarez
c0e75d0f39 Bug 1670643 - Ignore DOMWindowClose events fired at the preview browser. r=jfkthame
See the comment.

https://phabricator.services.mozilla.com/D90808 made it so that we
reused the print document (and thus <browser>) to do the actual print
job.

When a print job finishes, we call window.close(), which is used as a
signal to the front-end to clean up the <browser> element. Before that
patch we sent that signal to the browser created in printUtils.js, but
afterwards we send it to the preview window which causes this badness
when the event bubbles up.

Ignoring it effectively restores the previous behavior, so let's do it.

Differential Revision: https://phabricator.services.mozilla.com/D93499
2020-10-16 16:57:57 +00:00
Emilio Cobos Álvarez
4e68e78542 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
In order to avoid over/under-counting, we need to treat window.print()
specially. The new UI was using aOpenWindowInfo.isForPrintPreview for
that, but that doesn't quite work for the old UI (because it will
trigger a regular print, not a preview).

But since isForPrintPreview was only really needed to distinguish
window.print(), just rename it and set it to true when the old UI is
triggered by window.print() as well.

Differential Revision: https://phabricator.services.mozilla.com/D92925
2020-10-09 14:59:46 +00:00
Jonathan Watt
a6599d6437 Bug 1669723. Stop unnecessarily catching exceptions from nsIPrintSettingsService.lastUsedPrinterName. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D92768
2020-10-09 10:21:44 +00:00
Jonathan Watt
ef09d240ce Bug 1669187. Make sure we have a last used printer saved in the common case. r=bobowen,remote-protocol-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92879
2020-10-08 13:41:24 +00:00
Emilio Cobos Álvarez
4b4935794b Bug 140718 - Add a "Print selection only" entry to the context menu. r=Gijs,jwatt,fluent-reviewers
This allows to use the feature from the context menu and is very
straight-forward.

This has the benefit of working with fission (as print from the focused
frame) and so on.

Making a checkbox on the UI on top of this is doable, but it is a lot
more complex (requires a bunch of both front-end and platform work)
because undoing this implies restoring the DOM which "print selection"
removes.

I think the context menu entry is very useful regardless of whether we
add a checkbox to undo it, and other browsers (with smaller context
menus) seem to agree.

Differential Revision: https://phabricator.services.mozilla.com/D92205
2020-10-07 20:45:08 +00:00
Jonathan Watt
1890bfffde Bug 1667265. Remove nsIPrintSettingsService.globalPrintSettings. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D91366
2020-09-30 12:25:02 +00:00
Jonathan Watt
c6449897c3 Bug 1663733. Add telemetry for the time from print initiation to FrameLoader.printPreview() call and completion. r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D90370
2020-09-16 18:53:41 +00:00
Cosmin Sabou
2a72f3b160 Backed out changeset 0e787c1b0a30 (bug 1663733) for eslint failure on content/print.js. CLOSED TREE 2020-09-16 21:22:56 +03:00