Implement a Promise returning nsIPrinter.createDefaultSettings()
Categories
(Core :: Printing: Setup, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: jwatt, Assigned: nordzilla)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [print2020_v81])
Attachments
(2 files, 1 obsolete file)
Bug 1658299 - Part 1: Add createDefaultSettings() to nsIPrinter for CUPS r=jwatt,alaskanemily,emilio
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
nsPrinterListWin::InitPrintSettingsFromPrinter makes a blocking call to system APIs, which unfortunately is unnecessarily slowing down the new printing UI since that is called under this frontend code. The frontend code should not need to get these defaults last-used settings for that printer have been saved to prefs and the frontend code will be using those values.
We could improve things by implementing a new Promise returning nsIPrinter.defaultSettings attribute, and get rid of nsIPrintSettingsService.initPrintSettingsFromPrinter altogether.
Reporter | ||
Comment 1•4 years ago
|
||
Although I guess the object should should be mutable, so a creation function would be better.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
This should really be P1. Without this the new UI will create a print preview with zero margins (at least on macOS and Linux), which will in most cases result in cropping of the print output, which would really annoy users.
Comment 4•4 years ago
|
||
This retrieves the same settings from the printer as
InitPrintSettingsFromPrinter.
There is probably a lot of scope for de-duplication of code here, but I decided
to try and protect the old fallback paths.
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
This retrieves the same settings from the printer as
InitPrintSettingsFromPrinter.
There is probably a lot of scope for de-duplication of code here, but I decided
to try and protect the old fallback paths.
Phabricator Revision: https://phabricator.services.mozilla.com/D87604
Depends on D87125
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Backed out changeset ebf8dfa204ea (bug 1658299) for test_printer_default_settings.html failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/cda275a5ba19aa62274f9d0264440216be89eaad
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=313511953&repo=autoland&lineNumber=8674
[task 2020-08-20T02:29:38.563Z] 02:29:38 INFO - TEST-START | layout/base/tests/chrome/test_printer_default_settings.html
[task 2020-08-20T02:29:38.602Z] 02:29:38 INFO - GECKO(1792) | [4280, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp, line 1131
[task 2020-08-20T02:29:38.681Z] 02:29:38 INFO - GECKO(1792) | [4280, Main Thread] WARNING: '!devmode', file /builds/worker/checkouts/gecko/widget/windows/nsPrintSettingsWin.cpp, line 183
[task 2020-08-20T02:29:38.681Z] 02:29:38 INFO - GECKO(1792) | console.log: "number"
[task 2020-08-20T02:29:38.700Z] 02:29:38 INFO - GECKO(1792) | [4280, Main Thread] WARNING: '!devmode', file /builds/worker/checkouts/gecko/widget/windows/nsPrintSettingsWin.cpp, line 183
[task 2020-08-20T02:29:38.701Z] 02:29:38 INFO - GECKO(1792) | console.log: "number"
[task 2020-08-20T02:29:38.701Z] 02:29:38 INFO - Buffered messages logged at 02:29:38
[task 2020-08-20T02:29:38.701Z] 02:29:38 INFO - Microsoft XPS Document Writer
[task 2020-08-20T02:29:38.701Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Printer name should be a string.
[task 2020-08-20T02:29:38.702Z] 02:29:38 INFO - TEST-FAIL | layout/base/tests/chrome/test_printer_default_settings.html | Print settings' printer should match the printer that created them. - got "", expected "Microsoft XPS Document Writer"
[task 2020-08-20T02:29:38.702Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper name should never be null.
[task 2020-08-20T02:29:38.702Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper width hould never be null.
[task 2020-08-20T02:29:38.702Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper height hould never be null.
[task 2020-08-20T02:29:38.703Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.703Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.703Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.703Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-FAIL | layout/base/tests/chrome/test_printer_default_settings.html | Print settings' color mode should match the printer's color support. - got false, expected true
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Print settings were initialized from printer
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | undefined assertion name
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - Fax
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Printer name should be a string.
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-FAIL | layout/base/tests/chrome/test_printer_default_settings.html | Print settings' printer should match the printer that created them. - got "", expected "Fax"
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper name should never be null.
[task 2020-08-20T02:29:38.704Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper width hould never be null.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper height hould never be null.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Paper margins should be greater than or equal to zero.
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - Buffered messages finished
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-UNEXPECTED-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Print settings' color mode should match the printer's color support. - false should equal false
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-INFO | expected FAIL
[task 2020-08-20T02:29:38.705Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | Print settings were initialized from printer
[task 2020-08-20T02:29:38.706Z] 02:29:38 INFO - TEST-PASS | layout/base/tests/chrome/test_printer_default_settings.html | undefined assertion name
[task 2020-08-20T02:29:38.721Z] 02:29:38 INFO - GECKO(1792) | MEMORY STAT | vsize 913MB | vsizeMaxContiguous 650MB | residentFast 295MB | heapAllocated 117MB
Assignee | ||
Comment 9•4 years ago
|
||
Gah, the guards I put on the test to ensure that those assertions didn't run on Windows only worked for Windows 10 and not Windows 7.
I'm just going to remove those assertions from the test in part 1, since part 2 adds that functionality is working just fine.
Here is a try run that includes all the platforms, including Windows 7:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=919e30b7ef0ce675c3035872c0ed7cd47b3d463e
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
Description
•