diff --git a/source b/source index b35091503a7..7a02a279efd 100644 --- a/source +++ b/source @@ -61158,6 +61158,7 @@ interface HTMLDetailsElement : HTMLElement {
closedby
open
dialog
element is active and that the user can interact with it.
+ The closedby
+ content attribute is an enumerated attribute with the following keywords and
+ states:
Keyword + | State + | Brief description + |
---|---|---|
any
+ | Any + | Close requests or clicking outside closes the dialog. + |
closerequest
+ | Close Request + | Close requests close the dialog. + |
none
+ | None + | Nothing automatically closes the dialog. + |
The closedby
attribute's invalid value default and missing value
+ default are both the Auto state. The auto state matches closerequest when the element is modal;
+ otherwise none.
A dialog
element without an open
attribute
@@ -61343,6 +61377,27 @@ interface HTMLDialogElement : HTMLElement {
Add an open
attribute to this, whose
value is the empty string.
Set this's close watcher to the + result of establishing a close watcher given + this's relevant global object, with:
+ +cancelAction being to return the
+ result of firing an event named cancel
at this, with the cancelable
attribute initialized to true.
closeAction being to close the + dialog given this and null.
enabled being true if this's
+ closedby
attribute state is Any or Close Request; otherwise false.
Set this's previously focused element to the focused element.
closeAction being to close the dialog given this and null.
enabled being true if this's
+ closedby
attribute is in the Any, Close Request, or Auto state; otherwise false.
The Document
has a dialog pointerdown target, which is an HTML dialog element or null, initially null.
Each dialog
element has a close watcher,
which is a close watcher or null, initially null.
The following attribute change + steps, given element, localName, oldValue, + value, and namespace, are used for HTML + dialog elements:
+ +If namespace is not null, then return.
If localName is not closedby
, then
+ return.
If element has no open attribute, then + return.
If oldValue and value are in the same state, then return.
Assert: element's close + watcher is not null.
If value is in the Any state, + or Close Request state, + or Auto state and element's is + modal flag is true, then let enabled to true; otherwise false.
Set element's close watcher's enabled boolean to enabled.
The closedBy
IDL attribute must reflect the
+ closedby
content attribute, limited to only
+ known values.
The open
IDL
attribute must reflect the open
content
attribute.
"Light dismiss" means that clicking outside of a dialog whose closedby
attribute is in the any state will close the dialog. This is in addition to
+ how such dialogs respond to close requests.
To light dismiss open dialogs, given an Event
event:
Assert: event's isTrusted
attribute is true.
Let target be event's target.
Let document be target's node document.
If document's showing any dialog list is empty, then + return.
If event is a PointerEvent
and event's type
is "pointerdown
",
+ then: set document's dialog pointerdown target to the result of running
+ topmost clicked dialog given target.
If event is a PointerEvent
and event's type
is "pointerup
",
+ then:
Let clickedDialog be the result of running topmost clicked + dialog given target.
Let topDialog be document's showing any dialog + list's last element.
Let clickedTopDialog be clickedDialog is topDialog, or + clickedDialog is dialog pointerdown target
Set document's dialog pointerdown target to null.
If clickedTopDialog, then return.
Perform close the dialog given topDialog.
Light dismiss open dialogs will be called by the Pointer Events spec when the user clicks + or touches anywhere on the page.
+ +To find the topmost clicked dialog, given a Node
node:
Let clickedDialog be the result of running nearest inclusive open + dialog given node.
Return clickedDialog.
To get the showing any dialog list for a
+ Document
document:
Let dialogs be « ».
For each Element
element in
+ document's top layer: if element is a dialog element
, element's closedby
attribute is in the any state and element has an open
attribute, then append
+ element to dialogs.
Return dialogs.
To find the nearest inclusive open dialog given a Node
+ node, perform the following steps. They return an HTML dialog element or null.
Let currentNode be node.
While currentNode is not null:
+ +If currentNode is an HTML dialog
+ element, currentNode's closedby
+ attribute is in the any state and
+ currentNode has an open
attribute, then
+ return currentNode.
Set currentNode to currentNode's parent in the flat + tree.
Return null.
An is running cancel action boolean.
An enabled boolean.
A close watcher closeWatcher is
@@ -82122,8 +82325,10 @@ body { display:none }
To establish a close watcher given a
Window
window, a list
- of steps cancelAction, and a
- list of steps closeAction:
Assert: window's is running cancel action
If closeWatcher is not active, then return true.
If closeWatcher's enabled is false, + then return true.
If closeWatcher's is running cancel action is true, then return true.
If closeWatcher is not active, then return.
If closeWatcher's enabled is false, + then return true.
If closeWatcher's window's associated Document
is not fully
active, then return.
Set processedACloseWatcher to true.
If closeWatcher's enabled is + true, set processedACloseWatcher to true.
Let shouldProceed be the result of requesting to close