From fd1817812e5f90a3f5462e2812951cfb5be81f19 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 22 Nov 2022 15:52:11 -0800 Subject: [PATCH] Add popover light dismiss integration I am adding a new HTML attribute called "popover" in https://github.com/whatwg/html/pull/8221 Part of this feature involves "light dismiss", where clicking outside of an element with the popover attribute causes it to be closed. This functionality was originally implemented by changing the event dispatching system of the DOM, but it was recommended to move it here instead: https://github.com/whatwg/dom/pull/1117#issuecomment-1311928234 https://chromium-review.googlesource.com/c/chromium/src/+/4023021 --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index f42b23b..9b37574 100644 --- a/index.html +++ b/index.html @@ -409,6 +409,8 @@

Firing events using the PointerEvent interface

If the event is {{GlobalEventHandlers/pointerdown}}, the associated device is a direct manipulation device, and the target is an {{Element}}, then set pointer capture for this pointerId to the target element as described in implicit pointer capture. +

Run light dismiss open popovers given the event and target.

+

Fire the event to the determined target. The user agent SHOULD treat the target as if the pointing device has moved over it for the purpose of ensuring event ordering [[UIEVENTS]].

Using the pointer capture target override as the target instead of the normal hit-test result may fire some boundary events, as defined by [[UIEVENTS]]. This is the same as the pointer leaving its previous target and entering this new capturing target. When the capture is released, the same scenario may happen, as the pointer is leaving the capturing target and entering the hit-test target.