Commit Graph

252 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0ec6b77907 Bug 1752379 - Don't hide margins / headers settings on PDF printing. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D147308
2022-05-27 09:24:03 +00:00
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
Hanna Jones
602ce39e22 Bug 1756169 - Set print margins to 'None' when defaults are invalid r=mstriemer
For smaller paper sizes (e.g. label maker sized paper) it's possible that the defaut margins will be too large, wich results in non-obvious error state for the print dialog. In this case we want to fall back to using "None" margins to ensure the form is valid/printing is still possible.

Differential Revision: https://phabricator.services.mozilla.com/D142889
2022-05-13 18:19:32 +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
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
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
Emilio Cobos Álvarez
71359f4bcd Bug 1663366 - Make content select work on the parent process (and opt-in the print settings dialog into it). r=mconley
This should do nothing until bug 1744009 lands. It would also need
bug 1596852 to be usable, but no reason to not land it now.

Differential Revision: https://phabricator.services.mozilla.com/D132732
2021-12-08 11:34:02 +00:00
Mark Striemer
e40ea0b135 Bug 1661663 - Allow overriding @page margin rules r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D132284
2021-11-30 15:59:11 +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
Antonin LOUBIERE
eaab02de17 Bug 35228 - Ability to print even/odd pages. r=emilio,fluent-reviewers,mstriemer
Ability to print all even pages or all odd pages.

Differential Revision: https://phabricator.services.mozilla.com/D130111
2021-11-10 20:08:58 +00:00
Jonathan Watt
639001973b Bug 1740243. Backout accidental print.js changes in D126590 that are part of D130111. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D130741
2021-11-09 12:56:25 +00:00
Antonin LOUBIERE
cf38ac05ce Bug 1732366 - When closing last tab while having private window, remove the tab from the tabs list . r=Gijs
With session restore and close window on last tab close both enabled, if the last tab is closed while having another private window, move it from the winData.tabs list to the winData._closedTabs list.

Differential Revision: https://phabricator.services.mozilla.com/D126590
2021-11-01 17:09:28 +00:00
Haik Aftandilian
66d09c03b6 Bug 1735587 - "Sheets of paper" incorrect when numCopies>1 and sheetCount is odd r=emilio
Multiply the sheet count by numCopies after accounting for duplex printing.

Differential Revision: https://phabricator.services.mozilla.com/D128430
2021-10-15 00:01:13 +00:00
Emily McDonough
70a94c12b5 Bug 1721265 Part 3 - Use page-size orientation information in print preview r=emilio,emalysz
When a page-size that is not auto or square exists the print preview will use
the orientation of this page-size when doing initial reflow. The frontend
applies the orientation to the print settings without updating settings and
causing a second reflow, and the orientation selector is hidden.

Differential Revision: https://phabricator.services.mozilla.com/D124976
2021-09-21 16:38:54 +00:00
Hanna Jones
84cc5d012d Bug 1670871 - truncate custom margin max attr to two decimal places r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D125879
2021-09-17 15:28:49 +00:00
Haik Aftandilian
7e51a5f378 Bug 1695645 - "Sheets of paper" does not update when selecting "Print on both sides" r=emilio
Account for duplex mode when calculating the number of sheets of paper for the print dialog and printing to a device (not file).

Differential Revision: https://phabricator.services.mozilla.com/D125336
2021-09-14 23:55:59 +00:00
Mark Striemer
3f707aad80 Bug 1720178 - Treat prints that error checking for selection as no selection r=sfoster,emilio
Differential Revision: https://phabricator.services.mozilla.com/D119713
2021-07-20 14:21:08 +00:00
Matthew Noorenberghe
a09d8f4b6f Bug 1670027 - Always compute isPrintSelectionRBEnabled for the settings passed to the system print dialog. r=mstriemer
When the Mozilla PDF printer is selected, a new settings object was created without the value of isPrintSelectionRBEnabled computed.

Differential Revision: https://phabricator.services.mozilla.com/D119578
2021-07-13 00:25:38 +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
Matthew Noorenberghe
c3034d0bf1 Bug 1693069 - Focus the page range field when choosing a custom print range. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D118886
2021-07-05 22:55:55 +00:00
Sam Foster
fe6789544c Bug 1711791 - Output stringified settings in debug log, and resolved printer details. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D115428
2021-05-21 17:59:32 +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
98bf673289 Bug 1705348 - printToFile should only be true for the PDF printer. r=emalysz
There are users with broken prefs (old bugs that are fixed perhaps?),
but anyhow there's no sensible reason to set printToFile to true for
users printing from the print dialog.

We were working around it for the PDF printer but there's no reason we
shouldn't do it for other printers.

Differential Revision: https://phabricator.services.mozilla.com/D113821
2021-05-06 12:02:18 +00:00
Emma Malysz
8226b79c1a Bug 1675965, do not store file name in preference value for save to pdf printers r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D113413
2021-04-29 17:42:54 +00:00
Emilio Cobos Álvarez
f5d2db9ea9 Bug 1705757 - Fix my previous patch, d'oh.
MANUAL PUSH: Minor fixup in a CLOSED TREE
2021-04-17 22:35:45 +02:00
Emilio Cobos Álvarez
009ed37d0e Bug 1705757 - Restore _doPrint to fix mochitest which replaces it.
MANUAL PUSH: orange fix CLOSED TREE
2021-04-17 21:58:53 +02: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
Sam Foster
ba63a81a83 Bug 1682162 - Use the paperSizeUnit to display and handle mm/inch custom margin values. r=emalysz,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D104291
2021-03-13 00:27:53 +00:00
Tom Schuster
b1fdd19f81 Bug 1695622 - Gracefully handle missing paper when trying to getMarginPresets. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D107708
2021-03-12 17:53:55 +00:00
Tom Schuster
d8a55b8332 Bug 1694844 - In nsPrinterListCUPS::SystemDefaultPrinterName return NS_OK even without working CUPS. r=emilio
The other nsPrinterListCUPS methods already handle !InitOkay() without returning an error or rejecting
the promise.

Differential Revision: https://phabricator.services.mozilla.com/D107210
2021-03-04 16:03:30 +00:00
Emma Malysz
5493e49179 Bug 1669732, add error message for invalid number of copies r=mstriemer,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103385
2021-02-18 16:23:54 +00:00
Erik Nordin
19442ae4bc Bug 1692316 - Part 1: Update Platform Duplex Print Terminology r=dholbert
This patch updates the terminology used by the print platform from
the formerly used terms of "side edge" and "top edge" to now using
terms of "long edge" and "short edge".

These terms more accurately describe our existing implementation
behavior, and they are congruent with many existing APIs that also
use "long edge" and "short edge" terminology.

Differential Revision: https://phabricator.services.mozilla.com/D105499
2021-02-17 23:57:26 +00:00
Emilio Cobos Álvarez
799d6c68a0 Bug 1671702 - Expose both duplex print settings from the print UI. r=sfoster,fluent-reviewers,nordzilla
We can't wait forever for icons, and exposing the functionality using a
`<select>` is trivial and can be changed later easily if we come up with
a better UI.

Differential Revision: https://phabricator.services.mozilla.com/D104616
2021-02-11 19:27:58 +00:00
Emma Malysz
d63cfba21c Bug 1688099, save more settings state in a pref and honor value on subsequent prints r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D104121
2021-02-08 22:40:37 +00:00
Erik Nordin
0722070fca Bug 1673099 - Support duplex flip styles in the print platform r=jfkthame
Changes the print platform to use uniform terminology for duplex
printing styles.

- DuplexNone
- DuplexFlipOnSideEdge
- DuplexFlipOnTopEdge

Differential Revision: https://phabricator.services.mozilla.com/D94682
2021-02-02 22:19:30 +00:00
Emma Malysz
b0e5ed5625 Bug 1678293, update progress indicator string and limit how long a user has an empty document when saving a large file r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D101854
2021-01-19 20:28:07 +00:00
Bogdan Tara
7f42bf1ac0 Backed out changeset 125c68902194 (bug 1678293) for browser_pdf_printer_settings.js failures CLOSED TREE
DONTBUILD
2021-01-19 08:56:15 +02:00
Emma Malysz
8fa3776779 Bug 1678293, update progress indicator string and limit how long a user has an empty document when saving a large file r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D101854
2021-01-19 06:14:16 +00:00
Mark Striemer
28c50e6369 Bug 1668849 - Part 2: Move base components to top of components section r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101677
2021-01-18 23:01:31 +00:00
Mark Striemer
a7894cbe31 Bug 1668849 - Part 1: Unify more print settings to PrintSettingNumber r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101676
2021-01-18 23:01:24 +00:00
Mark Striemer
b87b97f5a1 Bug 1685823 - Only re-render preview on sheet count change when needed r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101514
2021-01-15 21:43:19 +00:00