Commit Graph

260 Commits

Author SHA1 Message Date
Jonathan Watt
b677f00ccc Bug 1769388 - Change nsIPrintSettingsService's 'newPrintSettings' attribute to a 'createNewPrintSettings' function. r=bobowen,webdriver-reviewers,whimboo
Having an attribute be a constructor is just...wrong.

Differential Revision: https://phabricator.services.mozilla.com/D146383
2022-05-16 11:50:34 +00:00
Jonathan Watt
e336997b9a Bug 1769129. Remove nsIPrintSettings.isPrintSelectionRBEnabled. r=emilio
nsIPrintSettings is supposed to be a collection of settings passed to the
platform code to determine how the document prints. The
isPrintSelectionRBEnabled member doesn't belong here since it is a flag that
is passed to the OS native print settings dialog to tell it whether to
display a "Print selection only" radio button.

Depends on D146232

Differential Revision: https://phabricator.services.mozilla.com/D146251
2022-05-13 15:26:07 +00:00
Cristian Tuns
cebb65e9b3 Backed out changeset 00ef44ea9e3f (bug 1769129) for causing build bustages on nsPrintDialogX.mm CLOSED TREE 2022-05-13 08:20:12 -04:00
Jonathan Watt
7509ece9d9 Bug 1769129. Remove nsIPrintSettings.isPrintSelectionRBEnabled. r=emilio
nsIPrintSettings is supposed to be a collection of settings passed to the
platform code to determine how the document prints. The
isPrintSelectionRBEnabled member doesn't belong here since it is a flag that
is passed to the OS native print settings dialog to tell it whether to
display a "Print selection only" radio button.

Differential Revision: https://phabricator.services.mozilla.com/D146251
2022-05-13 11:57:08 +00:00
Jonathan Watt
f6c122e1d0 Bug 1769113 - Kill off nsIPrintingPromptService and use nsIPrintDialogService directly. r=emilio
nsIPrintingPromptService comes from an era when the platform print code would
open the print settings dialog, which defaulted to the OS native dialogs.
Its purpose was to allow that dialog to be overridden by embedders to provide
their own interface for the user to select print settings. Nowadays the
platform print code does not open the dialogs. Instead apps like Firefox are
responsible for getting the print settings to pass to the platform code, and
the platform code provides a way to open the OS native print dialog if they
want to use that (nsIPrintDialogService). So nsIPrintingPromptService no longer
has any purpose, and just adds indirection and needless complexity.

Differential Revision: https://phabricator.services.mozilla.com/D146232
2022-05-13 11:20:59 +00:00
Jonathan Watt
9fe04ae6d6 Bug 1769132 - Fix "Print selection only" when pref 'print.prefer_system_dialog' is set to true. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D146249
2022-05-12 20:59:24 +00:00
Jonathan Watt
343324b433 Bug 1712104 p2 - Support printing directly via the system print dialog. r=emilio
This is behind the bool pref print.prefer_system_dialog

Differential Revision: https://phabricator.services.mozilla.com/D135452
2022-05-06 14:30:25 +00:00
Jonathan Watt
bd8604a213 Bug 1712104 p1 - Refactor PrintUtils.startPrintWindow for easier reasoning. r=emilio,webdriver-reviewers
Having the called-back-for-new-static-doc logic mixed in with the
start-new-print logic was confusing. The new structure, function names
and comments should hopefully make it easier for people unfamiliar with the
various printing code flows to understand and reason about this code. It also
allows the addition of new print-via-system-dialog logic without things getting
completely out of hand.

Differential Revision: https://phabricator.services.mozilla.com/D135451
2022-05-06 14:30:24 +00:00
Emilio Cobos Álvarez
202fcd0999 Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.

The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.

Differential Revision: https://phabricator.services.mozilla.com/D142199
2022-03-30 18:51:58 +00:00
Iulian Moraru
7106f0368c Backed out changeset d42d7505c9cf (bug 1760836) for causing mochitest failures on browser_print_stream.js. CLOSED TREE 2022-03-29 23:32:39 +03:00
Emilio Cobos Álvarez
2ee3ba7653 Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.

The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.

Differential Revision: https://phabricator.services.mozilla.com/D142199
2022-03-29 17:50:58 +00:00
Jonathan Watt
6a014e32da Bug 1749018 - Roll PrintUtils._setPrinterDefaultsForSelectedPrinter into its sole caller. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D135355
2022-01-07 17:13:09 +00:00
Jonathan Watt
2fcd3c5856 Bug 1749016. Update Page Setup menu code in printUtils.js to reflect removal of the Print Preview menu. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D135351
2022-01-07 17:13:08 +00:00
Jonathan Watt
30c88a278d Bug 1749014 - Remove some unused printUtils.js code and a test. r=mstriemer
We don't "pass" print settings to the content process by saving them to prefs,
so the test is no longer useful (this removes the code it's testing anyway).

Differential Revision: https://phabricator.services.mozilla.com/D135349
2022-01-07 17:13:08 +00:00
Jonathan Watt
79109555b9 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
4bd6fa9eb2 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
694ce29c46 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
31bf88a168 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
d70db9baf8 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
6c14d03852 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
260ef48d25 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
614ba9d91d 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
719f2be567 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
7fe3c15bfa 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
8981cbcb1a 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
b9c3a531a2 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
52ee5d15ce 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
aefaad96af 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
3ecdc2bcdb 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
a35c7babe5 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
0e55bca38f 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
3f9c03ab78 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
1c7b2a9f3b 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
9a73b05d1b 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
73a16e79d9 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
9dcba03b71 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
36851bbb53 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
4aeecb504c 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
cc8fec8923 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
e8fa29326b 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
e6541ef741 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
24473dc461 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
6e23f8d01a 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
b79b69550f 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
294f4945cf 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
1f4d421611 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
b1d397a394 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
8647c92f00 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
69e18b4ee0 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
ab71c86aaf 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