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
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
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
This patch ensures that the global print_to_filename pref is checked
when initializing print settings from prefs.
It also fixes a regression which was preventing the Linux system dialog
from correctly reading its printer-specific print_to_filename prefs.
Differential Revision: https://phabricator.services.mozilla.com/D98975
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
We were always printing this.previewBrowser, which almost works (because
if the "print selection" setting is specified, the back-end will remove
non-selected nodes again), except in the case we print selection to
begin with and we've never rendered the regular preview.
This ensures we actually try to print what the user sees.
Differential Revision: https://phabricator.services.mozilla.com/D100329
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
This hides the platform provided printing dialog which shows progress while printing.
The dialog is dated but does provide an actual 0-100% progress indicator which
unfortunately this does not replace. It also provides a "Cancel" button which
also unfortunately doesn't work and gets us into a bad state.
This provides a simple spinner and a Printing... message to replace that dialog
so that the user knows that something is still happening.
Differential Revision: https://phabricator.services.mozilla.com/D99504
When loading a printer's settings it can take a few seconds for physical printers. If
this happens then changes made while the settings are being fetched could be thrown
away. Disable the form while we're loading settings for a printer to avoid losing
settings changes.
Differential Revision: https://phabricator.services.mozilla.com/D99156
This removes all the change event listeners so that all the elements listen
for just the input event. Listening to both could cause two settings change
events to be dispatched and requires writing code to ignore change events
in many components.
Differential Revision: https://phabricator.services.mozilla.com/D99136
When changing printers one of them could be slower than another. If you change
to a slow printer and back to an already loaded/fast printer then the slow
printer shouldn't overwrite the settings once it finally loads.
Example: Start print on PDF printer, switch to a physical printer and back to PDF. If
the physical printer had to be contacted to pull settings this operation could take
a few seconds, at which point the settings from the physical printer could overwrite
the PDF printer settings.
Differential Revision: https://phabricator.services.mozilla.com/D99135
A comma will separate the list of ranges, and a dash indicates a page range.
If the print preview returns an empty page, we send an update event
to display all pages and invalidate the form.
This patch also changes how we create deferred tasks and instead has the
PrintEventHandler create them. Depending on the type of setting changed,
the PrintEventHandler either immediately handles the event or arms the
delayed settings change task. If the input is invalid, we cancel the settings
change and disarm the task. We finalize any pending tasks when the user prints
and recreate them in case the print was "unsuccessful," meaning the form
is now invalid or the user cnacelled saving as a pdf.
Differential Revision: https://phabricator.services.mozilla.com/D95222