From 4a93ad6171fff4059047bf92821cea7361c6e0fe Mon Sep 17 00:00:00 2001
From: Mason Freed
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
@@ -61819,6 +61853,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
@@ -82848,8 +83051,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
From 3630019067fbf221a662b4aaf36756fc05886034 Mon Sep 17 00:00:00 2001
From: Mason Freed The To find the topmost clicked dialog, given a Return clickedDialog. To get the showing any dialog list for a
+ To get the light dismissible dialog list for a
Let dialogs be « ». For each The argument, if provided, provides a return value. Requests the closure of the The argument, if provided, provides a return value. Returns the Close the dialog this with returnValue. The If returnValue is not given, then set it to null. Request to close the dialog with this and
+ returnValue. When a Let topDialog be document's light dismissible dialog
list's last element. Let sameTarget be true if var>clickedDialog is dialog pointerdown
+ Let sameTarget be true if clickedDialog is dialog pointerdown
target. Let clickedTopDialog be true if clickedDialog is
@@ -62295,14 +62315,36 @@ interface HTMLDialogElement : HTMLElement {
If clickedTopDialog is true or sameTarget is false, then return. Perform close the dialog given topDialog. Perform request to 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 run light dismiss activities, given an Run Light dismiss open dialogs with event. Run Light dismiss open popovers with event. Run light dismiss activities will be called by the Pointer Events spec when the user clicks
+ or touches anywhere on the page. To request to close the dialog, given a Let notCanceled be the result of firing an event named If notCanceled is false, return. Close the dialog given dialog and returnValue. To find the topmost clicked dialog, given a Let dialogs be « ». For each Light dismiss open popovers will be called by the Pointer Events spec when the user clicks
- or touches anywhere on the page. To find the topmost clicked popover, given a The If returnValue is not given, then set it to null. Let topDialog be document's light dismissible dialog
list's last element. Let sameTarget be true if clickedDialog is dialog pointerdown
+ Let sameTarget be true if clickedDialog is dialog pointerdown
target. Let clickedTopDialog be true if clickedDialog is
@@ -62313,7 +62313,7 @@ interface HTMLDialogElement : HTMLElement {
Set document's dialog pointerdown target to null. If clickedTopDialog is true or sameTarget is false, then return. If clickedTopDialog is true or sameTarget is false, then return. Perform request to close the dialog given topDialog. To request to close the dialog, given a Let notCanceled be the result of
Date: Fri, 1 Nov 2024 09:09:02 -0700
Subject: [PATCH 05/17] Move note out of OL
---
source | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/source b/source
index 5ebe916312b..ad01f070087 100644
--- a/source
+++ b/source
@@ -62326,12 +62326,12 @@ interface HTMLDialogElement : HTMLElement {
Run Light dismiss open dialogs with event. Run Light dismiss open popovers with event. Run light dismiss activities will be called by the Pointer Events spec when the user clicks
- or touches anywhere on the page. Run light dismiss activities will be called by the Pointer Events spec when the user clicks
+ or touches anywhere on the page. To request to close the dialog, given a The If this does not have an If returnValue is not given, then set it to null. Request to close the dialog with this and
From fb01762f6422c36cf1e9069b54deda47a471204d Mon Sep 17 00:00:00 2001
From: Mason Freed Let target be event's target. Assert: event is a Let document be target's node document. If document's light dismissible dialog list is empty, then
return. If event is a Let ancestor be the result of running topmost clicked dialog
+ given target and event. If event's If event is a If event's Let clickedDialog be the result of running topmost clicked
- dialog given target. Let topDialog be document's light dismissible dialog
- list's last element. Let sameTarget be true if clickedDialog is dialog pointerdown
+ Let sameTarget be true if ancestor is dialog pointerdown
target. Let clickedTopDialog be true if clickedDialog is
- topDialog, Set document's dialog pointerdown target to null. If clickedTopDialog is true or sameTarget is false, then return. If sameTarget is false, then return. Perform request to close the dialog given topDialog. For each dialog in document's light dismissible
+ dialog list, in reverse order, run these substeps: If dialog is ancestor, continue. Perform request to close the dialog given dialog. To run light dismiss activities, given an Run Light dismiss open dialogs with event. Run Light dismiss open popovers with event. Run Light dismiss open dialogs with event. Set currentNode to currentNode's parent in the flat
tree. The The Auto state matches Close Request state when the element is modal;
+ otherwise the None state. enabled being true if this's
enabled being true if this's
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
+ If the Set element's close watcher's HTMLDialogElement : HTMLElement {
"Light dismiss" means that clicking outside of a dialog whose To light dismiss open dialogs, given an Let dialogs be « ». For each If sameTarget is false, then return. For each dialog in document's light dismissible
- dialog list, in reverse order, run these substeps: Let dialogList be document's light dismissible
+ dialog list, in reverse order. We make a copy of the light dismissible dialog list because that list
+ will change as dialogs are closed. For each dialog in dialogList, run these substeps: If dialog is ancestor, continue. If dialog's Perform request to close the dialog given dialog. For each closeAction being to close the
- dialog given this and null. enabled being true if this's
If this does not have an If this's is modal is false, throw an
+ " Assert: this's close watcher
+ is not null. If returnValue is not given, then set it to null. Request to close the dialog with this and
+ Set this's requestClose returnValue to
returnValue. Request to close dialog's
+ close watcher. When a Each Each If dialog's Perform request to close the dialog given dialog. If dialog's close watcher is not
+ null, Request to close dialog's
+ close watcher. To request to close the dialog, given a Let notCanceled be the result of firing an event named If notCanceled is false, return. Close the dialog given dialog and returnValue. To find the topmost clicked dialog, given a Add an 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 closeAction being to close the
- dialog given this and this's requestClose
- returnValue. enabled being true if this's
- Set the dialog closewatcher with this. Set this's previously focused element to the
focused element. If this has an If this's node document is not fully active, then
- throw an " If this is not connected, then throw an
" If this's node document is not fully active, then
+ throw an " If this is in the popover showing
state, then throw an " Set this's close watcher to the
- result of establishing a close watcher given
- this's relevant global object, with: cancelAction given
- canPreventClose being to return the result of firing an event named closeAction being to close the
- dialog given this and null. enabled being true if this's
- Set the dialog closewatcher with this. Set this's previously focused element to the
focused element. Run the dialog focusing steps given this. To set the dialog closewatcher, given a cancelAction given
+ canPreventClose being to return the result of firing
+ an event named closeAction being to close the
+ dialog given dialog and dialog's requestClose
+ returnValue. enabled being true if dialog's
+ closedby state is not None;
+ otherwise false. To retrieve a dialog's closedby state, given a If dialog's If dialog's If dialog's If dialog's is modal is true, return Close Request. Return None. The dialog focusing steps, given a If this does not have an If this's is modal is false, throw an
+ If this's closedby state is
+ None, throw an
" Assert: this's close watcher
@@ -62242,17 +62247,12 @@ interface HTMLDialogElement : HTMLElement {
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 the If element's closedby state is not
+ None state then let enabled
+ to true; otherwise false. Set element's close watcher's enabled boolean to enabled. If dialog is ancestor, continue. If dialog's If dialog's closedby state is not
+ Any, continue. If dialog's close watcher is not
null, Request to close dialog's
From b57968e81a76395a5d8e0e6f96862d85dae9be31 Mon Sep 17 00:00:00 2001
From: Mason Freed If sameTarget is false, then return. Let dialogList be document's light dismissible
- dialog list, in reverse order. Let dialogList be document's light dismissible
+ dialog list, in reverse order. We make a copy of the light dismissible dialog list because that list
- will change as dialogs are closed. We make a copy of the light dismissible dialog list because that list
+ will change as dialogs are closed. For each dialog in dialogList, run these substeps: For each dialog in dialogList, run these substeps: If dialog is ancestor, continue. If dialog is ancestor, continue. If dialog's closedby state is not
- Any, continue. If dialog's closedby state is not
+ Any, continue. If dialog's close watcher is not
- null, Request to close dialog's
- close watcher. If dialog's close watcher is not
+ null, Request to close dialog's
+ close watcher. To set the dialog closewatcher, given a cancelAction given
- canPreventClose being to return the result of firing
- an event named Set dialog's close watcher to the
+ result of establishing a close watcher given
+ dialog's relevant global object, with: closeAction being to close the
- dialog given dialog and dialog's requestClose
- returnValue. cancelAction given
+ canPreventClose being to return the result of firing
+ an event named enabled being true if dialog's
- closedby state is not None;
- otherwise false. closeAction being to close the
+ dialog given dialog and dialog's requestClose
+ returnValue. enabled being true if dialog's
+ closedby state is not None;
+ otherwise false. To retrieve a dialog's closedby state, given a If dialog's closedby state is not
Any, continue. If dialog's close watcher is not
- null, Request to close dialog's
+ Assert dialog's close watcher is not
+ null. Request to close dialog's
close watcher. Let document be target's node document. If document's light dismissible dialog list is empty, then
- return. If document's light dismissible dialog list is
+ empty, then return. Let ancestor be the result of running topmost clicked dialog
given target and event. The following features and terms are defined in CSS Syntax:
@@ -61594,8 +61595,8 @@ interface HTMLDialogElement : HTMLElement {
[CEReactions] attribute DOMString closedBy;
[CEReactions] undefined show();
[CEReactions] undefined showModal();
- [CEReactions] undefined close(optional DOMString returnValue);
- [CEReactions] undefined requestClose(optional DOMString returnValue);
+ [CEReactions] undefined close(optional DOMString returnValue = null);
+ [CEReactions] undefined requestClose(optional DOMString returnValue = null);
};
The Auto state matches Close Request state when the element is modal;
- otherwise the None state. The Auto state behaves as
+ Close Request state when the
+ Requests the closure of the Acts as if a close request was sent targeting
+ dialog, by first firing a This is a helper utility that can be used to consolidate cancelation and closing logic into
+ the Note that this method ignores the The argument, if provided, provides a return value. Add an Set the dialog closewatcher with this. Set the dialog close watcher with this. Set this's previously focused element to the
focused element. Set the dialog closewatcher with this. Set the dialog close watcher with this. Set this's previously focused element to the
focused element. Run the dialog focusing steps given this. To set the dialog closewatcher, given a To set the dialog close watcher, given a closeAction being to close the
- dialog given dialog and dialog's requestClose
- returnValue. enabled being true if dialog's
- closedby state is not None;
- otherwise false. getEnabledState being to return
+ true if dialog's computed closed-by state is not None; otherwise false. To retrieve a dialog's closedby state, given a To retrieve a dialog's computed closed-by state, given a If dialog's If dialog's If the state of dialog's If dialog's If dialog's is modal is true, then return Close Request. If dialog's is modal is true, return Close Request. Return None. Return None. Return the state of dialog's The dialog focusing steps, given a If returnValue is not given, then set it to null. Close the dialog this with returnValue. If this does not have an If this's closedby state is
- None, throw an
- " If this's computed closed-by state is
+ None, then throw an
+ " Assert: this's close watcher
+ Assert: this's close watcher
is not null. If returnValue is not given, then set it to null. Set this's requestClose returnValue to
+ Set this's request close return value to
returnValue. Request to close dialog's
@@ -62138,6 +62144,8 @@ interface HTMLDialogElement : HTMLElement {
If result is not null, then set the Set the request close return value to null. If subject's previously focused element is not null, then: Each Each Each Each If localName is not If element has no open attribute, then
+ If element has no Assert: element's close
- watcher is not null. If element's closedby state is not
- None state then let enabled
- to true; otherwise false. Set element's close watcher's enabled boolean to enabled. Assert: event's Assert: event is a Let target be event's target. Assert: event is a Let document be target's node document. If document's light dismissible dialog list is
@@ -62318,7 +62316,7 @@ interface HTMLDialogElement : HTMLElement {
given target and event. If event's Let sameTarget be true if ancestor is dialog pointerdown
- target. Let sameTarget be true if ancestor is document's
+ dialog pointerdown target. Set document's dialog pointerdown target to null. If sameTarget is false, then return. Let dialogList be document's light dismissible
- dialog list, in reverse order. Let dialogList be a clone of
+ document's light dismissible dialog list, in reverse order. We make a copy of the light dismissible dialog list because that list
will change as dialogs are closed. For each dialog in dialogList, run these substeps: For each dialog of dialogList: If dialog is ancestor, continue. If dialog is ancestor, then continue. If dialog's closedby state is not
- Any, continue. If dialog's computed closed-by state is not
+ Any, then
+ continue. Assert dialog's close watcher is not
+ Assert dialog's close watcher is not
null. Request to close dialog's
@@ -62364,9 +62363,9 @@ interface HTMLDialogElement : HTMLElement {
To run light dismiss activities, given an Run Light dismiss open popovers with event. Run light dismiss open popovers with event. Run Light dismiss open dialogs with event. Run light dismiss open dialogs with event. Run light dismiss activities will be called by the HTMLDialogElement : HTMLElement {
a If node is an HTML dialog element,
- node has an The check for Let clickedDialog be the result of running nearest inclusive open
- dialog given node. Return clickedDialog. To get the light dismissible dialog list for a
- Let dialogs be « ». If node is a For each Return dialogs. The check for To find the nearest inclusive open dialog given a Let currentNode be node. While currentNode is not null: If currentNode is an HTML dialog
- element and currentNode has an If currentNode is a Set currentNode to currentNode's parent in the flat
tree. Return null. To get the light dismissible dialog list for a Let dialogs be « ». For each Return dialogs. An is running cancel action
boolean. An enabled boolean. A get enabled state, an algorithm
+ accepting no arguments and returning a boolean. This algorithm can never throw an
+ exception. A close watcher closeWatcher is
@@ -83131,8 +83123,8 @@ body { display:none }
To establish a close watcher given a 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 the result of running closeWatcher's get enabled state 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 the result of running closeWatcher's get enabled state is false, then return. If closeWatcher's window's associated If closeWatcher's enabled is
- true, set processedACloseWatcher to true. If the result of running closeWatcher's get enabled state is true, set
+ processedACloseWatcher to true. Let shouldProceed be the result of requesting to close
@@ -84818,8 +84812,9 @@ dictionary DragEventInit : MouseEventInit {
If there is no relevant pointing device, then initialize event's Dispatch event at the specified
@@ -85954,6 +85949,9 @@ dictionary DragEventInit : MouseEventInit {
closeAction being to hide a popover given element, true, true,
and false. getEnabledState being to return
+ true.
any
Any
- Close requests or clicking outside closes the dialog.
+ Close requests (e.g. user hitting ESC) or clicking outside closes the dialog.
closerequest
Close Request
- Close requests close the dialog.
+ Close requests (e.g. user hitting ESC) close the dialog.
none
None
- Nothing automatically closes the dialog.
+ No user actions automatically close the dialog.
closedby
attribute's Light dismiss open dialogs will be called by the Pointer Events spec when the user clicks
+ href="https://github.com/w3c/pointerevents/pull/460">Pointer Events spec when the user clicks
or touches anywhere on the page.Node
node:Document
document:
Element
element in
- document's top layer: if element is a document: if element is a
dialog element
, element's closedby
attribute is in the any state and element has an any state, and element has the
open
attribute, then append
element to dialogs.HTMLDialogElement
.
any
Any
- Close requests (e.g. user hitting ESC) or clicking outside closes the dialog.
+ Close requests (e.g. user hitting ESC) or clicking
+ outside closes the dialog.
closerequest
Close Request
@@ -61772,6 +61774,13 @@ interface HTMLDialogElement : HTMLElement {
dialog.requestClose([ result ])
dialog
element.dialog.returnValue [ = result ]
dialog
's return value.requestClose(returnValue)
method steps
+ are:
+
+
+
+
dialog
element subject is to be closed, with null or a string result, run these steps:Event
event:
+
+
+ dialog element
+ dialog and a DOMString
returnValue:
+
cancel
at
+ dialog, with the cancelable
attribute
+ initialized to true.Node
node:Element
element in
- document: if element is a dialog element
, element's closedby
attribute is in the document: if element is a dialog element
,
+ element's closedby
attribute is in the any state, and element has the open
attribute, then append
element to dialogs.Node
node:
From 78f9789db6167a62ab9f7b8e16b8a2b0f8471f5b Mon Sep 17 00:00:00 2001
From: Mason Freed
requestClose(returnValue)
method steps
- are:
+ are:
@@ -62333,7 +62333,7 @@ interface HTMLDialogElement : HTMLElement {
dialog element
- dialog and a DOMString
returnValue:
+ dialog element
dialog and a string returnValue:
any
- Any
- Close requests (e.g. user hitting ESC) or clicking
- outside closes the dialog.
+ any
+ Close requests (e.g. user hitting ESC) or clicks
+ outside close the dialog.
closerequest
- Close Request
+ close request
Close requests (e.g. user hitting ESC) close the dialog.
none
- None
+ none
No user actions automatically close the dialog.
closedby
attribute's invalid value default and missing value
- default are both the Auto state. The are both the auto state. The auto state matches closerequest when the element is modal;
- otherwise none.
+
@@ -62326,9 +62327,9 @@ interface HTMLDialogElement : HTMLElement {
open
+ attribute, then return.PointerEvent
.PointerEvent
and event's type
is "pointerdown
",
- then: set document's dialog pointerdown target to the result of running
- topmost clicked dialog given target.type
is
+ "pointerdown
", then: set document's
+ dialog pointerdown target to ancestor.PointerEvent
and event's type
is "pointerup
",
- then:type
is
+ "pointerup
", then:
-
+
Event
event:
-
Brief description
- any
- any
+ any
+ Any
Close requests (e.g. user hitting ESC) or clicks
outside close the dialog.
- closerequest
- close request
+ closerequest
+ Close Request
Close requests (e.g. user hitting ESC) close the dialog.
- none
- none
+ none
+ None
No user actions automatically close the dialog.
closedby
attribute's invalid value default and missing value
- default are both the auto state. The auto state matches close request state when the element is modal;
- otherwise the none state.closedby
attribute state is Any or Close Request; otherwise false.closedby
attribute is in the Any, Close Request, or Auto state; otherwise false.closedby
attribute is in the
+ Any state,
+ Close Request state,
+ or Auto state and element's is
modal flag is true, then let enabled to true; otherwise false.Dialog light dismiss
- "Light dismiss" means that clicking outside of a
dialog
element whose closedby
attribute is in the any state will close the dialog. This is in addition to
- how such dialogs respond to close requests.dialog
element. This
+ is in addition to how such dialog
s respond to close requests.Event
event:Element
element in
- document: if element is a dialog element
,
- element's closedby
attribute is in the any state, and element has the document's descendants, in shadow-including tree order: if element
+ is a
dialog element
, element's
+ closedby
attribute is in the Any state, and element has the open
attribute, then append
element to dialogs. HTML elements
Classes to which the element belongs
Set of space-separated tokens
+
+ closedby
+ dialog
+ Which user actions will close the dialog
+ " any
";
+ "closerequest
";
+ "none
";
color
link
From 873e451cb9e5fea07daf1a0f12720c41b9df7511 Mon Sep 17 00:00:00 2001
From: Mason Freed
@@ -62379,9 +62387,7 @@ interface HTMLDialogElement : HTMLElement {
closedby
attribute
+ is not in the Any state, continue.Element
element in
document's descendants, in shadow-including tree order: if element
- is a dialog element
, element's
- closedby
attribute is in the Any state, and element has the dialog element
and element has the open
attribute, then append
element to dialogs.closedby
attribute state is HTMLDialogElement : HTMLElement {
open
attribute, then return.InvalidStateError
" DOMException
, then return.dialog
element subject is to be close watcher,
which is a close watcher or null, initially null.dialog
element has a requestClose returnValue, which is a string,
+ initially null.dialog
element has an is modal flag. When a dialog
element is created, this flag must be set to false.closedby
attribute
is not in the Any state, continue.dialog element
- dialog and a string returnValue:
-
-
cancel
at
- dialog, with the cancelable
attribute
- initialized to true.Node
node and
a PointerEvent
event:open
attribute to this, whose
value is the empty string.
-
- cancel
at this, with the cancelable
attribute initialized to true.closedby
attribute state is Any or Close Request; otherwise false.open
attribute, then
throw an "InvalidStateError
" DOMException
.InvalidStateError
" DOMException
.InvalidStateError
" DOMException
.InvalidStateError
" DOMException
.InvalidStateError
"
DOMException
.
-
- cancel
at this, with the cancelable
attribute initialized to
- canPreventClose.closedby
attribute is in the Any, Close Request, or Auto state; otherwise false.dialog
+ element dialog: set dialog's close
+ watcher to the result of establishing a close
+ watcher given dialog's relevant global object, with:
+
+
+ cancel
at dialog, with the
+ cancelable
attribute initialized to
+ canPreventClose.dialog
+ dialog, perform the following steps:
+
+
+
+
closedby
attribute
+ is an ASCII case-insensitive match for
+ "any
", return
+ Any.closedby
attribute
+ is an ASCII case-insensitive match for
+ "closerequest
", return
+ Close Request.closedby
attribute
+ is an ASCII case-insensitive match for
+ "none
", return
+ None.dialog
element subject,
are as follows:open
attribute, then return.InvalidStateError
" DOMException
, then return.closedby
attribute is in the
- Any state,
- Close Request state,
- or Auto state and element's is
- modal flag is true, then let enabled to true; otherwise false.
From ea474afd7847703b1a5b65eae3e3c4b6d1c4a936 Mon Sep 17 00:00:00 2001
From: Mason Freed closedby
attribute
- is not in the Any state, continue.
-
+
+
+ dialog
- element dialog: set dialog's close
- watcher to the result of establishing a close
- watcher given dialog's relevant global object, with:
-
+
+
cancel
at dialog, with the
- cancelable
attribute initialized to
- canPreventClose.
+
+
+ cancel
at dialog, with the
+ cancelable
attribute initialized to
+ canPreventClose.dialog
dialog, perform the following steps:
@@ -62344,8 +62350,10 @@ interface HTMLDialogElement : HTMLElement {
scroll
eventscrollend
eventHTMLDialogElement
.
any
Any
- Close requests (e.g. user hitting ESC) or clicks
- outside close the dialog.
+ Close requests or clicks outside close the dialog.
closerequest
Close Request
- Close requests (e.g. user hitting ESC) close the dialog.
+ Close requests close the dialog.
none
None
@@ -61718,9 +61718,10 @@ interface HTMLDialogElement : HTMLElement {
default">invalid value default and missing value
default are both the Auto state.
- dialog
was shown using its showModal()
+ method; otherwise the None state.dialog.requestClose([ result ])
dialog
element.cancel
event, and if
+ that event is not canceled with preventDefault()
,
+ proceeding to close the dialog in the same way as the close()
method (including firing a close
event).cancel
and close
event
+ handlers, by having all non-close request closing
+ affordances call this method.closedby
+ attribute: that is, even if closedby
is set to
+ "none
", the same behavior will apply.open
attribute to this, whose
value is the empty string.dialog
- element dialog, perform the following steps:dialog
+ element dialog:
- dialog
- dialog, perform the following steps:
+ dialog
+ dialog:
-
closedby
attribute
- is an ASCII case-insensitive match for
- "any
", return
- Any.closedby
attribute
- is an ASCII case-insensitive match for
- "closerequest
", return
- Close Request.closedby
+ attribute is Auto, then:closedby
attribute
- is an ASCII case-insensitive match for
- "none
", return
- None.
+
+
- closedby
attribute.dialog
element subject,
@@ -62076,8 +62086,6 @@ interface HTMLDialogElement : HTMLElement {
data-x="dom-dialog-close">close(returnValue) method steps are:
-
@@ -62089,16 +62097,14 @@ interface HTMLDialogElement : HTMLElement {
open
attribute, then return.InvalidStateError
" DOMException
, then return.InvalidStateError
" DOMException
.returnValue
attribute to result.dialog
element has a close watcher,
which is a close watcher or null, initially null.dialog
element has a requestClose returnValue, which is a string,
- initially null.dialog
element has a request close return value, which is a
+ string, initially null.dialog
element has an is modal flag. When a dialog
element is created, this flag must be set to false.closedby
, then
return.open
attribute, then
return.
@@ -62304,11 +62302,11 @@ interface HTMLDialogElement : HTMLElement {
isTrusted
attribute is true.PointerEvent
.PointerEvent
.type
is
- "pointerdown
", then: set document's
+ "pointerdown
", then set document's
dialog pointerdown target to ancestor.pointerup
", then:
-
-
Event
event:
-
PointerEvent
event:
-
-
- open
attribute, node's
- is modal flag is true, and event's clientX
and
- clientY
are outside the bounds of node, then return null.
-
- clientX
and clientY
- is because a pointer event that hits the ::backdrop
pseudo element of a
- dialog will result in event having a target of the dialog element itself.Document
document:
-
+ dialog
element, node has an open
attribute, node's is modal flag is
+ true, and event's clientX
and
+ clientY
are outside the bounds of node, then
+ return null.
- Element
element in
- document's descendants, in shadow-including tree order: if element
- is a dialog element
and element has the open
attribute, then append
- element to dialogs.clientX
and clientY
is because a pointer event that hits the ::backdrop
pseudo element of a dialog will result in event having a
+ target of the dialog element itself.Node
- node, perform the following steps. They return an HTML dialog element or null.
-
+ open
- attribute, then return currentNode.dialog
element and currentNode
+ has an open
attribute, then return
+ currentNode.Document
+ document:
+
Element
element in
+ document's shadow-including
+ descendants, in shadow-including tree order: if element is a
+ dialog
element and element has the open
attribute, then append
+ element to dialogs.Scripting
@@ -83118,7 +83108,9 @@ body { display:none }
Window
window, a list
of steps cancelAction, a
list of steps closeAction,
- and an optional boolean enabled
- (default true):
Document
is not fully
@@ -83303,8 +83296,9 @@ body { display:none }
in reverse order:
-
screenX
, screenY
, clientX
, clientY
, and button
attributes to 0.screenY
, clientX
, clientY
,
+ and button
attributes to 0.