Closed Bug 1417955 Opened 8 years ago Closed 6 years ago

WebDriver:PerformActions: keydown for " " behaves differently from keyDown for u"\ue00d"

Categories

(Remote Protocol :: Marionette, enhancement, P2)

Version 3
enhancement

Tracking

(firefox76 fixed)

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: impossibus, Assigned: jgraham)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In particular, keyCode 32 should be set in the resulting keydown event object in both cases. The event is constructed correctly for u"\ue00d", but when we send a keydown action with value " ", we get a keyCode of 0.
Does that only apply to space, or are other keycodes also affected? I would really assume the latter.
Similar/dupe of bug 1388812? At the end send keys should use actions internationally, but it could be a general issue affecting both at the same time.
The other keycodes are correct, that's why I filed a bug that is specific to :" ". bug 1388812 is a different issue.
[Mass Change 2018-01-15] Moving bugs to backlog
Priority: -- → P3
Summary: performActions: keydown for " " behaves differently from keyDown for u"\ue00d" → WebDriver:PerformActions: keydown for " " behaves differently from keyDown for u"\ue00d"
Priority: P3 → P2

Is there more to this than

diff --git a/testing/marionette/event.js b/testing/marionette/event.js
index 2143094dc493..77568b424e39 100644
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -890,6 +890,7 @@ const VIRTUAL_KEYCODE_LOOKUP = {
   "\uE00A": "VK_ALT",
   "\uE00B": "VK_PAUSE",
   "\uE00C": "VK_ESCAPE",
+  " ": "VK_SPACE", // printable
   "\uE00D": "VK_SPACE", // printable
   "\uE00E": "VK_PAGE_UP",
   "\uE00F": "VK_PAGE_DOWN",

Maybe not. Have you tested it it?

Flags: needinfo?(james)
Assignee: nobody → james
Status: NEW → ASSIGNED

The spec seems a bit confusing to me: https://w3c.github.io/webdriver/#keyboard-actions

IIUC, the first table says "Space" is coded to \uE00D, but the second table says "Space"->" " while "Shift+Space"->\uE00D. Am I just reading this wrong?

What that means in the spec is that using SendKeys("\uE00D") should imply the shift modifier. I suspect that's a bug in which the second column of the second table was used for two different things that are usually equivalent, but not here, but I'm not sure. Want to file a spec issue?

In any case that doesn't affect actions which don't do implied shift.

Flags: needinfo?(james)
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/autoland/rev/979782ad22de Ensure we get the correct keyCode for a space character, r=marionette-reviewers,maja_zf
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/22450 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.

What that means in the spec is that using SendKeys("\uE00D") should imply the shift modifier

I see. I think I understand now. For some reason, the Space key has its shifted character defined as \uE00D in the second table, but the this Alternate Key does not have a different Normalized Key Value (unlike those numpad keys, for example) -- in other words, both Space and Shift+Space normalize to " ". If so, then I think the spec is coherent. It was a bit confusing to me as someone who's not familiar with the spec language (like, I should've probably started from the algorithms instead of these tables and definitions).

the second column of the second table was used for two different things that are usually equivalent, but not here

I'm not sure what you meant here.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Upstream PR merged by moz-wptsync-bot
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: