Closed Bug 1256618 Opened 8 years ago Closed 8 years ago

Elements cannot be activated by clicking remote control

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: xeonchen, Assigned: xeonchen)

References

Details

Attachments

(2 files)

Step to reproduce:
1. connect to a nexus player with B2G installed, and the remote control is already paired.
2. in settings app, navigate to an element with sub-menu, e.g. Wi-Fi.
3. click the button located in the center of direction keys.

Result: nothing happened
Expected result: entering sub-menu

[1] mentions we should activate the element by some kind of trigger,
but in [2], only |NS_VK_RETURN| is handled.

My experiment is that the element can be triggered successfully by add support for |VK_SELECT|.
Are we going to support more keys such as 'Accept' or 'Select' listed in [3]?

[1] https://www.w3.org/TR/DOM-Level-3-Events/#event-flow-activation
[2] https://dxr.mozilla.org/mozilla-central/rev/d6ee82b9a74155b6bfd544166f036fc572ae8c56/dom/base/Element.cpp#3045
[3] https://www.w3.org/TR/DOM-Level-3-Events-key/
Attachment #8730653 - Flags: feedback?(masayuki)
Comment on attachment 8730653 [details] [diff] [review]
0001-Add-VK_SELECT-support.patch

Does the remote control has a button to cause VK_RETURN? If not so, I think that the button located in the center of direction key should cause VK_RETURN because the remote control cannot use on some web pages which listen to Enter key events.
Flags: needinfo?(xeonchen)
Attachment #8730653 - Flags: feedback?(masayuki)
Thanks @masayuki, then we should change the mapping from NS_VK_SELECT to NS_VK_RETURN here: https://dxr.mozilla.org/mozilla-central/source/widget/gonk/GonkKeyMapping.h#50
Another question: should we also change the key name mapping from "Accept" to "Return" at https://dxr.mozilla.org/mozilla-central/source/widget/NativeKeyToDOMKeyName.h#355 ?
The key code / key name mapping looks not synchronized to me.
Flags: needinfo?(masayuki)
(In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment #4)
> Another question: should we also change the key name mapping from "Accept"
> to "Return" at
> https://dxr.mozilla.org/mozilla-central/source/widget/NativeKeyToDOMKeyName.
> h#355 ?

Perhaps, yes. But please keep it. The attribute is still experimental until Chrome supports it in default settings. And I'll update some key values at once for conforming to the latest draft.

> The key code / key name mapping looks not synchronized to me.

Yes. key values are clearer defined but keyCode isn't defined by any standards. Therefore, keyCode is decided with the other browser's behavior.
Flags: needinfo?(masayuki)
Seems S.C. already answered the questions
Flags: needinfo?(xeonchen)
Comment on attachment 8731586 [details]
MozReview Request: Bug 1256618 - change VK_SELECT to VK_RETURN; r=masayuki

https://reviewboard.mozilla.org/r/40735/#review37501

Let's try this.
Attachment #8731586 - Flags: review?(masayuki) → review+
https://hg.mozilla.org/mozilla-central/rev/39e5c2cf1a5d
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Assignee: nobody → xeonchen
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: