diff --git a/source b/source index dce024a305f..8a71f1d0b5f 100644 --- a/source +++ b/source @@ -61598,11 +61598,18 @@ interface HTMLDialogElement : HTMLElement {
Set this's previously focused element to the focused element.
Let document be this's node document.
Let hideUntil be the result of running topmost popover ancestor - given this, null, and false.
If hideUntil is null, then set hideUntil to this's - node document.
If hideUntil is null, then set hideUntil to the result of running + topmost popover ancestor given this, document's + showing auto popover list, null, and false.
If hideUntil is null, then set hideUntil to + document.
Run hide all popovers until given hideUntil, false, and true.
Set this's previously focused element to the focused element.
Let document be this's node document.
Let hideUntil be the result of running topmost popover ancestor - given this, null, and false.
If hideUntil is null, then set hideUntil to this's - node document.
If hideUntil is null, then set hideUntil to the result of running + topmost popover ancestor given this, document's + showing auto popover list, null, and false.
If hideUntil is null, then set hideUntil to + document.
Run hide all popovers until given hideUntil, false, and true.
hint
The attribute's missing value default is the DragEventInit : MouseEventInit { data-x="popover-showing-state">showing
-The Document
has a popover pointerdown target, which is an Every Document
has a popover pointerdown target, which is an HTML element or null, initially null.
Every HTML element has a popover invoker, which @@ -85255,6 +85279,9 @@ dictionary DragEventInit : MouseEventInit {
Every HTML element has a popover close watcher, which is a close watcher or null, initially null.
+Every HTML element has an opened in popover + mode, which is a string or null, initially null.
+The following attribute change steps, given element, localName, oldValue, value, and namespace, are used for all HTML elements:
@@ -85316,6 +85343,8 @@ dictionary DragEventInit : MouseEventInit {Let nestedShow be element's popover showing or hiding.
Let fireEvents be the boolean negation of nestedShow.
Set element's popover showing or hiding to true.
Let shouldRestoreFocus be false.
Let originalType be the current state of element's popover
attribute.
Let stackToAppendTo be null.
Let autoAncestor be the result of running the topmost popover + ancestor algorithm given element, document's showing auto + popover list, invoker, and true.
Let hintAncestor be the result of running the topmost popover + ancestor algorithm given element, document's showing hint + popover list, invoker, and true.
If element's popover
attribute is in the auto state, then:
If originalType is the auto state, + then:
Let originalType be the value of element's popover
attribute.
Run close entire popover list given document's showing + hint popover list, shouldRestoreFocus, and fireEvents.
Let ancestor be the result of running the topmost popover - ancestor algorithm given element, invoker, and true.
If ancestor is null, then set ancestor to document.
Run hide all popovers until given - ancestor, false, and not nestedShow.
Set stackToAppendTo to "auto
".
If originalType is the hint state, + then:
+ +If hintAncestor is not null, then:
+ +Run hide all popovers until given + hintAncestor, shouldRestoreFocus, and fireEvents.
Set stackToAppendTo to "hint
".
Otherwise:
+ +Run close entire popover list given document's showing + hint popover list, shouldRestoreFocus, and fireEvents.
If autoAncestor is not null, then:
+ +Run hide all popovers until given + autoAncestor, shouldRestoreFocus, and fireEvents.
Set stackToAppendTo to "auto
".
Otherwise, set stackToAppendTo to "hint
".
If originalType is auto or hint, then:
+ +Assert: stackToAppendTo is not null.
If originalType is not equal to the value of element's DragEventInit : MouseEventInit {
If the result of running topmost auto popover on document is null, - then set shouldRestoreFocus to true.
+If the result of running topmost auto or hint + popover on document is null, then set shouldRestoreFocus to + true.
This ensures that focus is returned to the previously-focused element only for the first popover in a stack.
If stackToAppendTo is "auto
":
Assert: document's showing auto popover list does + not contain element.
Set element's opened in popover mode to "auto
".
Otherwise:
+ +Assert: stackToAppendTo is "hint
".
Assert: document's showing hint popover list does + not contain element.
Set element's opened in popover mode to "hint
".
If document is fully active, then set element's popover close watcher to the result of popover attribute is in the auto state, then:
+ data-x="attr-popover-auto-state">auto state or the hint state, then:Run hide all popovers until given @@ -85586,6 +85707,8 @@ dictionary DragEventInit : MouseEventInit {
Otherwise, remove an element from the top layer immediately given element.
Set element's opened in popover mode to null.
Set element's popover visibility state to hidden.
Let document be endpoint's node document.
Assert: endpoint is a Document
or
+ endpoint's popover visibility state is showing.
Assert: endpoint is a Document
or
+ endpoint's popover
attribute is in the auto state or endpoint's popover
attribute is in the hint state.
Let closeAllOpenPopovers be an algorithm which performs the following steps:
+If endpoint is a Document
:
Let popover be document's topmost auto - popover.
Run close entire popover list given document's showing + hint popover list, focusPreviousElement, and fireEvents.
While popover is not null:
+Run close entire popover list given document's showing + auto popover list, focusPreviousElement, and fireEvents.
Run the hide popover algorithm given popover, - focusPreviousElement, fireEvents, and false.
Return.
Set popover to document's topmost auto - popover.
If document's showing hint popover list contains + endpoint:
+ +Assert: endpoint's popover
+ attribute is in the hint state.
Run hide popover stack until given endpoint, + document's showing hint popover list, focusPreviousElement, + and fireEvents.
Return.
If endpoint is a Document
, then run
- closeAllOpenPopovers and return.
Run close entire popover list given document's showing hint + popover list, focusPreviousElement, and fireEvents.
If document's showing auto popover list does not contain + endpoint, then return.
Assert: endpoint's popover
- attribute is in the auto state.
Run hide popover stack until given endpoint, document's + showing auto popover list, focusPreviousElement, and + fireEvents.
To hide popover stack until, given an HTML + element element, a list popoverList, a boolean + focusPreviousElement, and a boolean fireEvents:
+ +Let repeatingHide be false.
Let lastToHide be null.
Let foundEndpoint be false.
For each popover of document's showing auto popover - list:
+For each popover in popoverList:
If popover is endpoint, then set foundEndpoint to - true.
If popover is endpoint, then break.
Otherwise, if foundEndpoint is true, then set lastToHide to - popover and break.
Set lastToHide to popover.
If foundEndpoint is false, then run closeAllOpenPopovers and - return.
If lastToHide is null, then return.
While lastToHide is not null and lastToHide's popover - visibility state is showing and - document's showing auto popover list is not empty:
+While lastToHide's popover visibility state is showing:
Run the hide popover algorithm given document's showing - auto popover list's last element, focusPreviousElement, - fireEvents, and false.
Assert: popoverList is not empty.
Run the hide popover algorithm given the last item in + popoverList, focusPreviousElement, fireEvents, and + false.
Set repeatingHide to true if document's showing auto popover - list contains endpoint and document's showing auto popover - list's last element is not endpoint, otherwise false.
Assert: repeatingHide is false or popoverList's + last item is endpoint.
Set repeatingHide to true if popoverList contains + endpoint and popoverList's last item is not endpoint, + otherwise false.
If repeatingHide is true, then set fireEvents to false.
To find the topmost popover ancestor, given a Node
- newPopoverOrTopLayerElement, an HTML element or
- null invoker, and a boolean isPopover, perform the following steps. They
- return an HTML element or null.
The topmost popover ancestor algorithm will return the topmost (latest in the @@ -85803,8 +85954,7 @@ dictionary DragEventInit : MouseEventInit { document.
For each popover of document's showing auto popover - list:
+For each popover of popoverList:
Set popoverPositions[popover] to @@ -85828,10 +85978,35 @@ dictionary DragEventInit : MouseEventInit {
If candidate is null, then return.
Let candidateAncestor be the result of running nearest inclusive open - popover given candidate.
Let okNesting be false.
Let candidateAncestor be null.
While okNesting is false:
+ +Set candidateAncestor to the result of running nearest inclusive open + popover given candidate.
If candidateAncestor is null or popoverPositions does not + contain candidateAncestor, then return.
If candidateAncestor is null, then return.
Assert: candidateAncestor's popover
attribute is not in the manual or none state.
Set okNesting to true if newPopover's popover
attribute is in the hint state or candidateAncestor's popover
attribute is in the auto state.
If okNesting is false, then set candidate to + candidateAncestor's parent in the flat tree.
Let candidatePosition be popoverPositions[candidateAncestor].
Return null.
To find the topmost auto popover given a +
To find the topmost auto or hint popover given a
Document
document, perform the following steps. They return an HTML element or null.
If document's showing hint popover list is not empty, then return + document's showing hint popover list's last element.
If document's showing auto popover list is not empty, then return document's showing auto popover list's last element.
Let popovers be « ».
For each Element
element in
- document's top layer: if element's popover
attribute is in the auto state and element's popover
- visibility state is showing, then append element to popovers.
For each Element
element in
+ document's top layer:
If all of the following are true:
+ +element is an HTML element;
element's opened in popover mode is "auto
"; and
element's popover visibility state is showing, +
then append element to + popovers.
+Return popovers.
To get the showing hint popover list for a Document
+ document:
Let popovers be « ».
For each Element
element in
+ document's top layer:
If all of the following are true:
+ +element is an HTML element;
element's opened in popover mode is "hint
"; and
element's popover visibility state is showing, +
then append element to + popovers.
+Return popovers.
To close entire popover list given a list popoverList, a + boolean focusPreviouselement, and a boolean fireEvents:
+ +While popoverList is not empty:
+ +Run the hide popover algorithm given popoverList's last item, + focusPreviousElement, fireEvents, and false.
Buttons may have the following content attributes:
@@ -86207,26 +86449,31 @@ dictionary DragEventInit : MouseEventInit {Let invokerPopover be the result of running nearest inclusive target popover for invoker given node.
Let getStackPosition be an algorithm which performs the following steps given - an HTML element popover:
+If the result of getting the popover stack + position given clickedPopover is greater than the result of getting the popover stack position given + invokerPopover, then return clickedPopover.
Let popoverList be popover's node document's - showing auto popover list.
Return invokerPopover.
If popover is in popoverList, then return the index of - popover in popoverList + 1.
To get the popover stack position, given an HTML + element popover:
-Return 0.
Let hintList be popover's node document's + showing hint popover list.
If the result of running getStackPosition given clickedPopover is - greater than the result of running getStackPosition given invokerPopover, - then return clickedPopover.
Let autoList be popover's node document's + showing auto popover list.
Return invokerPopover.
If popover is in hintList, then return the index of + popover in hintList + the size of autoList + 1.
If popover is in autoList, then return the index of + popover in autoList + 1.
Return 0.
To find the nearest inclusive target popover for invoker given a Node