Skip to content

Form Controls #11

Closed
Closed

Description

@mfreed7

Description
Form controls are mentioned frequently as a source of developer frustration. While "form controls" is a quite general area, there are several recurring themes (e.g. see the most recent state of css survey results):

  • Form element stylability, particularly for <select>, <input type=checkbox>, and <input type=radio>, but also generally for all input types.
  • Pseudo-element interop, particularly for <input type=range>.
  • Date/time input element support.
  • CSS accent-color support.
  • Form validation behavior.
  • appearance:none/auto (unprefixed).

Specification
Other than accent-color, form element appearance is not (well) specified.

Tests

Rationale
Forms and forms-related-interop problems are very common developer complaints, e.g. state of CSS.

Activity

  1. jgraham commented on Nov 9, 2021

    @jgraham
    Contributor

    So I'm in favour of improving form controls in general, but I'm concerned about the lack of spec/tests for the areas that are causing developer pain. Is there an area that meets the bar of:

    • Causes significant compat problems or represents an area of difficulty for developers
    • Has a spec with multi-vendor buy-in.
    • Either has existing tests or for which tests could be written without major difficulty.

    If not it seems like the first step in this area would be to agree on the path forward at the specification level and revisit including this in a future iteration of the Interop initative.

  2. jensimmons commented on Nov 9, 2021

    @jensimmons
    Contributor

    @mfreed7 What is your proposal for inclusion of a specific web technology to be included in Interop 2022?

    "Improve form controls" is the mission of the Open UI project, and the HTML and CSS working groups. Interop 2022 is for encouraging browser rendering engines to implement features that have specifications, or to fix interop bugs that are particularly problematic for web developers.

  3. bkardell commented on Nov 11, 2021

    @bkardell
    Contributor

    It strikes me that it might be easier for me to explain my comments/questions in the meeting and on the other issue with specific examples and questions.

    "form element stylability" is too general thing probably, and is not well defined enough and seems mostly wound up in openui sutff. There might be something very specific worth looking at there, but I think it would need to be specific. However, unprefixed appearance:none/auto seems like it could be a specific example of something I would include in this bucket, and seems appropriate for interop 2022. There are a number of existing tests (linked above) there that have plenty of gaps we could close, and there might be more. Form submission and validation behaviors too have lots of tests and are very ragged, and maybe there should be more. input has many gaps in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#browser_compatibility. The example on #9 could go in a similar bucket for forms or interactive elemnts compat.

    Inevitably, for some of these things there will be reasons like "the spec is unclear" or "the spec left this undefined, but there is a defacto standard, it seems".

    This part has potential overlap with other venues, but I believe that's ok - not so much solving a new problem as filling observable gaps?

    There are things, including PRs with tests like whatwg/html#5099 which point out things like this - is that 'in scope'? If so, I would say that also could go in a "forms" (or "interactive elements") bucket.

    I think there are deltas on datalist too, but there are few tests. On twitter someone also suggested that there are "cross-browser differences in which events fire when. E.g., while typing each character in an input or keyboard scrolling through a select list." Not sure if those are known or have tests, but again, seems to fit a possible 'theme' here and if so would fit into what I'd expect would probably be appropriate.

  4. zcorpan commented on Nov 11, 2021

    @zcorpan
    Member

    For appearance (at least for the behavior of the property, not necessarily the precise rendering for all widgets), spec and test PRs are in review and I hope can be merged soon:

  5. mfreed7 commented on Nov 12, 2021

    @mfreed7
    Author

    Thanks for the comments here. I think I may have confused things by starting my list with "Form element stylability". I didn't intend this issue to be about forward-looking things that OpenUI is working on. As several have pointed out, that type of "new stuff" likely doesn't belong here.

    But I do think perhaps some corner case form control stylability things could be included here? Things that provide developer frustration currently? Due to the poor state of form element standardization, perhaps many of these are going to end up being controversial. But just for a quick example, <input type=week value='2021-W45'> shouldn't match the appearance of <input type=text value='2021-W45'>. I.e. there should be a display that represents the week. This meets maybe 2.5 of the three bars:

    • Causes significant compat problems or represents an area of difficulty for developers. (4 distinct comments on the State of CSS mentioned this area)
    • Has a spec with multi-vendor buy-in. (spec, but appearance not specified)
    • Either has existing tests or for which tests could be written without major difficulty. (we can write some, relatively easily)

    I also just want to really +1 the comment from @bkardell. It seems like there's a collection of behaviors that do meet the bars above. It'll take some work to collect them, but that's the intention of this issue. @josepharhar from the Chromium team is willing to try to do that collection, if folks think this is a worthwhile area to include in Interop2022.

  6. jensimmons commented on Nov 13, 2021

    @jensimmons
    Contributor

    perhaps some corner case form control stylability things could be included here? Things that provide developer frustration currently?

    Rather than spending more time debating whether or not we should perhaps consider a to-be-determined-in-the-future list of possibilities, I’d like to assert that yes, this is an area folks are willing to consider. There’s no one objecting to suggestions that concern form controls.

    What’s needed is a specific list. What exactly is proposed? As we make decisions about what will be included in Interop 2022, we will be considering specific technology or bugs.

    Without a list, we won’t be able to make any decisions. We can’t just “write a blank check”.

  7. mfreed7 commented on Nov 13, 2021

    @mfreed7
    Author

    Rather than spending more time debating whether or not we should perhaps consider a to-be-determined-in-the-future list of possibilities, I’d like to assert that yes, this is an area folks are willing to consider. There’s no one objecting to suggestions that concern form controls.

    Great! I guess I misunderstood your first post. As I said, @josepharhar will work on putting together a proposed list.

  8. josepharhar commented on Nov 16, 2021

    @josepharhar

    Here is a concrete list of things we could do, with specific actions bolded.

    • <input type=range>
      • There were many entries in the spreadsheet of people asking for improved range stylability and pseudo elements.
      • The pseudo elements aren't specced, aren't tested, and aren't in every browser. We could spec and test these pseudo elements.
      • There is a datalist feature in the spec, I'm not sure if it is tested or if it's implemented in all browsers. We could make sure there are tests for range datalists.
    • appearance
    • date/time inputs
      • there were many entries in the spreadsheet asking for better date/time inputs. Most of the browsers have pickers for most of these implemented now, but there are still some that are missing: <input type=week> and <input type=month>. Firefox and safari fallback to <input type=text> for these. The spec seems a bit nebulous, and firefox passes all WPTs despite identical appearance to <input type=text>.
        • We could strengthen the spec for type=month and type=week to ensure there is some UI that helps the user pick a valid value.
        • We could make notref WPTs to ensure there is some custom UI instead of a plain text input for type=month and type=week, as well as other input types which are already implemented.

    Other thoughts:

    • I'm not sure what the issues with form validation are, but there was one entry in the spreadsheet asking for improvements.
    • There were many entries asking for improved/stylable <select>. hopefully these are addressed by the new <selectmenu> element.
    • There were multiple entires asking for checkboxes and radios. I'm not sure what exactly is wrong with them, but accent-color should at least make them all colorable when it is implemented by all browsers.
    • accent-color was also mentioned multiple times, but I believe there are already decent WPTs and implementations being worked on in all browsers.
    • There was one entry asking for <input type=number> styling. I found a stackoverflow post asking about styling the pseudo elements for the up and down buttons. I also noticed that chrome doesn't allow the user to type non-number characters into the number input, but this behavior doesn't exist in firefox or safari. We could write spec and tests for these behaviors, but they didn't get as much attention as the other compat issues.
    • There were two entries asking for standard padding or layout of form controls. I'm not sure exactly what is included in the spec for this category or exactly what people want, but I at least know that zcorpan did some recent work in this area:

    Note: When I say "entries" or "spreadsheet", I'm talking about the rows of this state of CSS feedback spreadsheet: https://docs.google.com/spreadsheets/d/1W1scqBvz6xRERPGOCm_29cc71U9CJiIlfeNNyys-27M/edit#gid=1399297592

  9. gsnedders commented on Nov 16, 2021

    @gsnedders
    Member

    <input type=range>

    • The pseudo elements aren't specced, aren't tested, and aren't in every browser. We could spec and test these pseudo elements.

    To be clear, I presume you’re suggesting we (browser vendors collectively) do this work in the appropriate group (be in the WHATWG HTML workstream, the W3C CSS WG, or W3C Open UI CG?

    On the whole, I think including anything which doesn’t already have a specification (in at least draft form) should probably be excluded, as otherwise we’re aiming to go from a blank page to an interoperably implemented specification within a single year, which seems very ambitious at best, and utterly unrealistic at worst.

  10. foolip commented on Nov 18, 2021

    @foolip
    Member

    This issue could probably be handled similarly to the suggestion in #4 (comment), including the well-spec'd and -tested things, and some more future-looking work happening, but not as part of a metric.

  11. bkardell commented on Nov 18, 2021

    @bkardell
    Contributor

    Given the confusion in the description and discussion here - just for ease of following, can I suggest that we open a new issue with the specifics and close this one... it's too easy to start at the top and immediately read it differently than I think several of us are talking about which does not include future looking work. I don't think editing the OP is better.

  12. josepharhar commented on Nov 18, 2021

    @josepharhar

    It seems like maybe I should be providing a list of existing WPTs instead of suggesting spec or test changes...?

  13. jgraham commented on Nov 18, 2021

    @jgraham
    Contributor

    Based on the confusion here, I think a new issue with a list of:

    • Areas (from existing specs) that comprise the proposal.
    • wpt tests covering those areas, plus any known missing cases or tests that need to be updated.

    will be needed to assess the proposal for Interop 2022.

    If there are additional areas where you think we aren't there yet, but where it might be possible to make enough progress on pre-implementation work (e.g. specs) in the next year to include in a future iteration of this scheme, open an additional issue for those parts, explaining the situation.

  14. jensimmons commented on Nov 18, 2021

    @jensimmons
    Contributor

    maybe I should be providing a list of existing WPTs instead of suggesting spec[…] changes?

    That’s right.

    This group does not have the ability to work on specifications. Web standards are created by working groups (and community groups) that have a rigorous process for ensuring the ideas generated by the group are dedicated to open source and can become part of the web. We cannot to put together an ad-hoc group to invent something new, without the legal contracts in place to protect the ownership of that invention.

    For example, in order to be a member of the CSS Working Group, you have to either be an Invited Expert who signs a stack of documents pledging the legal ownership of the work you do to the W3C, or you are an employee of a corporation, to which you've pledged ownership of the work you are doing to them, and they've formally joined the W3C and agreed that the work there done by their employees is owned by the W3C. It's a big deal, and involves a lot of lawyers.

    This group is not a working group for writing specifications. We are simply communicating about our separate efforts to implement specs that were created elsewhere, to share tests to see if we've done a good job with those implementations, and to make it easy to talk about these efforts with web developers.

    This group can collaborate on manual testing and writing up a report of findings (as suggested to better understand the current state of viewport measurements #4). Such findings could then be taken up by a Working Group as a to-do list for spec work. But there's no need for Interop 2022 to do so for the topic of form controls, because the Open UI Community Group was already formed to do exactly that. It does not make sense to duplicate efforts in two places.

    If you want to help make headway improving interop for form controls as part of Interop 2022, please refer to existing web standards (with links), and highlight areas where browsers do not match those standards (with tests). Opening a new issue with a much tighter scope is a good idea.

    The larger question of improving developer experience of styling form controls is especially tricky, because the web standards for form controls are vague and leave a lot up to interpretation by the browser. Form controls are not 100% interoperable because of the long history of them being considered part of the browser UI or operating system UI, not part of a web page. Each browser decides for themselves how they want their color picker or calendar widget to look & work. And that’s not going to change anytime soon. Such controls are designed to be easily understood by the end user, in the context of using their device.

    If you are interested in tackling the larger conundrum — figuring out how to make it possible for web developers to more easily create branded form controls consistent across browsers, despite the fact each browser will decide for itself how to make default controls — then I do suggest you get involved with Open UI. I know progress is slow, and perhaps you want things to happen much more quickly, but this is an incredibly complex space. It will take years to solve these needs, and Open UI is already making great progress.

  15. 17 remaining items

  16. josepharhar commented on Jan 20, 2022

    @josepharhar

    I just wrestled with selection-start-end.html for a while, and I'm happy to just let it keep timing out until webkit implements the corresponding behavior.

    I made a PR to separate week and month cases from selection-not-application.html: web-platform-tests/wpt#32479

  17. foolip commented on Jan 20, 2022

    @foolip
    Member

    The 6 form-submit* tests in /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/ are ERROR in Safari. There's a NoSuchFrameException raised in Python so probably there's some WebDriver issue underneath this.

    Oh, I didn't notice this, I thought they were just timeout. I now see that they say "MISSING". When you open the test on wpt.live, the page constantly reloads very fast in safari, maybe that's why there are other issues? As opposed to an actual infra problem?

    Taking form-submit-button-click.html as an example, the test is indeed MISSING, but above that you'll see "Harness status" and "ERROR". If you toggle "Show Details" you'll see this text squashed into a narrow box:

    ERROR message: Traceback (most recent call last):
      File "/Users/runner/work/1/s/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 406, in run_func
        self.result = True, self.func(self.protocol, self.url, self.timeout)
      File "/Users/runner/work/1/s/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 496, in do_testharness
        result = protocol.base.execute_script(
      File "/Users/runner/work/1/s/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 50, in execute_script
        return method(script)
      File "/Users/runner/work/1/s/tools/webdriver/webdriver/client.py", line 20, in inner
        return func(self, *args, **kwargs)
      File "/Users/runner/work/1/s/tools/webdriver/webdriver/client.py", line 791, in execute_async_script
        return self.send_session_command("POST", "execute/async", body)
      File "/Users/runner/work/1/s/tools/webdriver/webdriver/client.py", line 659, in send_session_command
        return self.send_command(method, url, body, timeout)
      File "/Users/runner/work/1/s/tools/webdriver/webdriver/client.py", line 623, in send_command
        raise err
    webdriver.error.NoSuchFrameException: no such frame (404): 
    

    Opening http://wpt.live/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html in STP 137 indeed just keeps reloading. I assume the problem is that the form is submitted and reloads the page. When wptrunner then tries to poll the page for test results (I think) the original page is gone.

    Is there any way for this test to fail before the navigation happens, or is the navigation happening the bug itself that the test is supposed to detect? If it is, then I think we'll have to live with the ERROR, that it's a surprising manifestation of a real bug.

    A bunch of the issues are about week/month input. web-platform-tests/wpt-metadata#2401 didn't remove all of those tests, but for what remains tests will have to be split. @josepharhar is this something you might look into? (I didn't check who wrote the tests.)

    Isn't selection-not-applicable.html the only one? I'll try splitting it into two tests.

    Thanks for splitting! There are also week/month subtests in these tests:

    • form-validation-validity-rangeOverflow.html
    • form-validation-validity-rangeUnderflow.html
    • form-validation-validity-valid.html
    • form-validation-validity-valueMissing.html
    • form-validation-willValidate.html
  18. josepharhar commented on Jan 21, 2022

    @josepharhar

    Is there any way for this test to fail before the navigation happens, or is the navigation happening the bug itself that the test is supposed to detect? If it is, then I think we'll have to live with the ERROR, that it's a surprising manifestation of a real bug.

    I tried querying window.history to see if the main page was navigated backwards to, which I think is the case where the test keeps restarting, but I couldn't quite figure it out.

    Thanks for splitting! There are also week/month subtests in these tests:

    web-platform-tests/wpt#32499

  19. jensimmons commented on Feb 17, 2022

    @jensimmons
    Contributor

    For reference, this is what we considered and decided:

    Technology considered Decision
    appearance Include
    accent-color Investigate
    <form rel> Include
    Events on disabled form controls Include
    input type=month + type=week Exclude
    Input elements bugs Include
    Form submission bugs Include
    Form validation bugs Include
  20. added
    focus-area-proposal
    and removed on Sep 16, 2022
  21. added this to the Interop 2022 milestone on Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfocus-area-proposal

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions