From e533f5aada2936fd512669cc9d9a936a95af0a34 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Fri, 14 Feb 2025 15:25:03 +0100 Subject: [PATCH 01/17] Pick up https://github.com/whatwg/html/pull/9844 --- source | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source b/source index 2590aa57623..a5d7d18094d 100644 --- a/source +++ b/source @@ -4615,6 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • WebDriver BiDi navigable destroyed
  • WebDriver BiDi user prompt closed
  • WebDriver BiDi user prompt opened
  • +
  • WebDriver BiDi file dialog opened
  • @@ -53263,6 +53264,11 @@ You cannot submit this form when the field is incorrect.
    1. Optionally, wait until any prior execution of this algorithm has terminated.

    2. +
    3. Let intercepted be the result of + WebDriver BiDi file dialog opened with element.

    4. + +
    5. If intercepted is true, then return.
    6. +
    7. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there must be no more than one file selected; otherwise, any number may be selected. Files can be From b998019323803e129e7afe5d13b10762300800e9 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Fri, 14 Feb 2025 16:09:35 +0100 Subject: [PATCH 02/17] Intercept all kind of pickers --- source | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source b/source index a5d7d18094d..db58579dc1f 100644 --- a/source +++ b/source @@ -4615,7 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    8. WebDriver BiDi navigable destroyed
    9. WebDriver BiDi user prompt closed
    10. WebDriver BiDi user prompt opened
    11. -
    12. WebDriver BiDi file dialog opened
    13. +
    14. WebDriver BiDi picker shown
    15. @@ -53255,6 +53255,11 @@ You cannot submit this form when the field is incorrect.
    16. If element does not support a picker, then return.

    17. +
    18. Let intercepted be the result of WebDriver BiDi picker shown with + element.

    19. + +
    20. If intercepted is true, then return.
    21. +
    22. If element is an input element and element's type attribute is in the

      1. Optionally, wait until any prior execution of this algorithm has terminated.

      2. -
      3. Let intercepted be the result of - WebDriver BiDi file dialog opened with element.

      4. - -
      5. If intercepted is true, then return.
      6. -
      7. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there must be no more than one file selected; otherwise, any number may be selected. Files can be @@ -147564,6 +147564,7 @@ INSERT INTERFACES HERE Magnus Kristiansen, Maik Merten, Majid Valipour, + Maksim Sadym, Malcolm Rowe, Manish Goregaokar, Manish Tripathi, From c36c762f3963d08093c631edb60768b993d89cbe Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Fri, 14 Feb 2025 16:28:09 +0100 Subject: [PATCH 03/17] Define "picker" --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index db58579dc1f..f716c81504a 100644 --- a/source +++ b/source @@ -48250,8 +48250,8 @@ interface HTMLInputElement : HTMLElement { being mutable.

        The input element can support a picker. A - picker is a user interface element that allows the end user to choose a value. Whether an - input element supports a picker depends on the picker is a user interface element that allows the end user to + choose a value. Whether an input element supports a picker depends on the type attribute state and implementation-defined behavior. An input element must support a picker when its type attribute is in the File From a2b0d125c0b87242acfdad296560ce124e5a4425 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 17 Feb 2025 14:50:51 +0100 Subject: [PATCH 04/17] Pas picker type in event --- source | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source b/source index f716c81504a..91bcf7e810a 100644 --- a/source +++ b/source @@ -53255,8 +53255,15 @@ You cannot submit this form when the field is incorrect.

      8. If element does not support a picker, then return.

      9. +
      10. Let picker type be null.

      11. + +
      12. If element is an input element and element's type attribute is in the File Upload state, then set picker type to + "file upload".
      13. +
      14. Let intercepted be the result of WebDriver BiDi picker shown with - element.

      15. + element and picker type.

      16. If intercepted is true, then return.
      17. From e1dc131aa00d61a78491f2663dfca81e0fd85650 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 17 Feb 2025 14:54:41 +0100 Subject: [PATCH 05/17] remove def "input-picker" --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 91bcf7e810a..9ab05cbcb16 100644 --- a/source +++ b/source @@ -48250,8 +48250,8 @@ interface HTMLInputElement : HTMLElement { being mutable.

        The input element can support a picker. A - picker is a user interface element that allows the end user to - choose a value. Whether an input element supports a picker depends on the input element supports a picker depends on the type attribute state and implementation-defined behavior. An input element must support a picker when its type attribute is in the File From b278f220202e1ecac4d660e74f9a92ff2e101299 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 25 Feb 2025 10:45:05 +0100 Subject: [PATCH 06/17] file dialog can be dismissed and suppressed --- source | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/source b/source index 9ab05cbcb16..c5d191c8e3d 100644 --- a/source +++ b/source @@ -4615,7 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

      18. WebDriver BiDi navigable destroyed
      19. WebDriver BiDi user prompt closed
      20. WebDriver BiDi user prompt opened
      21. -
      22. WebDriver BiDi picker shown
      23. +
      24. WebDriver BiDi file dialog shown
      25. @@ -53255,18 +53255,6 @@ You cannot submit this form when the field is incorrect.
      26. If element does not support a picker, then return.

      27. -
      28. Let picker type be null.

      29. - -
      30. If element is an input element and element's type attribute is in the File Upload state, then set picker type to - "file upload".
      31. - -
      32. Let intercepted be the result of WebDriver BiDi picker shown with - element and picker type.

      33. - -
      34. If intercepted is true, then return.
      35. -
      36. If element is an input element and element's type attribute is in the

        1. Optionally, wait until any prior execution of this algorithm has terminated.

        2. -
        3. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there - must be no more than one file selected; otherwise, any number may be selected. Files can be - from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the - user's device.

        4. +
        5. Let (suppressed, dismissed) be the result of + WebDriver BiDi file dialog shown with element and + picker type.

        6. -
        7. Wait for the user to have made their selection.

        8. +
        9. +

          If suppressed is false:

          +
            +
          1. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there + must be no more than one file selected; otherwise, any number may be selected. Files can be + from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the + user's device.

          2. -
          3. If the user dismissed the prompt without changing their selection, then queue an - element task on the user interaction task source given element - to fire an event named cancel at element, with the bubbles attribute initialized to true.

          4. +
          5. Wait for the user to have made their selection.

          6. +
          +
        10. + +
        11. +

          If dismissed is true or if the user dismissed the prompt without changing their + selection:

          +
            +
          1. Queue an element task on the user interaction task source + given element to fire an event named + cancel at element, with the + bubbles attribute initialized to true.

          2. +
          +
        12. Otherwise, update the file selection for element.

        From 3d98fc10fb17afd2fcc2364a006440afc5ae0fce Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 25 Feb 2025 10:57:11 +0100 Subject: [PATCH 07/17] file dialog can be only dismissed --- source | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source b/source index c5d191c8e3d..aec899bdf04 100644 --- a/source +++ b/source @@ -53264,12 +53264,11 @@ You cannot submit this form when the field is incorrect.
        1. Optionally, wait until any prior execution of this algorithm has terminated.

        2. -
        3. Let (suppressed, dismissed) be the result of - WebDriver BiDi file dialog shown with element and - picker type.

        4. +
        5. Let dismissed be the result of WebDriver BiDi file dialog shown + with element.

        6. -

          If suppressed is false:

          +

          If dismissed is false:

          1. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there From 3494f7ea0f8548d2a4cbefe0427583005edef905 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 25 Feb 2025 11:25:54 +0100 Subject: [PATCH 08/17] WebDriver BiDi file dialog opened --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index aec899bdf04..a4ec82d56be 100644 --- a/source +++ b/source @@ -4615,7 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

          2. WebDriver BiDi navigable destroyed
          3. WebDriver BiDi user prompt closed
          4. WebDriver BiDi user prompt opened
          5. -
          6. WebDriver BiDi file dialog shown
          7. +
          8. WebDriver BiDi file dialog opened
          9. @@ -53264,7 +53264,7 @@ You cannot submit this form when the field is incorrect.
            1. Optionally, wait until any prior execution of this algorithm has terminated.

            2. -
            3. Let dismissed be the result of WebDriver BiDi file dialog shown +

            4. Let dismissed be the result of WebDriver BiDi file dialog opened with element.

            5. From 0d78269f3f19fb2a5fca13dacbc7d71258d49acd Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Thu, 27 Feb 2025 18:26:35 +0100 Subject: [PATCH 09/17] add null options to "WebDriver BiDi file dialog opened" --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index a4ec82d56be..71205178a2c 100644 --- a/source +++ b/source @@ -53265,7 +53265,7 @@ You cannot submit this form when the field is incorrect.
            6. Optionally, wait until any prior execution of this algorithm has terminated.

            7. Let dismissed be the result of WebDriver BiDi file dialog opened - with element.

            8. + with element and null.

            9. If dismissed is false:

              From 972943c2b63a6b95658deb624ba77a152820b2f3 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 3 Mar 2025 12:47:24 +0100 Subject: [PATCH 10/17] do not pass options --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 71205178a2c..a4ec82d56be 100644 --- a/source +++ b/source @@ -53265,7 +53265,7 @@ You cannot submit this form when the field is incorrect.
            10. Optionally, wait until any prior execution of this algorithm has terminated.

            11. Let dismissed be the result of WebDriver BiDi file dialog opened - with element and null.

            12. + with element.

            13. If dismissed is false:

              From e665889b54b6d7add002e48be6db058ca3003dbf Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 4 Mar 2025 14:13:23 +0100 Subject: [PATCH 11/17] Move back to `WebDriver BiDi picker shown` --- source | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source b/source index a4ec82d56be..1743e358ae7 100644 --- a/source +++ b/source @@ -4615,7 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
            14. WebDriver BiDi navigable destroyed
            15. WebDriver BiDi user prompt closed
            16. WebDriver BiDi user prompt opened
            17. -
            18. WebDriver BiDi file dialog opened
            19. +
            20. WebDriver BiDi picker opened
            21. @@ -53255,6 +53255,11 @@ You cannot submit this form when the field is incorrect.
            22. If element does not support a picker, then return.

            23. +
            24. Let intercepted be the result of WebDriver BiDi picker opened + with element.

            25. + +
            26. If intercepted is true, then return.

            27. +
            28. If element is an input element and element's type attribute is in the

              1. Optionally, wait until any prior execution of this algorithm has terminated.

              2. -
              3. Let dismissed be the result of WebDriver BiDi file dialog opened - with element.

              4. +
              5. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there + must be no more than one file selected; otherwise, any number may be selected. Files can be + from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the + user's device.

              6. -
              7. -

                If dismissed is false:

                -
                  -
                1. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there - must be no more than one file selected; otherwise, any number may be selected. Files can be - from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the - user's device.

                2. - -
                3. Wait for the user to have made their selection.

                4. -
                -
              8. +
              9. Wait for the user to have made their selection.

              10. If dismissed is true or if the user dismissed the prompt without changing their From c38f4f6b2e94a75eb3c47ef2f35c7c2c1004ec11 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 4 Mar 2025 14:28:23 +0100 Subject: [PATCH 12/17] Pass "picker type" --- source | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source b/source index 1743e358ae7..4c50465cbaa 100644 --- a/source +++ b/source @@ -53255,16 +53255,21 @@ You cannot submit this form when the field is incorrect.

              11. If element does not support a picker, then return.

              12. +
              13. Let picker type be null.

              14. + +
              15. If element is an input element and element's type attribute is in the File Upload state, then set picker type to + "file upload".
              16. +
              17. Let intercepted be the result of WebDriver BiDi picker opened - with element.

              18. + with element and picker type.

              19. If intercepted is true, then return.

              20. -

                If element is an input element and element's type attribute is in the File Upload state, then run these steps in - parallel:

                +

                If picker type equals "file upload", then run these steps + in parallel:

                1. Optionally, wait until any prior execution of this algorithm has terminated.

                2. From 441b03fec7b0e78fdcd8c3a57d63e23fa1dacfd2 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 4 Mar 2025 14:30:04 +0100 Subject: [PATCH 13/17] remove artefact --- source | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source b/source index 4c50465cbaa..73dec448902 100644 --- a/source +++ b/source @@ -53282,16 +53282,11 @@ You cannot submit this form when the field is incorrect.
                3. Wait for the user to have made their selection.

                4. -
                5. -

                  If dismissed is true or if the user dismissed the prompt without changing their - selection:

                  -
                    -
                  1. Queue an element task on the user interaction task source - given element to fire an event named - cancel at element, with the - bubbles attribute initialized to true.

                  2. -
                  -
                6. +
                7. If the user dismissed the prompt without changing their selection, then queue an + element task on the user interaction task source given element + to fire an event named cancel at element, with the bubbles attribute initialized to true.

                8. Otherwise, update the file selection for element.

                From 9c29b6c82727aa8a31dbf2e1cca4960162ae7ccd Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 4 Mar 2025 14:34:22 +0100 Subject: [PATCH 14/17] roll back to dismissing dialog --- source | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/source b/source index 73dec448902..16dd629ec55 100644 --- a/source +++ b/source @@ -4615,7 +4615,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
              21. WebDriver BiDi navigable destroyed
              22. WebDriver BiDi user prompt closed
              23. WebDriver BiDi user prompt opened
              24. -
              25. WebDriver BiDi picker opened
              26. +
              27. WebDriver BiDi file dialog opened
              28. @@ -53255,38 +53255,41 @@ You cannot submit this form when the field is incorrect.
              29. If element does not support a picker, then return.

              30. -
              31. Let picker type be null.

              32. - -
              33. If element is an input element and element's type attribute is in the File Upload state, then set picker type to - "file upload".
              34. - -
              35. Let intercepted be the result of WebDriver BiDi picker opened - with element and picker type.

              36. - -
              37. If intercepted is true, then return.

              38. -
              39. -

                If picker type equals "file upload", then run these steps - in parallel:

                +

                If element is an input element and element's type attribute is in the File Upload state, then run these steps in + parallel:

                1. Optionally, wait until any prior execution of this algorithm has terminated.

                2. -
                3. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there - must be no more than one file selected; otherwise, any number may be selected. Files can be - from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the - user's device.

                4. +
                5. Let dismissed be the result of WebDriver BiDi file dialog opened + with element.

                6. + +
                7. +

                  If dismissed is false:

                  +
                    +
                  1. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there + must be no more than one file selected; otherwise, any number may be selected. Files can be + from the filesystem or created on the fly, e.g., a picture taken from a camera connected to the + user's device.

                  2. -
                  3. Wait for the user to have made their selection.

                  4. +
                  5. Wait for the user to have made their selection.

                  6. +
                  +
                8. -
                9. If the user dismissed the prompt without changing their selection, then queue an - element task on the user interaction task source given element - to fire an event named cancel at element, with the bubbles attribute initialized to true.

                10. +
                11. +

                  If dismissed is true or if the user dismissed the prompt without changing their + selection:

                  +
                    +
                  1. Queue an element task on the user interaction task source + given element to fire an event named + cancel at element, with the + bubbles attribute initialized to true.

                  2. +
                  +
                12. Otherwise, update the file selection for element.

                From 1d02e03fa030e99567029703222369e127f01415 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 10 Mar 2025 10:55:13 +0100 Subject: [PATCH 15/17] Address editorial comments --- source | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source b/source index 16dd629ec55..8fee5c32896 100644 --- a/source +++ b/source @@ -53269,6 +53269,7 @@ You cannot submit this form when the field is incorrect.
              40. If dismissed is false:

                +
                1. Display a prompt to the user requesting that the user specify some files. If the multiple attribute is not set on element, there @@ -53282,13 +53283,10 @@ You cannot submit this form when the field is incorrect.

                2. If dismissed is true or if the user dismissed the prompt without changing their - selection:

                  -
                    -
                  1. Queue an element task on the user interaction task source + selection, queue an element task on the user interaction task source given element to fire an event named cancel at element, with the - bubbles attribute initialized to true.

                  2. -
                  + bubbles attribute initialized to true.

                3. Otherwise, update the file selection for element.

                4. From 0bf2b9c1e08de8edc4d903ecfd2cd2896df270f7 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Tue, 11 Mar 2025 09:07:34 +0100 Subject: [PATCH 16/17] format --- source | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source b/source index 8fee5c32896..67de15e2201 100644 --- a/source +++ b/source @@ -53281,13 +53281,11 @@ You cannot submit this form when the field is incorrect.
              41. -
              42. -

                If dismissed is true or if the user dismissed the prompt without changing their - selection, queue an element task on the user interaction task source - given element to fire an event named - cancel at element, with the - bubbles attribute initialized to true.

                -
              43. +
              44. If dismissed is true or if the user dismissed the prompt without changing their + selection, queue an element task on the user interaction task source given + element to fire an event named + cancel at element, with the + bubbles attribute initialized to true.

              45. Otherwise, update the file selection for element.

              From 59f659ebff44c3ec1dc402d3d2db6194eed8bba8 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 12 Mar 2025 12:08:29 +0900 Subject: [PATCH 17/17] Add missing --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 67de15e2201..50ad60cf84a 100644 --- a/source +++ b/source @@ -53281,10 +53281,10 @@ You cannot submit this form when the field is incorrect.
            -
          10. If dismissed is true or if the user dismissed the prompt without changing their - selection, queue an element task on the user interaction task source given - element to fire an event named - cancel at element, with the +

          11. If dismissed is true or if the user dismissed the prompt without changing + their selection, then queue an element task on the user interaction task + source given element to fire an + event named cancel at element, with the bubbles attribute initialized to true.

          12. Otherwise, update the file selection for element.