From 2549f6ba7754448585beb48871540ee304b83c58 Mon Sep 17 00:00:00 2001
From: Joey Arhar Every HTML element has a popover invoker, which
is an HTML element or null, initially set to null. Every HTML element has a popover toggle task,
+ initially null, which is either null or a struct which has: The following attribute change
steps are used for all HTML elements:
+
+
ToggleEvent
.oldState
attribute.
If the result of firing an event named beforetoggle
, using PopoverToggleEvent
, with the
- cancelable
attribute initialized to true, the currentState
attribute initialized to "closed
", and the newState
+ data-x="event-beforetoggle">beforetoggle, using ToggleEvent
, with the cancelable
attribute initialized to true, the oldState
attribute initialized to "closed
", and the newState
attribute initialized to "open
" at element is false, then
return.
Queue an element task given the user interaction task source and
- element to fire an event named toggle
, using PopoverToggleEvent
, with the currentState
attribute initialized to "open
", and the newState
- attribute initialized to "open
" at element.
Let oldState be "closed
".
If element's popover toggle task is not null, then:
+ +Set oldState to element's popover toggle task's + old state.
Remove element's popover toggle task's task from its task queue.
Set element's popover toggle task to null.
Queue an element task given the user interaction task source and + element to run the following steps:
+ +fire an event named toggle
, using ToggleEvent
, with the oldState
attribute initialized to oldState,
+ and the newState
attribute initialized to "open
" at element.
Set element's popover toggle task to null.
Set element's popover toggle task to a struct with task set to the just-queued task and old + state set to oldState.
The hidePopover()
@@ -81396,11 +81437,10 @@ dictionary DragEventInit : MouseEventInit {
Fire an event named beforetoggle
, using PopoverToggleEvent
, with
- the currentState
attribute
- initialized to "open
", and the newState
attribute initialized to "closed
" at element.
ToggleEvent
, with the oldState
attribute initialized to "open
", and the newState
+ attribute initialized to "closed
" at element.
If the result of running check popover validity given element and @@ -81426,14 +81466,47 @@ dictionary DragEventInit : MouseEventInit {
Set element's popover visibility state to hidden.
If dontFireEvents is false, then queue an element task given the
- user interaction task source and element to fire an event named toggle
,
- using PopoverToggleEvent
, with the cancelable
attribute initialized to false, the currentState
attribute initialized to "closed
", and the newState
- attribute initialized to "closed
" at element.
If dontFireEvents is false, then:
+ +Let oldState be "open
".
If element's popover toggle task is not null, then:
+ +Set oldState to element's popover toggle task's + old state.
Remove element's popover toggle task's task from its task queue.
Set element's popover toggle task to null.
Queue an element task given the user interaction task source and + element to run the following steps:
+ +fire an event named toggle
, using ToggleEvent
, with the oldState
attribute initialized to
+ oldState, and the newState
+ attribute initialized to "closed
" at element.
Set element's popover toggle task to null.
Set element's popover toggle task to a struct with task set to the just-queued task and old + state set to oldState.
Let previouslyFocusedElement be element's previously focused element.
PopoverToggleEvent
interfaceToggleEvent
interface[Exposed=Window]
-interface PopoverToggleEvent : Event {
- constructor(DOMString type, optional PopoverToggleEventInit eventInitDict = {});
- readonly attribute DOMString currentState;
+interface ToggleEvent : Event {
+ constructor(DOMString type, optional ToggleEventInit eventInitDict = {});
+ readonly attribute DOMString oldState;
readonly attribute DOMString newState;
};
-dictionary PopoverToggleEventInit : EventInit {
- DOMString currentState = "";
+dictionary ToggleEventInit : EventInit {
+ DOMString oldState = "";
DOMString newState = "";
};
event.currentState
Set to "closed
" when transitioning from closed to open, or set to
@@ -82020,7 +82093,7 @@ dictionary PopoverToggleEventInit : EventInit
event.newState
Set to "open
" when transitioning from closed to open, or set to "PopoverToggleEventInit : EventInit
The currentState
attribute must return the
- value it was initialized to. It is initialized to "open
" if the element
- with the popover
attribute's popover visibility
- state is showing; otherwise "The
oldState
attribute must return the value it
+ was initialized to. It is initialized to "open
" if the element with the
+ popover
attribute's popover visibility state is
+ showing; otherwise "closed
".
The newState
attribute must return the value it
- was initialized to. It is initialized to "closed
" if the element with the
- popover
attribute's popover visibility state is
- showing; otherwise "open
".
The newState
attribute must return the value it was
+ initialized to. It is initialized to "closed
" if the element with the popover
attribute's popover visibility state is showing; otherwise "open
".