From 6753ebf5a1f1111035719d83cab2507bc8e53ff1 Mon Sep 17 00:00:00 2001 From: Mustaq Ahmed Date: Fri, 15 Oct 2021 08:44:44 -0400 Subject: [PATCH] Add a definition of `contextmenu` event. (#316) Add a definition of `contextmenu` event. --- sections/event-types.txt | 57 +++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/sections/event-types.txt b/sections/event-types.txt index 9b72a66..a2c51db 100644 --- a/sections/event-types.txt +++ b/sections/event-types.txt @@ -1460,6 +1460,56 @@ myDiv.addEventListener("auxclick", function(e) { * If the event target is focusable, the default action MUST be to give that element document focus. +
contextmenu
+ + ++------------------+--------------------------------------------------------------------------------------+ event-definition + =| % | | + +------------------+--------------------------------------------------------------------------------------+ + +| Type | contextmenu | + +| Interface | {{PointerEvent}} | + +| Sync / Async | Sync | + +| Bubbles | Yes | + +| Trusted Targets | Element | + +| Cancelable | Yes | + +| Composed | Yes | + +| Default action | Invoke a context menu if supported. | + +| Context
| | + ++------------------+--------------------------------------------------------------------------------------+ + + A user agent MUST dispatch this event before invoking a context menu. + + When the EVENT{contextmenu} event is triggered by right mouse button, the + EVENT{contextmenu} event MUST be dispatched after the EVENT{mousedown} event. + +

+ Depending on the platform, the EVENT{contextmenu} event may be dispatched + before or after the EVENT{mouseup} event. +

+
dblclick
++------------------+--------------------------------------------------------------------------------------+ event-definition @@ -1883,7 +1933,7 @@ myDiv.addEventListener("auxclick", function(e) { +| Trusted Targets | Element | +| Cancelable | Yes | +| Composed | Yes | - +| Default action | Invoke a context menu (in combination with the right mouse button, if supported) | + +| Default action | None | +| Context
|