Skip to content

Commit f3444c2

Browse files
authored
Define an optional value and use it for setting dialog's returnValue
Define a new 'optional value' for buttons. This is used instead of 'value' when setting a dialog's returnValue. Tests: - web-platform-tests/wpt#51484 - web-platform-tests/wpt#52278 Fixes whatwg#11092.
1 parent 2745af0 commit f3444c2

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

source

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51413,6 +51413,10 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
5141351413

5141451414
<div w-nodev>
5141551415

51416+
<p>The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of
51417+
the element's <code data-x="attr-button-value">value</code> attribute, if there is one; otherwise
51418+
null.</p>
51419+
5141651420
<p>The element's <span>input activation behavior</span> given <var>event</var> is as follows:</p>
5141751421

5141851422
<ol>
@@ -53868,8 +53872,10 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
5386853872
<p>The <dfn element-attr for="button"><code data-x="attr-button-value">value</code></dfn>
5386953873
attribute gives the element's value for the purposes of form submission. The element's <span
5387053874
data-x="concept-fe-value">value</span> is the value of the element's <code
53871-
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string
53872-
otherwise.</p>
53875+
data-x="attr-button-value">value</code> attribute, if there is one; otherwise the empty string.
53876+
The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of the
53877+
element's <code data-x="attr-button-value">value</code> attribute, if there is one; otherwise
53878+
null.</p>
5387353879

5387453880
<p class="note">A button (and its value) is only included in the form submission if the button
5387553881
itself was used to initiate the form submission.</p>
@@ -56651,6 +56657,11 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5665156657
default value. If it is false, <span data-x="concept-fe-value">value</span> mirrors the default
5665256658
value. If it is true, the default value is ignored.</p>
5665356659

56660+
<p>Some form controls also have an <dfn data-x="concept-fe-optional-value">optional value</dfn>
56661+
this largely mirrors the <span data-x="concept-fe-value">value</span> but doesn't normalize to an
56662+
empty string. <span class="note">This ought to be used sparingly, you generally want <span
56663+
data-x="concept-fe-value">value</span></span>.</p>
56664+
5665456665
<p><code>input</code>, <code>textarea</code>, and <code>select</code> elements have a
5665556666
<dfn>user validity</dfn> boolean. It is initially set to false.</p>
5665656667

@@ -60399,8 +60410,9 @@ fur
6039960410
</ol>
6040060411
</li>
6040160412

60402-
<li><p>Otherwise, if <var>submitter</var> has a <span data-x="concept-fe-value">value</span>,
60403-
then set <var>result</var> to that <span data-x="concept-fe-value">value</span>.</p></li>
60413+
<li><p>Otherwise, if <var>submitter</var> is a <span data-x="concept-submit-button">submit
60414+
button</span>, then set <var>result</var> to <var>submitter</var>'s <span
60415+
data-x="concept-fe-optional-value">optional value</span>.</p></li>
6040460416

6040560417
<li><p><span>Close the dialog</span> <var>subject</var> with <var>result</var>.</p></li>
6040660418

@@ -62607,7 +62619,7 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6260762619

6260862620
<ol>
6260962621
<li><p>Let <var>value</var> be <var>invoker</var>'s <span
62610-
data-x="concept-fe-value">value</span>.</p></li>
62622+
data-x="concept-fe-optional-value">optional value</span>.</p></li>
6261162623

6261262624
<li><p><span>Close the dialog</span> <var>element</var> with <var>value</var>.</p></li>
6261362625
</ol>

0 commit comments

Comments
 (0)