[e10s] F10 brings up Menu ToolBar in non-touchscreen computers, even when handling and stopping the propagation of the event

RESOLVED FIXED in Firefox 56

Status

()

defect
P3
normal
RESOLVED FIXED
2 years ago
a month ago

People

(Reporter: npokal, Assigned: masayuki)

Tracking

(Depends on 1 bug, Blocks 1 bug, {testcase})

Trunk
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

()

Attachments

(2 attachments, 1 obsolete attachment)

Reporter

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

I created a simple HTML page that will listen for the keydown event. When the key is F10 it will prevent the default and stop the propagation of the event. 


Actual results:

On touch screen computers this works as it should but on non-touchscreen computers the menu toolbar opens up. This causes the focus to leave the document. 


Expected results:

the menu toolbar should not open.

Comment 1

2 years ago
Can you provide the simple HTML page?
Component: Untriaged → Event Handling
Flags: needinfo?(npokal)
Keywords: testcase-wanted
Product: Firefox → Core
Reporter

Comment 2

2 years ago
Posted file index.html (obsolete) —
This is the HTML file it links to a js file called f10.js which i can also upload.
Reporter

Comment 3

2 years ago
(In reply to YF (Yang) from comment #1)
> Can you provide the simple HTML page?

I attached the HTML file. The below is the JS that I currently am running. I placed it in a file called f10.js. I dont know if you guys allow uploading JS files so I will just copy and paste it below:

document.addEventListener('keydown', function(event){
  var keyCode = event.keyCode;
  var input = document.getElementsByTagName('input');
  if (keyCode == 121){
    event.preventDefault();
    event.stopPropagation();
    input[0].value = 'You pressed F10';
  } else {
    input[0].value = 'Hit F10.'
  }

}, false);

Updated

2 years ago
Flags: needinfo?(npokal)

Comment 4

2 years ago
Posted file testcase
Attachment #8847366 - Attachment is obsolete: true

Updated

2 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dupeme
Summary: F10 brings up Menu ToolBar in non-touchscreen computers, even when handling and stopping the propagation of the event → [e10s] F10 brings up Menu ToolBar in non-touchscreen computers, even when handling and stopping the propagation of the event
Masayuki, is this related to bug 1347079?
Flags: needinfo?(masayuki)
Priority: -- → P3
No, but must be fixed when I fix bug 1257617.
Depends on: 1257617
Flags: needinfo?(masayuki)
I misunderstood around the implementation of menubar. I can fix this bug quickly.
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Component: Event Handling → XP Toolkit/Widgets: Menus
OS: Unspecified → All
Hardware: Unspecified → All
Version: 52 Branch → Trunk
Comment hidden (mozreview-request)
Comment on attachment 8886633 [details]
Bug 1347351 - nsMenuBarListener::KeyPress() should wait reply event for handling F10 key

Hmm, this causes new orange.
Attachment #8886633 - Flags: review?(bugs) → review-
Comment on attachment 8886633 [details]
Bug 1347351 - nsMenuBarListener::KeyPress() should wait reply event for handling F10 key

Oops, sorry for the bug spam. This patch is fine.
Attachment #8886633 - Flags: review- → review?(bugs)

Comment 13

2 years ago
mozreview-review
Comment on attachment 8886633 [details]
Bug 1347351 - nsMenuBarListener::KeyPress() should wait reply event for handling F10 key

https://reviewboard.mozilla.org/r/157396/#review163222
Attachment #8886633 - Flags: review?(bugs) → review+

Comment 16

2 years ago
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/ec113974cdd9
nsMenuBarListener::KeyPress() should wait reply event for handling F10 key r=smaug
Comment hidden (mozreview-request)

Comment 18

2 years ago
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s a450755d89bc -d ec113974cdd9: rebasing 408758:a450755d89bc "Bug 1347351 - nsMenuBarListener::KeyPress() should wait reply event for handling F10 key r=smaug" (tip)
merging layout/xul/nsMenuBarListener.cpp
warning: conflicts while merging layout/xul/nsMenuBarListener.cpp! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Backed out for bustage at nsMenuBarListener.cpp:336: 'class mozilla::WidgetKeyboardEvent' has no member named 'MaybePostedToRemoteProcessLater':

https://hg.mozilla.org/integration/autoland/rev/46b12a5d51b89a211ea788909ec7e366f8e6ed0b

Push with bustage: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=ec113974cdd9a44fa035a2c69678cad9fc28d35b&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Build log: https://treeherder.mozilla.org/logviewer.html#?job_id=116734338&repo=autoland

[task 2017-07-23T15:40:39.639414Z] 15:40:39     INFO -  In file included from /home/worker/workspace/build/src/obj-firefox/layout/xul/Unified_cpp_layout_xul1.cpp:38:0:
[task 2017-07-23T15:40:39.639529Z] 15:40:39     INFO -  /home/worker/workspace/build/src/layout/xul/nsMenuBarListener.cpp: In member function 'nsresult nsMenuBarListener::KeyPress(nsIDOMEvent*)':
[task 2017-07-23T15:40:39.639611Z] 15:40:39     INFO -  /home/worker/workspace/build/src/layout/xul/nsMenuBarListener.cpp:336:29: error: 'class mozilla::WidgetKeyboardEvent' has no member named 'MaybePostedToRemoteProcessLater'
[task 2017-07-23T15:40:39.639657Z] 15:40:39     INFO -           if (nativeKeyEvent->MaybePostedToRemoteProcessLater()) {
[task 2017-07-23T15:40:39.639688Z] 15:40:39     INFO -                               ^
[task 2017-07-23T15:40:39.639740Z] 15:40:39     INFO -  /home/worker/workspace/build/src/config/rules.mk:1050: recipe for target 'Unified_cpp_layout_xul1.o' failed
[task 2017-07-23T15:40:39.639777Z] 15:40:39     INFO -  gmake[5]: *** [Unified_cpp_layout_xul1.o] Error 1
Flags: needinfo?(masayuki)

Comment 20

2 years ago
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/60566dab0b59
nsMenuBarListener::KeyPress() should wait reply event for handling F10 key r=smaug

Comment 21

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/60566dab0b59
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Component: XP Toolkit/Widgets: Menus → XUL
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.