diff --git a/source b/source index 696823da581..07b2df2d4e4 100644 --- a/source +++ b/source @@ -59788,25 +59788,64 @@ interface HTMLDetailsElement : HTMLElement { exists, user agents can still provide this ability through some other user interface affordance.

+

Every details element has a details toggle task tracker, which is a + toggle task tracker or null, initially null.

+

Whenever the open attribute is added to or removed from - a details element, the user agent must queue an element task on the - DOM manipulation task source given then details element that runs the - following steps, which are known as the details notification task steps, for this - details element:

+ a details element, the user agent must run the following steps, which are known as + the details notification task steps, for this details element:

+ +

When the open attribute is toggled several + times in succession, the resulting tasks essentially get coalesced so that only one event is + fired.

+ +
    +
  1. If the open attribute is added, queue a + details toggle event task given the details element, "closed", and "open".

  2. + +
  3. Otherwise, queue a details toggle event task given the details + element, "open", and "closed".

  4. + +
+ +

To queue a details toggle event task given a details element + element, a string oldState, and a string newState:

  1. -

    If another task has been queued to run the details notification task steps for this - details element, then return.

    +

    If element's details toggle task tracker is not null, then:

    -

    When the open attribute is toggled - several times in succession, these steps essentially get coalesced so that only one event is - fired.

    +
      +
    1. Set oldState to element's details toggle task + tracker's old state.

    2. + +
    3. Remove element's details toggle task tracker's task from its task queue.

    4. + +
    5. Set element's details toggle task tracker to null.

    6. +
  2. -
  3. Fire an event named toggle at the details element.

  4. +
  5. +

    Queue an element task given the DOM manipulation task source and + element to run the following steps:

    + +
      +
    1. Fire an event named toggle at element, using ToggleEvent, with + the oldState attribute initialized to + oldState and the newState attribute + initialized to newState.

    2. + +
    3. Set element's details toggle task tracker to null.

    4. +
    +
  6. + +
  7. Set element's details toggle task tracker to a struct with task set to the just-queued task and old state set + to oldState.

The open @@ -77613,6 +77652,53 @@ partial interface Navigator { +

The ToggleEvent interface

+ +
[Exposed=Window]
+interface ToggleEvent : Event {
+  constructor(DOMString type, optional ToggleEventInit eventInitDict = {});
+  readonly attribute DOMString oldState;
+  readonly attribute DOMString newState;
+};
+
+dictionary ToggleEventInit : EventInit {
+  DOMString oldState = "";
+  DOMString newState = "";
+};
+ +
+
event.oldState
+ +
+

Set to "closed" when transitioning from closed to open, or set to + "open" when transitioning from open to closed.

+
+ +
event.newState
+ +
+

Set to "open" when transitioning from closed to open, or set to "closed" when transitioning from open to closed.

+
+
+ +

The oldState and newState attributes must return the values they are + initialized to.

+ +

A toggle task tracker is a struct which has:

+ +
+
task
+
A task which fires a ToggleEvent.
+ +
old state
+
A string which represents the task's event's value for + the oldState attribute.
+

Focus

@@ -82600,17 +82686,8 @@ dictionary DragEventInit : MouseEventInit {

Every HTML element has a popover showing or hiding, which is a boolean, initially set to false.

-

Every HTML element has a popover toggle task, - initially null, which is either null or a struct which has:

- -
-
Task
A task which fires a - ToggleEvent.
- -
Old state
-
A string which represents the task's event's - value for the oldState attribute.
-
+

Every HTML element popover toggle task tracker, + which is a toggle task tracker or null, initially null.

The following attribute change steps, given element, localName, oldValue, @@ -82776,16 +82853,16 @@ dictionary DragEventInit : MouseEventInit {

  1. -

    If element's popover toggle task is not null, then:

    +

    If element's popover toggle task tracker is not null, then:

      -
    1. Set oldState to element's popover toggle task's - old state.

    2. +
    3. Set oldState to element's popover toggle task + tracker's old state.

    4. -
    5. Remove element's popover toggle task's task from its task queue.

    6. +
    7. Remove element's popover toggle task tracker's task from its task queue.

    8. -
    9. Set element's popover toggle task to null.

    10. +
    11. Set element's popover toggle task tracker to null.

  2. @@ -82794,20 +82871,20 @@ dictionary DragEventInit : MouseEventInit { element to run the following steps:

      -
    1. fire an event named toggle, using ToggleEvent, with the oldState attribute initialized to oldState, - and the newState attribute initialized to - newState at element.

    2. +
    3. Fire an event named toggle at element, using ToggleEvent, with + the oldState attribute initialized to + oldState and the newState attribute + initialized to newState.

    4. -
    5. Set element's popover toggle task to null.

    6. +
    7. Set element's popover toggle task tracker to null.

    -
  3. Set element's popover toggle task to a struct with task set to the just-queued task and old - state set to oldState.

  4. +
  5. Set element's popover toggle task tracker to a struct with task set to the just-queued task and old state set + to oldState.

The hidePopover() @@ -82873,7 +82950,7 @@ dictionary DragEventInit : MouseEventInit {

  • Fire an event named beforetoggle, using ToggleEvent, with the oldState attribute initialized to "open", and the newState + data-x="">open" and the newState attribute initialized to "closed" at element.

  • @@ -83532,51 +83609,6 @@ dictionary DragEventInit : MouseEventInit {
  • -

    The ToggleEvent interface

    - -
    [Exposed=Window]
    -interface ToggleEvent : Event {
    -  constructor(DOMString type, optional ToggleEventInit eventInitDict = {});
    -  readonly attribute DOMString oldState;
    -  readonly attribute DOMString newState;
    -};
    -
    -dictionary ToggleEventInit : EventInit {
    -  DOMString oldState = "";
    -  DOMString newState = "";
    -};
    - -
    -
    event.oldState
    - -
    -

    Set to "closed" when transitioning from closed to open, or set to - "open" when transitioning from open to closed.

    -
    - -
    event.newState
    - -
    -

    Set to "open" when transitioning from closed to open, or set to "closed" when transitioning from open to closed.

    -
    -
    - -

    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".

    -

    Loading web pages

    @@ -137980,7 +138012,7 @@ INSERT INTERFACES HERE toggle - Event or ToggleEvent + ToggleEvent details and popover elements Fired at details elements when they open or close; fired on elements with the popover attribute when they are transitioning between