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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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