From 73fe6dd4b1c1eea28b35b57fb546799e7eba0e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 16 Jan 2024 12:13:37 +0100 Subject: [PATCH 1/3] Rename user-interacted flag to user valid or invalid. Since it has nothing to do with interaction. --- source | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/source b/source index dcaabec09f9..63035040474 100644 --- a/source +++ b/source @@ -47671,8 +47671,9 @@ interface HTMLInputElement : HTMLElement {

The reset algorithm for input - elements is to set the user interacted, dirty value - flag, and dirty checkedness flag + elements is to set the user valid or invalid flag, + dirty value flag, and + dirty checkedness flag back to false, set the value of the element to the value of the value content attribute, if there is one, or the empty string otherwise, set the checkedness of the @@ -52622,7 +52623,7 @@ You cannot submit this form when the field is incorrect. data-x="dom-Event-bubbles">bubbles and composed attributes initialized to true, and any time the user commits the change, the user agent must queue an element task on the user interaction task source given the - input element to set its user interacted to true and input element to set its user valid or invalid flag to true and fire an event named change at the input element, with the bubbles attribute initialized to true.

@@ -53191,7 +53192,7 @@ interface HTMLSelectElement : HTMLElement { element to run these steps:

    -
  1. Set the select element's user interacted to true.
  2. +
  3. Set the select element's user valid or invalid flag to true.
  4. Fire an event named input at the select element, with the HTMLSelectElement : HTMLElement { element selectElement is:

      -
    1. Set selectElement's user interacted to false.

    2. +
    3. Set selectElement's user valid or invalid flag to false.

    4. For each optionElement of @@ -54181,7 +54182,7 @@ interface HTMLTextAreaElement : HTMLElement { content.

      The reset algorithm for textarea - elements is to set the user interacted to false, user valid or invalid flag to false, dirty value flag back to false, and set the raw value of element to its child text content.

      @@ -55581,8 +55582,8 @@ interface HTMLLegendElement : HTMLElement { default value. If it is false, value mirrors the default value. If it is true, the default value is ignored.

      -

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

      +

      input, textarea and select elements have a + user valid or invalid flag. It is initially set to false.

      To define the behavior of constraint validation in the face of the input element's multiple attribute, input elements @@ -59676,8 +59677,8 @@ fur

      For each element field in controls, in tree order:

        -
      1. If setUserInteracted is true, then set field's user - interacted to true.

      2. +
      3. If setUserInteracted is true, then set field's user valid or + invalid flag to true.

      4. If any of the following are true:

        @@ -74044,18 +74045,18 @@ Demos:

        The :user-valid pseudo-class must match input, textarea, and select elements that have - their user interacted set to true, are candidates for constraint validation, and that satisfy their constraints.

        + their user valid or invalid flag set to true, are + candidates for constraint validation, + and that satisfy their constraints.

        :user-invalid

        The :user-invalid pseudo-class must match input, textarea, and select elements that have - their user interacted set to true, are candidates for constraint validation but do not satisfy their constraints.

        + their user valid or invalid flag set to true, are + candidates for constraint validation + but do not satisfy their constraints.

        :in-range
        @@ -79577,7 +79578,7 @@ dictionary ToggleEventInit : EventInit { control was first focused), then:

          -
        1. Set entry's user interacted to true.

        2. +
        3. Set entry's user valid or invalid flag to true.

        4. Fire an event named change at the element, with the Date: Tue, 16 Jan 2024 12:23:57 +0100 Subject: [PATCH 2/3] Move where the user valid or invalid flag is set. Fixes #10066, matches WebKit and (soon) Gecko. --- source | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source b/source index 63035040474..5f9c06edd49 100644 --- a/source +++ b/source @@ -59237,6 +59237,10 @@ fur

        5. Set form's firing submission events to true.

        6. +
        7. For each element field in the list of + submittable elements whose form owner is + form, set the user valid or invalid flag of field to true. +

        8. If the submitter element's no-validate state is false, then interactively validate the constraints of @@ -59278,7 +59282,7 @@ fur form.

        9. Let entry list be the result of constructing the entry list with - form, submitter, encoding, and true.

        10. + form, submitter, and encoding.

        11. Assert: entry list is not null.

        12. @@ -59659,8 +59663,8 @@ fur

          To construct the entry list given a form, an - optional submitter (default null), an optional encoding (default - UTF-8), and an optional setUserInteracted (default false): + optional submitter (default null), and an optional encoding (default + UTF-8):

          1. If form's constructing entry list is true, then return @@ -59677,9 +59681,6 @@ fur

            For each element field in controls, in tree order:

              -
            1. If setUserInteracted is true, then set field's user valid or - invalid flag to true.

            2. -
            3. If any of the following are true:

              From 34108abbd0868aef767f1d7d28b7f4c9ba91877c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 16 Jan 2024 14:24:53 +0100 Subject: [PATCH 3/3] Address nits. --- source | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source b/source index 5f9c06edd49..95a98cc106c 100644 --- a/source +++ b/source @@ -47671,7 +47671,7 @@ interface HTMLInputElement : HTMLElement {

              The reset algorithm for input - elements is to set the user valid or invalid flag, + elements is to set its user validity, dirty value flag, and dirty checkedness flag back to false, set the value of the element to the value @@ -52623,7 +52623,7 @@ You cannot submit this form when the field is incorrect. data-x="dom-Event-bubbles">bubbles and composed attributes initialized to true, and any time the user commits the change, the user agent must queue an element task on the user interaction task source given the - input element to set its user valid or invalid flag to true and input element to set its user validity to true and fire an event named change at the input element, with the bubbles attribute initialized to true.

              @@ -53192,7 +53192,7 @@ interface HTMLSelectElement : HTMLElement { element to run these steps:

                -
              1. Set the select element's user valid or invalid flag to true.
              2. +
              3. Set the select element's user validity to true.
              4. Fire an event named input at the select element, with the HTMLSelectElement : HTMLElement { element selectElement is:

                  -
                1. Set selectElement's user valid or invalid flag to false.

                2. +
                3. Set selectElement's user validity to false.

                4. For each optionElement of @@ -54182,7 +54182,7 @@ interface HTMLTextAreaElement : HTMLElement { content.

                  The reset algorithm for textarea - elements is to set the user valid or invalid flag to false, user validity to false, dirty value flag back to false, and set the raw value of element to its child text content.

                  @@ -55583,7 +55583,7 @@ interface HTMLLegendElement : HTMLElement { value. If it is true, the default value is ignored.

                  input, textarea and select elements have a - user valid or invalid flag. It is initially set to false.

                  + user validity boolean. It is initially set to false.

                  To define the behavior of constraint validation in the face of the input element's multiple attribute, input elements @@ -59239,7 +59239,7 @@ fur

                5. For each element field in the list of submittable elements whose form owner is - form, set the user valid or invalid flag of field to true. + form, set field's user validity to true.

                6. If the submitter element's no-validate @@ -74045,8 +74045,8 @@ Demos:

                  :user-valid

                  The :user-valid pseudo-class must - match input, textarea, and select elements that have - their user valid or invalid flag set to true, are + match input, textarea, and select elements whose + user validity is true, are candidates for constraint validation, and that satisfy their constraints.

                  @@ -74054,8 +74054,8 @@ Demos:
                  :user-invalid

                  The :user-invalid pseudo-class must - match input, textarea, and select elements that have - their user valid or invalid flag set to true, are + match input, textarea, and select elements whose + user validity is true, are candidates for constraint validation but do not satisfy their constraints.

                  @@ -79579,7 +79579,7 @@ dictionary ToggleEventInit : EventInit { control was first focused), then:

                    -
                  1. Set entry's user valid or invalid flag to true.

                  2. +
                  3. Set entry's user validity to true.

                  4. Fire an event named change at the element, with the