Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new event to communicate context menu dismissal. #322

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1529,6 +1529,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
Loading