@@ -61734,6 +61734,49 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
61734
61734
61735
61735
<div w-nodev>
61736
61736
61737
+ <p>Every <code>dialog</code> element has a <dfn>dialog toggle task tracker</dfn>, which is a
61738
+ <span>toggle task tracker</span> or null, initially null.</p>
61739
+
61740
+ <p>To <dfn>queue a dialog toggle event task</dfn> given a <code>dialog</code> element
61741
+ <var>element</var>, a string <var>oldState</var>, and a string <var>newState</var>:
61742
+
61743
+ <ol>
61744
+ <li>
61745
+ <p>If <var>element</var>'s <span>dialog toggle task tracker</span> is not null, then:</p>
61746
+
61747
+ <ol>
61748
+ <li><p>Set <var>oldState</var> to <var>element</var>'s <span>dialog toggle task
61749
+ tracker</span>'s <span data-x="toggle-task-old-state">old state</span>.</p></li>
61750
+
61751
+ <li><p>Remove <var>element</var>'s <span>dialog toggle task tracker</span>'s <span
61752
+ data-x="toggle-task-task">task</span> from its <span>task queue</span>.</p></li>
61753
+
61754
+ <li><p>Set <var>element</var>'s <span>dialog toggle task tracker</span> to null.</p></li>
61755
+ </ol>
61756
+ </li>
61757
+
61758
+ <li>
61759
+ <p><span>Queue an element task</span> given the <span>DOM manipulation task source</span> and
61760
+ <var>element</var> to run the following steps:</p>
61761
+
61762
+ <ol>
61763
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named <code
61764
+ data-x="event-toggle">toggle</code> at <var>element</var>, using <code>ToggleEvent</code>, with
61765
+ the <code data-x="dom-ToggleEvent-oldState">oldState</code> attribute initialized to
61766
+ <var>oldState</var> and the <code data-x="dom-ToggleEvent-newState">newState</code> attribute
61767
+ initialized to <var>newState</var>.</p></li>
61768
+
61769
+ <li><p>Set <var>element</var>'s <span>dialog toggle task tracker</span> to null.</p></li>
61770
+ </ol>
61771
+ </li>
61772
+
61773
+ <li><p>Set <var>element</var>'s <span>dialog toggle task tracker</span> to a struct with <span
61774
+ data-x="toggle-task-task">task</span> set to the just-queued <span
61775
+ data-x="concept-task">task</span> and <span data-x="toggle-task-old-state">old state</span> set
61776
+ to <var>oldState</var>.</p></li>
61777
+ </ol>
61778
+
61779
+
61737
61780
<p>The <dfn method for="HTMLDialogElement"><code data-x="dom-dialog-show">show()</code></dfn>
61738
61781
method steps are:</p>
61739
61782
@@ -61744,6 +61787,20 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
61744
61787
<li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute, then
61745
61788
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
61746
61789
61790
+ <li><p>If the result of <span data-x="concept-event-fire">firing an event</span> named <code
61791
+ data-x="event-beforetoggle">beforetoggle</code>, using <code>ToggleEvent</code>, with the <code
61792
+ data-x="dom-Event-cancelable">cancelable</code> attribute initialized to true, the <code
61793
+ data-x="dom-ToggleEvent-oldState">oldState</code> attribute initialized to "<code
61794
+ data-x="">closed</code>", and the <code data-x="dom-ToggleEvent-newState">newState</code>
61795
+ attribute initialized to "<code data-x="">open</code>" at <var>this</var> is false, then
61796
+ return.</p></li>
61797
+
61798
+ <li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute, then
61799
+ return.</p></li>
61800
+
61801
+ <li><p><span>Queue a dialog toggle event task</span> given <var>subject</var>, "<code
61802
+ data-x="">closed</code>", and "<code data-x="">open</code>".</p></li>
61803
+
61747
61804
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <span>this</span>, whose
61748
61805
value is the empty string.</p></li>
61749
61806
@@ -61782,6 +61839,25 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
61782
61839
state</span>, then throw an <span>"<code>InvalidStateError</code>"</span>
61783
61840
<code>DOMException</code>.</p></li>
61784
61841
61842
+ <li><p>If the result of <span data-x="concept-event-fire">firing an event</span> named <code
61843
+ data-x="event-beforetoggle">beforetoggle</code>, using <code>ToggleEvent</code>, with the <code
61844
+ data-x="dom-Event-cancelable">cancelable</code> attribute initialized to true, the <code
61845
+ data-x="dom-ToggleEvent-oldState">oldState</code> attribute initialized to "<code
61846
+ data-x="">closed</code>", and the <code data-x="dom-ToggleEvent-newState">newState</code>
61847
+ attribute initialized to "<code data-x="">open</code>" at <var>this</var> is false, then
61848
+ return.</p></li>
61849
+
61850
+ <li><p>If <span>this</span> has an <code data-x="attr-dialog-open">open</code> attribute,
61851
+ then return.</p></li>
61852
+
61853
+ <li><p>If <span>this</span> is not <span>connected</span>, then return.</p></li>
61854
+
61855
+ <li><p>If <span>this</span> is in the <span data-x="popover-showing-state">popover showing
61856
+ state</span>, then return.</p></li>
61857
+
61858
+ <li><p><span>Queue a dialog toggle event task</span> given <var>subject</var>, "<code
61859
+ data-x="">closed</code>", and "<code data-x="">open</code>".</p></li>
61860
+
61785
61861
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <span>this</span>, whose
61786
61862
value is the empty string.</p></li>
61787
61863
@@ -61915,6 +61991,18 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
61915
61991
<li><p>If <var>subject</var> does not have an <code data-x="attr-dialog-open">open</code>
61916
61992
attribute, then return.</p></li>
61917
61993
61994
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named <code
61995
+ data-x="event-beforetoggle">beforetoggle</code>, using <code>ToggleEvent</code>, with the <code
61996
+ data-x="dom-ToggleEvent-oldState">oldState</code> attribute initialized to "<code
61997
+ data-x="">open</code>" and the <code data-x="dom-ToggleEvent-newState">newState</code> attribute
61998
+ initialized to "<code data-x="">closed</code>" at <var>subject</var>.</p></li>
61999
+
62000
+ <li><p>If <var>subject</var> does not have an <code data-x="attr-dialog-open">open</code>
62001
+ attribute, then return.</p></li>
62002
+
62003
+ <li><p><span>Queue a dialog toggle event task</span> given <var>subject</var>, "<code
62004
+ data-x="">open</code>", and "<code data-x="">closed</code>".</p></li>
62005
+
61918
62006
<li><p>Remove <var>subject</var>'s <code data-x="attr-dialog-open">open</code>
61919
62007
attribute.</p></li>
61920
62008
0 commit comments