`WebDriver:Print` implementation missing `background` argument
Categories
(Remote Protocol :: Marionette, defect, P1)
Tracking
(firefox113 fixed)
| Tracking | Status | |
|---|---|---|
| firefox113 | --- | fixed |
People
(Reporter: kaylafire, Assigned: Sasha)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [webdriver:m6], [wptsync upstream] [webdriver:relnote])
Attachments
(8 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
1.95 KB,
application/zip
|
Details | |
|
1.94 KB,
application/zip
|
Details | |
|
1.92 KB,
application/zip
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
When using WebDriver:Print though the WebDriver crate and geckodriver, marionette's current implementation ignores the parameter named background, and instead looks for a parameter named printBackground (https://searchfox.org/mozilla-central/source/remote/shared/PDF.jsm#45), therefore rendering it impossible to specify background rendering behavior for PDFs' in webdriver.
an example of this behavior in geckodriver with irreverent JSON parameters removed.
webdriver::server DEBUG -> POST /session/<SESSION_ID>/print {"background":true, <removed>, "printBackground":true, <removed>}
Marionette DEBUG 0 -> [0,5,"WebDriver:Print",{"background":true, <removed> }]
RemoteAgent DEBUG PDF output written to /build/Temp-<UUID>/marionette.pdf
when this returns, even though background is specified to be true, there are no backgrounds rendered in the resulting PDF.
| Reporter | ||
Comment 1•3 years ago
|
||
I've fixed this in my local checkout of mozilla-central, I'm hoping to have a patch ready for review soon.
| Reporter | ||
Comment 2•3 years ago
|
||
Rename the printBackground parameter to background to conform to the
WebDriver:Print spec
Updated•3 years ago
|
Thank you for finding this incompatibility with the WebDriver spec and even working on a fix! This is great to see. I'll be able to have a look at the patch soon.
Updated•3 years ago
|
| Reporter | ||
Comment 4•3 years ago
|
||
This attempts to assert the functionality of the background parameter by testing and assuming WebDriver:Print
will attempt to be somewhat deterministic.
pdf_options.py attempts to test for the functionality of the background parameter indirectly though equivalence using the following steps.
-
First, let
identitybe the result ofWebDriver:Print({}) -
Second, let
backgroundbe the result ofWebDriver:Print({ background: True }) -
Third, let
identity_checkbe the result ofWebDriver:Print({}) -
Fourth, assert that
identity != background -
Fifth, assert that
identity == identity_check
Depends on D153903
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
| Reporter | ||
Comment 5•3 years ago
|
||
| Reporter | ||
Comment 6•3 years ago
|
||
| Reporter | ||
Comment 7•3 years ago
|
||
| Reporter | ||
Comment 8•3 years ago
|
||
Hi there, I've added the results of running ./mach test with some extra code to dump the PDF output to files when testing.
I've run the tests multiple times, there's times where the equality test has run successfully up to 9 times in a row, but it seems to be inconsistent. These pdf's are an example of the changes the browser is making per PDF print operation.
also, I've found biodiff to be very useful in finding the specific changes between the two versions.
Hi Kayla, as you got a review from James a while ago I wonder if you are still interested to get his proposal with pdf.js implemented. Please let us know if not. Thanks!
| Reporter | ||
Comment 10•3 years ago
|
||
Hi Henrik!
Yes I still intend to implement the test suggestions from the review.
I had/have gotten caught up in other pressing work, my apologies for the radio silence.
I'm hoping to have the time to implement it this week.
No worries. Thanks for letting us know!
(In reply to Kayla Firestack [:kaylafire] from comment #10)
Yes I still intend to implement the test suggestions from the review.
I had/have gotten caught up in other pressing work, my apologies for the radio silence.I'm hoping to have the time to implement it this week.
Hi Kayla, we would kinda appreciate a fix here. So if you foresee that you won't have the time in the near future to continue please let us know and we might have to take over the remaining work. Thanks!
| Reporter | ||
Comment 13•3 years ago
|
||
Hi Henrik, I was unable to continue working on this due to environment issues, If someone else has time to finish the test for this I welcome it.
I'm so sorry I didn't see this sooner, I've been out of free time starting and on-boarding new job I couldn't account for before.
Thanks for letting us know and your patch for the print command! We will have to see how to get this finished and landed.
Setting to P2 given that we most likely want to work on that feature for BiDi in the next milestone.
Updated•3 years ago
|
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 16•2 years ago
|
||
Depends on D171083
| Assignee | ||
Comment 17•2 years ago
|
||
Depends on D171693
| Assignee | ||
Comment 18•2 years ago
|
||
Depends on D171694
Updated•2 years ago
|
Comment 19•2 years ago
|
||
Comment 21•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a5f7eb5de08b
https://hg.mozilla.org/mozilla-central/rev/46736eb834cb
https://hg.mozilla.org/mozilla-central/rev/95635d61a8fa
Updated•2 years ago
|
Description
•