diff --git a/source b/source index 7f3add8ecb3..ea3271d843b 100644 --- a/source +++ b/source @@ -60297,7 +60297,7 @@ interface HTMLDialogElement : HTMLElement {
The close
event will not be fired.
The close()
method, and any close signals, will no longer be able to close the dialog.
If the dialog was shown using its Some example close signals are: Some example close requests are: The Esc key on desktop platforms Whenever the user agent receives a potential close signal targeted at a Whenever the user agent receives a potential close request targeted at a An example of relevant events that are outside of the model given in
UI Events would be assistive technology synthesizing an Esc Let event be null if no such events are fired, or the If document is not fully active, then abort these
steps. Let closedSomething be the result of signaling close watchers on document's relevant global
+ Let closedSomething be the result of processing close watchers on document's relevant global
object. If closedSomething is true, then abort these steps. Otherwise, there was nothing watching for a close signal. The user agent
+ Otherwise, there was nothing watching for a close request. The user agent
may instead interpret this interaction as some other action, instead of interpreting it as a
- close signal. On platforms where Esc is the close signal, the user
+ On platforms where Esc is the close request, the user
agent will first fire an appropriately-initialized On platforms where a back button is a potential close signal, no
+ On platforms where a back button is a potential close request, no
event is involved, so when the back button is pressed, the user agent queues a task to signal close watchers. If there is a close
+ task">queues a task to process close watchers. If there is a close
watcher on the close watcher stack, then that will get triggered. If there is
not, then the user agent can interpret the back button press in another way, for example as a
request to traverse the history by a delta of −1.showModal()
method, the Document
will still be
-
can get removed from the middle of it if a
close watcher is destroyed or closed via web developer code. User-initiated close signals always act on the top of the close watcher
+ data-x="close request">close requests always act on the top of the close watcher
stack, however.Document
- document, it must perform the following close signal steps:Document
+ document, it must perform the following close request steps:
@@ -80423,17 +80423,17 @@ body { display:none }
keydown
and keyup
sequence when
- the user sends a close signal by using a dismiss gesture.Event
object
@@ -80403,15 +80403,15 @@ body { display:none }
keydown
and
keyup
event sequence. If the web developer cancels the keyup
event by calling preventDefault()
, then nothing further happens. But if
- the event fires without being canceled, then the user agent proceeds to signal close
+ the event fires without being canceled, then the user agent proceeds to process close
watchers.
A close watcher is a struct with the following close watcher is created without transient activation. (Except the very first close watcher in the close watcher stack that is created without transient activation, which gets a pass on this restriction.) It causes a user-triggered - close signal to close all such grouped-together close watchers, thus ensuring that - web developers can't make close signals ineffective by creating an excessive number of close + close request to close all such grouped-together close watchers, thus ensuring that + web developers can't make close requests ineffective by creating an excessive number of close watchers.
A close watcher closeWatcher is
@@ -80646,7 +80646,7 @@ body { display:none }
To signal close watchers given a To process close watchers given a Let processedACloseWatcher be false. If any close watcher is already active, and the Acts as if a close signal was sent targeting watcher, by first
+ Acts as if a close request was sent targeting watcher, by first
firing a
- Window
window:Window
window:
{
Window
does not
have transient activation, then the resulting CloseWatcher
will be
closed together with that already-active close watcher in response to any
- close signal. (This already-active close watcher does not necessarily
+ close request. (This already-active close watcher does not necessarily
have to be a CloseWatcher
object; it could be a modal dialog
element,
or a popover generated by an element with the popover
attribute.)watcher.requestClose()
cancel
event, and if that event is not canceled
with preventDefault()
, proceeding to fire a
close
event before deactivating the close watcher as if CloseWatcherOptions
This is a helper utility that can be used to consolidate cancelation and closing logic into
the cancel
and close
event
- handlers, by having all non-close signal closing affordances call this method.
watcher.close()
If one wanted to implement a custom picker control, which closed itself on a user-provided
- close signal as well as when a close button is pressed, the following code shows how
- one would use the CloseWatcher
API to process close signals:
CloseWatcher
API to process close requests:
const watcher = new CloseWatcher();
const picker = setUpAndShowPickerDOMElement();
@@ -80871,9 +80871,9 @@ picker.querySelector('.close-button').onclick = () => watcher.requestClose();
For abuse prevention purposes, this event only fires if the page has history-action
- activation, which will be lost after any given close signal. This ensures
- that if the user sends a close signal twice in a row without any intervening user activation, the
- signal definitely goes through; the second signal ignores the , which will be lost after any given close request. This ensures
+ that if the user sends a close request twice in a row without any intervening user activation,
+ the request definitely succeeds; the second request ignores the
cancel
event handler and immediately closes the
CloseWatcher
.
CloseWatcher
construction. If one creates more than one
CloseWatcher
without user activation, then the newly-created one will get grouped
- together with the most-recently-created close watcher, so that a signal close
- signal will close them both:
+ together with the most-recently-created close watcher, so that a single close
+ request will close them both:
window.onload = () => {
// This will work as normal: it is the first close watcher created without user activation.
@@ -80908,7 +80908,7 @@ button1.onclick = () => {
};
button2.onclick = () => {
- // These will be grouped together, and both will close in response to a single close signal.
+ // These will be grouped together, and both will close in response to a single close request.
(new CloseWatcher()).onclose = () => { /* ... */ };
(new CloseWatcher()).onclose = () => { /* ... */ };
};
@@ -83963,8 +83963,8 @@ dictionary DragEventInit : MouseEventInit {
"Light dismiss" means that sending a close signal or clicking outside
- of a popover whose popover
attribute is in the "Light dismiss" means that sending a close request or clicking
+ outside of a popover whose popover
attribute is in the auto state will close the popover.
To light dismiss open popovers, given an Event
event:
cancel
Event
CloseWatcher
, dialog
elements, input
elements
- CloseWatcher
objects or dialog
elements when they receive a close signal, or at input
elements in the File state when the user does not change their selection
+ CloseWatcher
objects or dialog
elements when they receive a close request, or at input
elements in the File state when the user does not change their selection
change
@@ -138117,7 +138117,7 @@ INSERT INTERFACES HERE
close
Event
CloseWatcher
, dialog
elements
- CloseWatcher
objects or dialog
elements when they are closed via a close signal
+ CloseWatcher
objects or dialog
elements when they are closed via a close request or via web developer code
connect
@@ -140404,8 +140404,8 @@ INSERT INTERFACES HERE
Document License.
Part of the revision history of the Close signals and close watchers section can be found in the WICG/close-watcher
+ href="#close-requests-and-close-watchers">Close requests and close watchers section can be
+ found in the WICG/close-watcher
repository, which is available under the W3C Software and
Document License.