Skip to content

Commit

Permalink
Added a new event to communicate context menu dismissal.
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaqahmed committed Oct 19, 2021
1 parent da40699 commit 3a9c11c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions sections/event-interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ The following chart describes the inheritance structure of the interfaces descri
+| compositionupdate | Sync | Yes | Element | CompositionEvent | No | None |
+| compositionend | Sync | Yes | Element | CompositionEvent | No | None |
+| contextmenu | Sync | Yes | Element | PointerEvent | Yes | Invoke a context menu if supported |
+| contextmenudismiss| Async | Yes | Element | PointerEvent | No | None |
+| dblclick | Sync | Yes | Element | MouseEvent | No | Varies: for <a>targets</a> with an associated |
| | | | | | | activation behavior, executes the <a>activation |
| | | | | | | behavior</a>; for focusable <a>targets</a>, |
Expand Down
45 changes: 45 additions & 0 deletions sections/event-types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,51 @@ myDiv.addEventListener("auxclick", function(e) {
before or after the EVENT{mouseup} event.
</p>

<h5 id="event-type-contextmenudismiss"><dfn>contextmenudismiss</dfn></h5>

++------------------+--------------------------------------------------------------------------------------+ event-definition
=| % | |
+------------------+--------------------------------------------------------------------------------------+
+| Type | <strong><code>contextmenudismiss</code></strong> |
+| Interface | {{PointerEvent}} |
+| Sync / Async | Async |
+| Bubbles | Yes |
+| Trusted Targets | <code>Element</code> |
+| Cancelable | No |
+| Composed | Yes |
+| Default action | None |
+| Context<br/> | <ul> |
| (trusted events) | <li>{{Event}}.{{Event/target}} : element which received the preceeding |
| | EVENT(contextmenu) event.</li> |
| | <li>{{UIEvent}}.{{UIEvent/view}} : <a><code>Window</code></a></li> |
| | <li>{{UIEvent}}.{{UIEvent/detail}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/screenX}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/screenY}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/clientX}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/clientY}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/altKey}} : <code>false</code></li> |
| | <li>{{MouseEvent}}.{{MouseEvent/ctrlKey}} : <code>false</code></li> |
| | <li>{{MouseEvent}}.{{MouseEvent/shiftKey}} : <code>false</code></li> |
| | <li>{{MouseEvent}}.{{MouseEvent/metaKey}} : <code>false</code></li> |
| | <li>{{MouseEvent}}.{{MouseEvent/button}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/buttons}} : 0</li> |
| | <li>{{MouseEvent}}.{{MouseEvent/relatedTarget}} : <code>null</code></li> |
| | </ul> |
++------------------+--------------------------------------------------------------------------------------+

A <a>user agent</a> MUST dispatch this event before closing a context menu.
If the system context menu has been suppressed by canceling the
EVENT{contextmenu} event, the <a>user agent</a> still MUST dispatch this
event to allow the page script to close a custom context menu under the same
condition like a system context menu.

Every EVENT{contextmenu} event MUST be followed by a corresponding
EVENT{contextmenudismiss} event with an identical
{{Event}}.{{Event/target}}. However, if the target of the
EVENT{contextmenu} event has been removed from DOM before firing the
EVENT{contextmenudismiss} event, the latter will be fired to the HTML
<a>body element</a>.

<h5 id="event-type-dblclick"><dfn>dblclick</dfn></h5>

++------------------+--------------------------------------------------------------------------------------+ event-definition
Expand Down

0 comments on commit 3a9c11c

Please sign in to comment.