input.Key{Down,Up}Action value should not accept multiple characters
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox131 fixed)
Tracking | Status | |
---|---|---|
firefox131 | --- | fixed |
People
(Reporter: martin, Assigned: jgraham)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m12][webdriver:external][wptsync upstream][webdriver:relnote])
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Steps to reproduce:
I'm currently implementing the BiDi spec for our project and noticed a quirk wrt. input.perofrmActions() [1] with KeyDown/Up. The spec does not define what "value" can/should contain at all, so I filed [2] and got explained that it uses the same values as classical webdriver [3].
In the end that all works well with both Firefox and Chromium, but during my experiments I noticed that trying to send multiple characters in a single action like this:
actions=[
{"type": "key", "id": "key-0", "actions": [
{"type": "keyDown", "value": "a"},
{"type": "keyUp", "value": "a"}
]}])
slightly misbehaves with Firefox.
[1] https://w3c.github.io/webdriver-bidi/#command-input-performActions
[2] https://github.com/w3c/webdriver-bidi/issues/757
[3] https://w3c.github.io/webdriver/#dfn-process-a-key-action
Actual results:
That action succeeds in Firefox, typing a literal "hello" into the website.
The webdriver spec [3] says:
If key is not a String containing a single unicode code point or grapheme cluster? return error with error code invalid argument.
So Firefox seems to ignore that part. This is not actually breaking anything that should work, just a quirk in the error handling.
Expected results:
In Chromium it fails as per the spec: bidi.WebdriverError: error: Invalid key value: hello
Reporter | ||
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
I'm mildly surprised that the rest of the code works, but the frontend should probably handle this; see the TODO in https://searchfox.org/mozilla-central/source/remote/shared/webdriver/Actions.sys.mjs#769-772
Reporter | ||
Comment 2•2 months ago
|
||
I didn't try may code points, but I did try \uE007 aka "Enter", and that works fine with Firefox 128.
Assignee | ||
Comment 3•2 months ago
|
||
Return InvalidArgumentError if the action value for key actions is
not exactly one grapheme cluster long.
Supporting full grapheme clusters rather than just single codepoints
is marked as TODO in the spec, so add tentative tests for that.
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 6•2 months ago
|
||
bugherder |
Description
•