-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add commandfor & command attributes to HTMLButtonElement #9841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e1f3111
672183f
e4e1c4b
a76843c
f65b298
4e07504
a128e7a
719899d
8afb669
c43b2fc
eec15ad
2196384
9c93cb2
934d950
bff3f10
150eec8
e5a111c
f0f3902
7a1fe7d
871c076
05890f8
9f60688
ec6514f
a3e56e4
b13fc3f
0790c33
74949fe
8779da9
1166eb4
aa804b6
729674c
5a6e582
4757ab1
23dac08
7d5fc66
bba3085
8e2d7a6
a3bbc4a
4dbb892
21fefc6
767c4c3
a033ef8
8e6b74e
8d2a17b
8e6ae5b
d6536f1
25d8c9b
eb62a52
8621f0a
44a398d
0c1dd19
e47a66c
c1c8f42
34e7de8
b5c402a
8b6b4db
15142b8
397c490
f07be5a
224c61d
0ce6b7e
c71a1fb
2cf379a
d2eb8df
0a57503
d02a649
9aa7109
463df24
c37596b
35849e7
d27d514
7d69572
7c44d2b
09d1279
3279166
abb077c
4d7388d
9470347
73ed957
79aecb9
e9dbd6c
74c72bf
d5c9ed4
40893c4
05194d8
cb6a2d3
4f70118
d345eb5
acf7248
1aa382f
4a580e6
467c30c
055ab9b
a605a9c
1b7c383
8a14367
ed46d37
7467651
e576e82
c592656
73e89d0
45a98b8
955b070
1096559
baaeaa0
3d67bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53744,19 +53744,6 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> { | |
data-x="attr-button-type">type</code> attribute is not in the <span | ||
data-x="attr-button-type-submit-state">Submit Button</span> state.</p> | ||
|
||
<p>The <dfn element-attr for="button"><code data-x="attr-button-value">value</code></dfn> | ||
attribute gives the element's value for the purposes of form submission. The element's <span | ||
data-x="concept-fe-value">value</span> is the value of the element's <code | ||
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string | ||
otherwise.</p> | ||
|
||
<p class="note">A button (and its value) is only included in the form submission if the button | ||
itself was used to initiate the form submission.</p> | ||
|
||
<hr> | ||
|
||
<div w-nodev> | ||
|
||
<p>The <dfn attribute for="HTMLButtonElement"><code | ||
data-x="dom-button-commandForElement">commandForElement</code></dfn> IDL attribute must | ||
<span>reflect</span> the element's <code data-x="attr-button-commandfor">commandfor</code> | ||
|
@@ -53799,25 +53786,25 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> { | |
<p>The <code data-x="dom-button-command">command</code> setter steps are to set the <code | ||
data-x="attr-button-command">command</code> content attribute to the given value.</p> | ||
|
||
<p>The <dfn attribute for="HTMLButtonElement"><code data-x="dom-button-value">value</code></dfn> | ||
IDL attribute must <span>reflect</span> the content attribute of the same name.</p> | ||
<p>The <dfn element-attr for="button"><code data-x="attr-button-value">value</code></dfn> | ||
attribute gives the element's value for the purposes of form submission. The element's <span | ||
data-x="concept-fe-value">value</span> is the value of the element's <code | ||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string | ||
otherwise.</p> | ||
|
||
<p>The <dfn attribute for="HTMLButtonElement"><code data-x="dom-button-type">type</code></dfn> | ||
getter steps are:</p> | ||
<p class="note">A button (and its value) is only included in the form submission if the button | ||
itself was used to initiate the form submission.</p> | ||
|
||
<ol> | ||
<li><p>If <span>this</span> is a <span data-x="concept-submit-button">submit button</span>, then | ||
return "<code data-x="">submit</code>".</p></li> | ||
<hr> | ||
|
||
<li><p>If <span>this</span>'s <span data-x="attr-button-type">type</span> attribute is in the | ||
<span data-x="attr-button-type-reset-state">Reset</span> state, then return "<code | ||
data-x="">reset</code>".</p></li> | ||
<div w-nodev> | ||
|
||
<li><p>Return "<code data-x="">button</code>".</p></li> | ||
</ol> | ||
<p>The <dfn attribute for="HTMLButtonElement"><code data-x="dom-button-value">value</code></dfn> | ||
IDL attribute must <span>reflect</span> the content attribute of the same name.</p> | ||
|
||
<p>The <code data-x="dom-button-type">type</code> setter steps are to set the <code | ||
data-x="attr-button-type">type</code> content attribute to the given value.</p> | ||
<p>The <dfn attribute for="HTMLButtonElement"><code data-x="dom-button-type">type</code></dfn> IDL | ||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
attribute must <span>reflect</span> the content attribute of the same name, <span>limited to only | ||
known values</span>.</p> | ||
|
||
<p>The <code data-x="dom-cva-willValidate">willValidate</code>, <code | ||
data-x="dom-cva-validity">validity</code>, and <code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking that here too we might be able to use "canonical keyword", but that probably would require returning button if the state is Submit as a second step? Not sure if worth it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. It would save us from having "reset" and "submit" potentially, and maybe it would be useful if we end up adding new types to button. Happy to do it if you think I should. |
||
|
@@ -62261,13 +62248,13 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> { | |
|
||
<ol> | ||
<li><p>If <var>subject</var> has an <code data-x="attr-dialog-open">open</code> attribute and | ||
the <span>is modal</span> flag of <var>subject</var> is true, then return.</p></li> | ||
<span>is modal</span> of <var>subject</var> is true, then return.</p></li> | ||
|
||
<li><p>If <var>subject</var> has an <code data-x="attr-dialog-open">open</code> attribute, then | ||
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li> | ||
|
||
<li><p>If <var>subject</var>'s <span>node document</span> is not <span>fully active</span>, | ||
then throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li> | ||
<li><p>If <var>subject</var>'s <span>node document</span> is not <span>fully active</span>, then | ||
throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li> | ||
|
||
<li><p>If <var>subject</var> is not <span>connected</span>, then throw an | ||
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li> | ||
|
@@ -62298,7 +62285,14 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> { | |
<li><p>Add an <code data-x="attr-dialog-open">open</code> attribute to <var>subject</var>, whose | ||
value is the empty string.</p></li> | ||
|
||
<li><p>Set the <span>is modal</span> flag of <var>subject</var> to true.</p></li> | ||
<li><p>Set <span>is modal</span> of <var>subject</var> to true.</p></li> | ||
|
||
<li><p><span>Assert</span>: <var>subject</var>'s <span>node document</span>'s <span>open | ||
dialogs list</span> does not <span data-x="list contains">contain</span> | ||
<var>subject</var>.</p></li> | ||
|
||
<li><p>Add <var>subject</var> to <var>subject</var>'s <span>node document</span>'s <span>open | ||
dialogs list</span>.</p></li> | ||
|
||
<li> | ||
<p>Let <var>subject</var>'s <span>node document</span> be <span data-x="blocked by a modal | ||
|
@@ -62316,39 +62310,114 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> { | |
already <span data-x="list contains">contain</span> <var>subject</var>, then <span>add an element | ||
to the top layer</span> given <var>subject</var>.</p></li> | ||
|
||
<li id="canceling-dialogs"> | ||
<p>Set <var>subject</var>'s <span data-x="dialog-close-watcher">close watcher</span> to the | ||
<li><p><span>Set the dialog close watcher</span> with <var>subject</var>.</p></li> | ||
|
||
<li><p>Set <var>subject</var>'s <span>previously focused element</span> to the | ||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span>focused</span> element.</p></li> | ||
|
||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<li><p>Let <var>document</var> be <var>subject</var>'s <span>node document</span>.</p></li> | ||
|
||
<li><p>Let <var>hideUntil</var> be the result of running <span>topmost popover ancestor</span> | ||
given <var>subject</var>, <var>document</var>'s <span>showing hint popover list</span>, null, and | ||
false.</p></li> | ||
|
||
<li><p>If <var>hideUntil</var> is null, then set <var>hideUntil</var> to the result of running | ||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span>topmost popover ancestor</span> given <var>subject</var>, <var>document</var>'s | ||
<span>showing auto popover list</span>, null, and false.</p></li> | ||
|
||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<li><p>If <var>hideUntil</var> is null, then set <var>hideUntil</var> to | ||
<var>document</var>.</p></li> | ||
|
||
<li><p>Run <span data-x="hide-all-popovers-until">hide all popovers until</span> given | ||
<var>hideUntil</var>, false, and true.</p></li> | ||
|
||
<li><p>Run the <span>dialog focusing steps</span> given <var>subject</var>.</p></li> | ||
</ol> | ||
|
||
<p>The <dfn method for="HTMLDialogElement"><code | ||
data-x="dom-dialog-close">close(<var>returnValue</var>)</code></dfn> method steps are: | ||
|
||
<ol> | ||
<li><p>If <var>returnValue</var> is not given, then set it to null.</p></li> | ||
|
||
<li><p><span>Close the dialog</span> <span>this</span> with <var>returnValue</var>.</p></li> | ||
</ol> | ||
|
||
<p>The <dfn method for="HTMLDialogElement"><code | ||
data-x="dom-dialog-requestClose">requestClose(<var>returnValue</var>)</code></dfn> method steps | ||
are:</p> | ||
|
||
<ol> | ||
<li><p>If <var>this</var> does not have an <code data-x="attr-dialog-open">open</code> | ||
attribute, then return.</p></li> | ||
|
||
<li><p><span>Assert</span>: <var>this</var>'s <span data-x="dialog-close-watcher">close | ||
watcher</span> is not null.</p></li> | ||
|
||
<li><p>Set <var>dialog</var>'s <span>enable close watcher for <code | ||
data-x="dom-dialog-requestClose">requestClose()</code></span> to true.</p></li> | ||
|
||
<li><p>If <var>returnValue</var> is not given, then set it to null.</p></li> | ||
|
||
<li><p>Set <var>this</var>'s <span>request close return value</span> to | ||
<var>returnValue</var>.</p></li> | ||
|
||
<li><p><span data-x="close-watcher-request-close">Request to close</span> <var>dialog</var>'s | ||
<span data-x="dialog-close-watcher">close watcher</span> with false.</p></li> | ||
|
||
<li><p>Set <var>dialog</var>'s <span>enable close watcher for <code | ||
data-x="dom-dialog-requestClose">requestClose()</code></span> to false.</p></li> | ||
</ol> | ||
|
||
|
||
<p id="canceling-dialogs">To <dfn>set the dialog close watcher</dfn>, given a <code>dialog</code> | ||
element <var>dialog</var>:</p> | ||
|
||
<ol> | ||
<li> | ||
<p>Set <var>dialog</var>'s <span data-x="dialog-close-watcher">close watcher</span> to the | ||
result of <span data-x="establish a close watcher">establishing a close watcher</span> given | ||
<var>subject</var>'s <span>relevant global object</span>, with:</p> | ||
<var>dialog</var>'s <span>relevant global object</span>, with:</p> | ||
|
||
<ul> | ||
<li><p><i data-x="create-close-watcher-cancelAction">cancelAction</i> given | ||
<var>canPreventClose</var> being to return the result of <span | ||
data-x="concept-event-fire">firing an event</span> named <code | ||
data-x="event-cancel">cancel</code> at <var>subject</var>, with the <code | ||
data-x="event-cancel">cancel</code> at <var>dialog</var>, with the <code | ||
data-x="dom-Event-cancelable">cancelable</code> attribute initialized to | ||
<var>canPreventClose</var>.</p></li> | ||
|
||
<li><p><i data-x="create-close-watcher-closeAction">closeAction</i> being to <span>close the | ||
dialog</span> given <var>subject</var> and null.</p></li> | ||
dialog</span> given <var>dialog</var> and <var>dialog</var>'s <span>request close return | ||
value</span>.</p></li> | ||
|
||
<li><p><i data-x="create-close-watcher-getEnabledState">getEnabledState</i> being to return | ||
true if <var>dialog</var>'s <span>enable close watcher for <code | ||
data-x="dom-dialog-requestClose">requestClose()</code></span> is true or <var>dialog</var>'s | ||
<span>computed closed-by state</span> is not <span | ||
data-x="attr-dialog-closedby-none-state">None</span>; otherwise false.</p></li> | ||
</ul> | ||
</li> | ||
</ol> | ||
|
||
<li><p>Set <var>subject</var>'s <span>previously focused element</span> to the | ||
<span>focused</span> element.</p></li> | ||
<p>To retrieve a dialog's <dfn>computed closed-by state</dfn>, given a <code>dialog</code> | ||
<var>dialog</var>: | ||
|
||
<li><p>Let <var>hideUntil</var> be the result of running <span>topmost popover ancestor</span> | ||
given <var>subject</var>, null, and false.</p></li> | ||
<ol> | ||
<li> | ||
<p>If the state of <var>dialog</var>'s <code data-x="attr-dialog-closedby">closedby</code> | ||
attribute is <span data-x="attr-dialog-closedby-auto-state">Auto</span>:</p> | ||
|
||
<li><p>If <var>hideUntil</var> is null, then set <var>hideUntil</var> to <var>subject</var>'s | ||
<span>node document</span>.</p></li> | ||
<ol> | ||
<li><p>If <var>dialog</var>'s <span>is modal</span> is true, then return <span | ||
data-x="attr-dialog-closedby-closerequest-state">Close Request</span>.</p></li> | ||
|
||
<li><p>Return <span data-x="attr-dialog-closedby-none-state">None</span>.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>Run the <span>dialog focusing steps</span> given <var>subject</var>.</p></li> | ||
<li><p>Return the state of <var>dialog</var>'s <code | ||
data-x="attr-dialog-closedby">closedby</code> attribute.</p></li> | ||
</ol> | ||
|
||
keithamus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<p>The <dfn>dialog focusing steps</dfn>, given a <code>dialog</code> element <var>subject</var>, | ||
|
@@ -80155,7 +80224,6 @@ dictionary <dfn dictionary>CommandEventInit</dfn> : <span>EventInit</span> { | |
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.</p> | ||
|
||
|
||
<h3>Focus</h3> | ||
|
||
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2807 --> | ||
|
Uh oh!
There was an error while loading. Please reload this page.