From ab7246df3794e69de4fa7521fe6cc2017d39a955 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 1 May 2025 12:19:31 +0100 Subject: [PATCH 1/3] Define an optional value and use it for setting dialog returnValue Define a new 'optional value' for buttons and submit inputs, this is used instead of 'value' when setting a dialog's returnValue. --- source | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/source b/source index 1d9d453d398..a92172aa4a0 100644 --- a/source +++ b/source @@ -51410,6 +51410,10 @@ ldh-str = < as defined in optional value is the value of + the element's value attribute, if there is one, or null + otherwise.

+

The element's input activation behavior given event is as follows:

    @@ -53865,7 +53869,9 @@ interface HTMLButtonElement : HTMLElement {

    The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string + data-x="attr-button-value">value attribute, if there is one, or the empty string otherwise. + The element's optional value is the value of the + element's value attribute, if there is one, or null otherwise.

    A button (and its value) is only included in the form submission if the button @@ -56648,6 +56654,11 @@ interface HTMLLegendElement : HTMLElement { default value. If it is false, value mirrors the default value. If it is true, the default value is ignored.

    +

    Some form controls also have an optional value + this largely mirrors the value but doesn't normalize to an + empty string. This should be used sparingly you generally + want value.

    +

    input, textarea, and select elements have a user validity boolean. It is initially set to false.

    @@ -60398,8 +60409,9 @@ fur
-
  • Otherwise, if submitter has a value, - then set result to that value.

  • +
  • Otherwise, if submitter has an optional value, then set result to that + optional value.

  • Close the dialog subject with result.

  • @@ -62609,7 +62621,7 @@ interface HTMLDialogElement : HTMLElement {
    1. Let value be invoker's value.

    2. + data-x="concept-fe-optional-value">optional value.

    3. Close the dialog element with value.

    From cadc51c817df156830940fee3232844b2f240494 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 7 May 2025 23:31:31 +0100 Subject: [PATCH 2/3] Address comments Add submit button check. ought to be used* --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index a92172aa4a0..eb710e2607d 100644 --- a/source +++ b/source @@ -56656,8 +56656,8 @@ interface HTMLLegendElement : HTMLElement {

    Some form controls also have an optional value this largely mirrors the value but doesn't normalize to an - empty string. This should be used sparingly you generally - want value.

    + empty string. This ought to be used sparingly, you generally want value.

    input, textarea, and select elements have a user validity boolean. It is initially set to false.

    @@ -60409,9 +60409,9 @@ fur -
  • Otherwise, if submitter has an optional value, then set result to that - optional value.

  • +
  • Otherwise, if submitter is a submit + button, then set result to submitter's optional value.

  • Close the dialog subject with result.

  • From b1087b3bb47fc339e02fe9b9874ea8e9f5224d9c Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 22 May 2025 14:38:54 +0100 Subject: [PATCH 3/3] adopt changes --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index eb710e2607d..fa1b3a08132 100644 --- a/source +++ b/source @@ -51411,8 +51411,8 @@ ldh-str = < as defined in
    optional value is the value of - the element's value attribute, if there is one, or null - otherwise.

    + the element's value attribute, if there is one; otherwise + null.

    The element's input activation behavior given event is as follows:

    @@ -53869,10 +53869,10 @@ interface HTMLButtonElement : HTMLElement {

    The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise. + data-x="attr-button-value">value attribute, if there is one; otherwise the empty string. The element's optional value is the value of the - element's value attribute, if there is one, or null - otherwise.

    + element's value attribute, if there is one; otherwise + null.

    A button (and its value) is only included in the form submission if the button itself was used to initiate the form submission.