diff --git a/source b/source index b9fafe9a286..213f90acbef 100644 --- a/source +++ b/source @@ -61878,46 +61878,6 @@ interface HTMLDialogElement : HTMLElement {
-

To queue a dialog toggle event task given a dialog element - element, a string oldState, and a string newState: - -

    -
  1. -

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

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

    2. - -
    3. Remove element's dialog toggle task tracker's task from its task queue.

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

    6. -
    -
  2. - -
  3. -

    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 dialog toggle task tracker to null.

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

  6. -
- -

The show() method steps are:

@@ -61980,6 +61940,150 @@ interface HTMLDialogElement : HTMLElement { data-x="dom-dialog-showModal">showModal() method steps are to show a modal dialog given this.

+

The close(returnValue) method steps are: + +

    +
  1. If returnValue is not given, then set it to null.

  2. + +
  3. Close the dialog this with returnValue.

  4. +
+ +

The requestClose(returnValue) method steps + are:

+ +
    +
  1. If this does not have an open + attribute, then return.

  2. + +
  3. Assert: this's close + watcher is not null.

  4. + +
  5. Set dialog's enable close watcher for requestClose() to true.

  6. + +
  7. If returnValue is not given, then set it to null.

  8. + +
  9. Set this's request close return value to + returnValue.

  10. + +
  11. Request to close dialog's + close watcher with false.

  12. + +
  13. Set dialog's enable close watcher for requestClose() to false.

  14. +
+ +
+

We use show/close as the verbs for dialog elements, as opposed to verb pairs that + are more commonly thought of as antonyms such as show/hide or open/close, due to the following + constraints:

+ + + +

Furthermore, a survey + of many other UI frameworks contemporary to the original design of the dialog + element made it clear that the show/close verb pair was reasonably common.

+ +

In summary, it turns out that the implications of certain verbs, and how they are used in + technology contexts, mean that paired actions such as showing and closing a dialog are not + always expressible as antonyms.

+
+ +
+ +

The returnValue IDL attribute, on getting, must return + the last value to which it was set. On setting, it must be set to the new value. When the element + is created, it must be set to the empty string.

+ +

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.

+ +
+ +

Each Document has a dialog pointerdown target, which is an HTML dialog element or null, initially null.

+ +

Each HTML element has a previously focused + element which is null or an element, and it is initially null. When showModal() and show() + are called, this element is set to the currently focused element before running the + dialog focusing steps. Elements with the popover + attribute set this element to the currently focused element during the show popover algorithm.

+ +

Each dialog element has a dialog toggle task tracker, which is a + toggle task tracker or null, initially null.

+ +

Each dialog element has a close watcher, + which is a close watcher or null, initially null.

+ +

Each dialog element has a request close return value, which is a + string, initially null.

+ +

Each dialog element has an enable close watcher for requestClose() boolean, initially false.

+ +

Each dialog element has an is modal boolean, initially false.

+ +
+ +
+ +

The dialog HTML element removing steps, given removedNode + and oldParent, are:

+ +
    +
  1. +

    If removedNode's close watcher is not + null, then:

    + +
      +
    1. Destroy removedNode's close watcher.

    2. + +
    3. Set removedNode's close watcher to + null.

    4. +
    +
  2. + +
  3. If removedNode's node document's top layer contains removedNode, then remove an element from + the top layer immediately given removedNode.

  4. + +
  5. Set is modal of removedNode to false.

  6. + +
  7. Remove removedNode from + removedNode's node document's open dialogs list.

  8. +
+

To show a modal dialog given a dialog element subject:

    @@ -62070,42 +62174,6 @@ interface HTMLDialogElement : HTMLElement {
  1. Run the dialog focusing steps given subject.

-

The close(returnValue) method steps are: - -

    -
  1. If returnValue is not given, then set it to null.

  2. - -
  3. Close the dialog this with returnValue.

  4. -
- -

The requestClose(returnValue) method steps - are:

- -
    -
  1. If this does not have an open - attribute, then return.

  2. - -
  3. Assert: this's close - watcher is not null.

  4. - -
  5. Set dialog's enable close watcher for requestClose() to true.

  6. - -
  7. If returnValue is not given, then set it to null.

  8. - -
  9. Set this's request close return value to - returnValue.

  10. - -
  11. Request to close dialog's - close watcher with false.

  12. - -
  13. Set dialog's enable close watcher for requestClose() to false.

  14. -
- -

To set the dialog close watcher, given a dialog element dialog:

@@ -62136,92 +62204,6 @@ interface HTMLDialogElement : HTMLElement { -

To retrieve a dialog's computed closed-by state, given a dialog - dialog: - -

    -
  1. -

    If the state of dialog's closedby - attribute is Auto:

    - -
      -
    1. If dialog's is modal is true, then return Close Request.

    2. - -
    3. Return None.

    4. -
    -
  2. - -
  3. Return the state of dialog's closedby attribute.

  4. -
- -

The dialog focusing steps, given a dialog element subject, - are as follows:

- -
    -
  1. Let control be null.

  2. - -
  3. If subject has the autofocus - attribute, then set control to subject.

  4. - -
  5. If control is null, then set control to the focus - delegate of subject.

  6. - -
  7. If control is null, then set control to subject.

  8. - -
  9. -

    Run the focusing steps for control.

    - -

    If control is not focusable, this will do nothing. This - would only happen if subject had no focus delegate, and the user agent decided that - dialog elements were not generally focusable. In that case, any earlier modifications to the focused area of the - document will apply.

    -
  10. - -
  11. Let topDocument be control's node navigable's top-level traversable's active - document.

  12. - -
  13. If control's node document's origin is not the same - as the origin of topDocument, then - return.

  14. - -
  15. Empty topDocument's - autofocus candidates.

  16. - -
  17. Set topDocument's autofocus processed flag to true.

  18. -
- -

The dialog HTML element removing steps, given removedNode - and oldParent, are:

- -
    -
  1. -

    If removedNode's close watcher is not - null, then:

    - -
      -
    1. Destroy removedNode's close watcher.

    2. - -
    3. Set removedNode's close watcher to - null.

    4. -
    -
  2. - -
  3. If removedNode's node document's top layer contains removedNode, then remove an element from - the top layer immediately given removedNode.

  4. - -
  5. Set is modal of removedNode to false.

  6. - -
  7. Remove removedNode from - removedNode's node document's open dialogs list.

  8. -
-

When a dialog element subject is to be closed, with null or a string result, run these steps:

@@ -62297,87 +62279,103 @@ interface HTMLDialogElement : HTMLElement {
-
-

We use show/close as the verbs for dialog elements, as opposed to verb pairs that - are more commonly thought of as antonyms such as show/hide or open/close, due to the following - constraints:

+

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

+
  • Remove element's dialog toggle task tracker's task from its task queue.

  • -

    Furthermore, a survey - of many other UI frameworks contemporary to the original design of the dialog - element made it clear that the show/close verb pair was reasonably common.

    +
  • Set element's dialog toggle task tracker to null.

  • + + -

    In summary, it turns out that the implications of certain verbs, and how they are used in - technology contexts, mean that paired actions such as showing and closing a dialog are not - always expressible as antonyms.

    -
    +
  • +

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

      The returnValue IDL attribute, on getting, must return - the last value to which it was set. On setting, it must be set to the new value. When the element - is created, it must be set to the empty string.

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

    4. +
    +
  • -

    The closedBy IDL attribute must reflect the - closedby content attribute, limited to only - known values.

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

  • + -

    The open IDL - attribute must reflect the open content - attribute.

    +

    To retrieve a dialog's computed closed-by state, given a dialog + dialog: -


    +
      +
    1. +

      If the state of dialog's closedby + attribute is Auto:

      -

      Each Document has a dialog pointerdown target, which is an HTML dialog element or null, initially null.

      +
        +
      1. If dialog's is modal is true, then return Close Request.

      2. -

        Each HTML element has a previously focused - element which is null or an element, and it is initially null. When showModal() and show() - are called, this element is set to the currently focused element before running the - dialog focusing steps. Elements with the popover - attribute set this element to the currently focused element during the show popover algorithm.

        +
      3. Return None.

      4. +
      +
    2. -

      Each dialog element has a dialog toggle task tracker, which is a - toggle task tracker or null, initially null.

      +
    3. Return the state of dialog's closedby attribute.

    4. +
    -

    Each dialog element has a close watcher, - which is a close watcher or null, initially null.

    +

    The dialog focusing steps, given a dialog element subject, + are as follows:

    -

    Each dialog element has a request close return value, which is a - string, initially null.

    +
      +
    1. Let control be null.

    2. -

      Each dialog element has an enable close watcher for requestClose() boolean, initially false.

      +
    3. If subject has the autofocus + attribute, then set control to subject.

    4. -

      Each dialog element has an is modal boolean, initially false.

      +
    5. If control is null, then set control to the focus + delegate of subject.

    6. -
      +
    7. If control is null, then set control to subject.

    8. - +
    9. +

      Run the focusing steps for control.

      + +

      If control is not focusable, this will do nothing. This + would only happen if subject had no focus delegate, and the user agent decided that + dialog elements were not generally focusable. In that case, any earlier modifications to the focused area of the + document will apply.

      +
    10. + +
    11. Let topDocument be control's node navigable's top-level traversable's active + document.

    12. + +
    13. If control's node document's origin is not the same + as the origin of topDocument, then + return.

    14. + +
    15. Empty topDocument's + autofocus candidates.

    16. + +
    17. Set topDocument's autofocus processed flag to true.

    18. +

    Dialog light dismiss