diff --git a/source b/source index 76281111e3d..f33586e7bb9 100644 --- a/source +++ b/source @@ -1851,7 +1851,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • If removedNode's popover attribute is not in the No Popover State, then run the hide - popover algorithm given removedNode, false, false, and false.

  • + popover algorithm given removedNode, false, false, false, and null.

    The moving steps for the HTML Standard, given @@ -53776,7 +53776,8 @@ interface HTMLButtonElement : HTMLElement {

    1. If the result of running check popover validity given target, true, false, and null is true, then run the - hide popover algorithm given target, true, true, and false.

    2. + hide popover algorithm given target, true, true, false, and + element.

    @@ -53793,7 +53794,7 @@ interface HTMLButtonElement : HTMLElement {
  • Otherwise, if the result of running check popover validity given target, true, false, and null is true, then run the hide popover algorithm given target, true, - true, and false.

  • + true, false, and element.

    @@ -60419,7 +60420,8 @@ fur button, then set result to submitter's optional value.

    -
  • Close the dialog subject with result.

  • +
  • Close the dialog subject with result and + null.

  • Return.

  • @@ -62295,7 +62297,7 @@ interface HTMLDialogElement : HTMLElement { return.

  • Queue a dialog toggle event task given this, "closed", and "open".

  • + data-x="">closed", "open", and null.

  • Add an open attribute to this, whose value is the empty string.

  • @@ -62333,7 +62335,7 @@ interface HTMLDialogElement : HTMLElement {

    The showModal() method steps are to show a modal - dialog given this.

    + dialog given this and null.

    The close(returnValue) method steps are: @@ -62341,7 +62343,8 @@ interface HTMLDialogElement : HTMLElement {

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

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

    4. +
    5. Close the dialog this with returnValue and + null.

    The HTMLDialogElement : HTMLElement {

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

  • Request to close the dialog this - with returnValue.

  • + with returnValue and null.

    @@ -62427,7 +62430,10 @@ interface HTMLDialogElement : HTMLElement { which is a close watcher or null, initially null.

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

    + string or null, initially null.

    + +

    Each dialog element has a request close source element, which is an + Element or null, initially null.

    Each dialog element has an enable close watcher for request close boolean, @@ -62470,7 +62476,8 @@ interface HTMLDialogElement : HTMLElement { removedNode's node document's open dialogs list.

    -

    To show a modal dialog given a dialog element subject:

    +

    To show a modal dialog given a dialog element subject and an + Element or null source:

    1. If subject has an open attribute and @@ -62493,9 +62500,10 @@ interface HTMLDialogElement : HTMLElement { 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 subject is false, then - return.

    2. + data-x="">closed", the newState + attribute initialized to "open", and the source attribute initialized to source at + subject is false, then return.

    3. If subject has an open attribute, then return.

    4. @@ -62506,7 +62514,7 @@ interface HTMLDialogElement : HTMLElement { state, then return.

    5. Queue a dialog toggle event task given subject, "closed", and "open".

    6. + data-x="">closed", "open", and source.

    7. Add an open attribute to subject, whose value is the empty string.

    8. @@ -62578,8 +62586,8 @@ interface HTMLDialogElement : HTMLElement { canPreventClose.

    9. closeAction being to close the - dialog given dialog and dialog's request close return - value.

    10. + dialog given dialog, dialog's request close return + value, and dialog's request close source element.

    11. getEnabledState being to return true if dialog's enable close watcher for request close is true or @@ -62613,18 +62621,19 @@ interface HTMLDialogElement : HTMLElement { data-x="attr-button-command-close-state">Close state and element has an open attribute, then close the dialog element with invoker's optional - value.

    12. + value and invoker.

    13. If command is in the Request Close state and element has an open attribute, then request to close the dialog element with - invoker's optional value.

    14. + invoker's optional value and + invoker.

    15. If command is the Show Modal state and element does not have an open attribute, then - show a modal dialog given element.

    16. + show a modal dialog given element and invoker.

    @@ -62651,7 +62660,8 @@ interface HTMLDialogElement : HTMLElement {

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

    + dialog">closed, with null or a string result and an Element or null + source, run these steps:

    1. If subject does not have an open @@ -62660,14 +62670,16 @@ interface HTMLDialogElement : HTMLElement {

    2. Fire an event named beforetoggle, using ToggleEvent, with the oldState attribute initialized to "open" and the newState attribute - initialized to "closed" at subject.

    3. + data-x="">open", the newState attribute + initialized to "closed", and the source attribute initialized to source at + subject.

    4. If subject does not have an open attribute, then return.

    5. Queue a dialog toggle event task given subject, "open", and "closed".

    6. + data-x="">open", "closed", and source.

    7. Remove subject's open attribute.

    8. @@ -62683,10 +62695,12 @@ interface HTMLDialogElement : HTMLElement {
    9. Remove subject from subject's node document's open dialogs list.

    10. -
    11. If result is not null, then set the

      If result is not null, then set subject's returnValue attribute to result.

    12. -
    13. Set the request close return value to null.

    14. +
    15. Set subject's request close return value to null.

    16. + +
    17. Set subject's request close source element to null.

    18. If subject's previously focused element is not null, then:

      @@ -62724,7 +62738,8 @@ interface HTMLDialogElement : HTMLElement {

    To request to close dialog element - subject, given null or a string returnValue:

    + subject, given null or a string returnValue and null or an + Element source:

    1. If subject does not have an open @@ -62739,6 +62754,9 @@ interface HTMLDialogElement : HTMLElement {

    2. Set subject's request close return value to returnValue.

    3. +
    4. Set subject's request close source element to + source.

    5. +
    6. Request to close subject's close watcher with false.

    7. @@ -62749,7 +62767,8 @@ interface HTMLDialogElement : HTMLElement {

    To queue a dialog toggle event task given a dialog element - element, a string oldState, and a string newState: + element, a string oldState, a string newState, and an + Element or null source:

    1. @@ -62774,8 +62793,10 @@ interface HTMLDialogElement : HTMLElement {
    2. Fire an event named toggle at element, using ToggleEvent, with the oldState attribute initialized to - oldState and the newState attribute - initialized to newState.

    3. + oldState, the newState attribute + initialized to newState, and the source attribute initialized to + source.

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

    @@ -80489,6 +80510,7 @@ interface ToggleEvent : Event { constructor(DOMString type, optional ToggleEventInit eventInitDict = {}); readonly attribute DOMString oldState; readonly attribute DOMString newState; + readonly attribute Element source; }; dictionary ToggleEventInit : EventInit { @@ -80512,6 +80534,16 @@ dictionary ToggleEventInit : EventInit {

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

    + +
    event.source
    + +
    +

    Set to the element which initiated the toggle, which can be set up with the popovertarget and commandfor attributes. If there is no source element, + then it is set to null.

    +

    The ToggleEventInit : EventInit { data-x="dom-ToggleEvent-newState">newState attributes must return the values they are initialized to.

    +

    The source getter steps are to return the result of + retargeting source against this's currentTarget.

    + +

    DOM standard issue #1328 + tracks how to better standardize associated event data in a way which makes sense on Events. + Currently an event attribute initialized to a value cannot also have a getter, and so an internal + slot (or map of additional fields) is required to properly specify this.

    +

    A toggle task tracker is a struct which has:

    @@ -86647,7 +86690,7 @@ dictionary DragEventInit : MouseEventInit {
  • If element's popover visibility state is in the showing state and oldValue and value are in different states, then run the hide popover - algorithm given element, true, true, and false.

  • + algorithm given element, true, true, false, and null.

    @@ -86721,9 +86764,10 @@ dictionary DragEventInit : MouseEventInit { 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 - run cleanupShowingFlag and return.

    + data-x="">closed", the newState attribute + initialized to "open" at element, and the source attribute initialized to invoker is + false, then run cleanupShowingFlag and return.

  • If the result of running check popover validity given element, false, @@ -86888,7 +86932,7 @@ dictionary DragEventInit : MouseEventInit {

  • closeAction being to hide a popover given element, true, true, - and false.

  • + false, and null.

  • getEnabledState being to return true.

  • @@ -86920,13 +86964,14 @@ dictionary DragEventInit : MouseEventInit { previously focused element to originallyFocusedElement.

  • Queue a popover toggle event task given element, "closed", and "open".

  • + data-x="">closed", "open", and invoker.

  • Run cleanupShowingFlag.

  • To queue a popover toggle event task given an element element, a string - oldState, and a string newState: + oldState, a string newState, and an Element or null + source:

    1. @@ -86951,8 +86996,10 @@ dictionary DragEventInit : MouseEventInit {
    2. Fire an event named toggle at element, using ToggleEvent, with the oldState attribute initialized to - oldState and the newState attribute - initialized to newState.

    3. + oldState, the newState attribute + initialized to newState, and the source attribute initialized to + source.

    4. Set element's popover toggle task tracker to null.

    @@ -86968,13 +87015,14 @@ dictionary DragEventInit : MouseEventInit { method steps are:

      -
    1. Run the hide popover algorithm given this, true, true, and - true.

    2. +
    3. Run the hide popover algorithm given this, true, true, true, and + null.

    To hide a popover given an HTML element element, a boolean focusPreviousElement, a - boolean fireEvents, and a boolean throwExceptions:

    + boolean fireEvents, a boolean throwExceptions, and an HTML element or null source:

    1. If the result of running check popover validity given element, @@ -87040,8 +87088,10 @@ dictionary DragEventInit : MouseEventInit {

    2. Fire an event named beforetoggle, using ToggleEvent, with the oldState attribute initialized to "open" and the newState - attribute initialized to "closed" at element.

    3. + data-x="">open", the newState + attribute initialized to "closed", and the source attribute set to source at + element.

    4. If autoPopoverListContainsElement is true and document's showing auto popover list's last item is not element, then run DragEventInit : MouseEventInit { data-x="popover-hidden-state">hidden.

    5. If fireEvents is true, then queue a popover toggle event task - given element, "open", and "closed".

    6. + given element, "open", "closed", and + source.

    7. Let previouslyFocusedElement be element's previously focused element.

    8. @@ -87118,7 +87168,8 @@ dictionary DragEventInit : MouseEventInit {
    9. If this's popover visibility state is showing, and force is null or false, then run - the hide popover algorithm given this, true, true, and true.

    10. + the hide popover algorithm given this, true, true, true, and + null.

    11. Otherwise, if force is null or true, then run show popover given this, true, and invoker.

    12. @@ -87235,8 +87286,8 @@ dictionary DragEventInit : MouseEventInit {
    13. Assert: popoverList is not empty.

    14. Run the hide popover algorithm given the last item in - popoverList, focusPreviousElement, fireEvents, and - false.

    15. + popoverList, focusPreviousElement, fireEvents, false, and + null.

    @@ -87609,7 +87660,7 @@ dictionary DragEventInit : MouseEventInit {
    1. Run the hide popover algorithm given popoverList's last item, - focusPreviousElement, fireEvents, and false.

    2. + focusPreviousElement, fireEvents, false, and null.

    @@ -87735,7 +87786,7 @@ dictionary DragEventInit : MouseEventInit {
  • If popover's popover visibility state is showing, then run the hide popover algorithm - given popover, true, true, and false.

  • + given popover, true, true, false, and node.

  • Otherwise, if popover's popover visibility state is hidden and the result of running check popover