Closed Bug 1090906 Opened 7 years ago Closed 7 years ago

Inaccessible context menu is presented with right-click when in Pointer lock mode.


(Core :: DOM: Events, defect)

33 Branch
Windows 7
Not set





(Reporter: jujjyl, Assigned: smaug)



(1 file)


1. Visit
2. Click on the canvas, accept the fullscreen and pointerlock requests.
3. Press the right mouse button.


A context menu is presented, but the user has no way to access it since there is no mouse cursor:


The context menu should not appear on right-click.
hmm, I wonder what the behavior should be.
I guess the context menu could be disabled, or even should be.
I don't think there's other way than to disable the context menu. This is because when the user right-clicks, there's no way to choose which element the context menu should apply to. Dropping the fullscreen mode, one can also repro it here: . It seems that the context menu is applied to the element that's at the center of the screen, and if one resizes the page to very small size before going to pointer lock mode, so that the canvas is not at the center of the page, then the context menu that pops up applies to the page background rather than the canvas, which makes no sense.
But we still do want right clicks I assume. Just don't show the contextmenu.
Yeah, definitely - applications will want to process the right clicks in a way that they see applicable, so the right click events should flow, just that a context menu would never show up even if the JS code did not .preventdefault() the events away.
Ok, let's not dispatch contextmenu event nor show the context menu.
Assignee: nobody → bugs

Returning error code from EventStateManager::PreHandleEvent prevents
DOM dispatch and PostHandleEvent call.

CreateClickHoldTimer/FireContextClick cases are need for the case when we
have click_and_hold_activates_context_menu active.

Test is rather minimal.
(and we have pointerlock tests disabled on linux, but I enabled them locally)
Attachment #8513750 - Flags: review?(masayuki)
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Great work, thanks!
You need to log in before you can comment on or make changes to this bug.