Skip to content

New attribute to control UA-provided writing assistance #9065

Closed

Description

@bmathwig

The current specification allows for the autocomplete attribute to exist on elements of type <input>, <textarea>, and <select>. With the rise in popularity of rich text controls using contenteditable, we should consider allowing elements who have contenteditable=true to utilize the autocomplete attribute. While not a common scenario within the scope of form fields, there are applications for text hinting and autofill within contenteditable elements.

One existing example of a form field being replaced by contenteditable exists in the example section of its specification.

Activity

  1. added
    addition/proposal
    needs implementer interest
    topic: forms
    on Mar 23, 2023
  2. annevk commented on Mar 23, 2023

    @annevk
    Member

    cc @whatwg/forms

  3. bmathwig commented on Mar 23, 2023

    @bmathwig
    Author

    Microsoft is interested in implementing this in Edge and Chromium :)

  4. zcorpan commented on Mar 27, 2023

    @zcorpan
    Member
  5. zcorpan commented on Mar 28, 2023

    @zcorpan
    Member

    Autocomplete works differently on different form controls, see https://html.spec.whatwg.org/#inappropriate-for-the-control

    Editing hosts don't have a way to signal what kind of input is accepted (e.g. single line vs multiline). Which "groups" should editing hosts be part of? All of them?

  6. removed
    needs implementer interest
    on Mar 28, 2023
  7. annevk commented on Mar 28, 2023

    @annevk
    Member

    WebKit is also interested in this.

    (For maximum clarity, Chromium and Edge count as a single implementer for WHATWG purposes.)

  8. added
    needs concrete proposal
    on Mar 28, 2023
  9. bmathwig commented on Mar 28, 2023

    @bmathwig
    Author

    Autocomplete works differently on different form controls, see https://html.spec.whatwg.org/#inappropriate-for-the-control

    Editing hosts don't have a way to signal what kind of input is accepted (e.g. single line vs multiline). Which "groups" should editing hosts be part of? All of them?

    I think contenteditable will always be a Text-Multiline host. I can't think of any cases where the other groups would apply. We also may want to expand the Field Name to include additional types of content in the future.

  10. bmathwig commented on Jul 12, 2023

    @bmathwig
    Author

    Here is our proposal to adjust the wording of 4.10.18.7.1 Autofill to allow for editing host elements to be eligible for autofill and the autocomplete attribute.

    https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/AutocompleteContentEditable/explainer.md

  11. sanketj commented on Jul 20, 2023

    @sanketj
    Member

    @annevk, @domenic, @mfreed7, @zcorpan: Curious to hear your thoughts on the proposal Ben shared above.

  12. mfreed7 commented on Aug 3, 2023

    @mfreed7
    Contributor

    @annevk, @domenic, @mfreed7, @zcorpan: Curious to hear your thoughts on the proposal Ben shared above.

    Seems reasonable, but I'm not an autocomplete expert. I do worry about the leakage of sensitive information, if autocomplete can more easily be tricked into filling general <div> with PII. But as mentioned, that risk already exists with <input> so I'm not sure why this would be worse. @battre would have better input from Chrome's side.

  13. annevk commented on Aug 25, 2023

    @annevk
    Member

    What are the considerations around events? contenteditable involves quite a bit more events, do any need to be simulated when autofilling? The solution needs to address that somehow.

    cc @johanneswilm

  14. 32 remaining items

  15. added
    agenda+
    on Jan 8, 2024
  16. sanketj commented on Jan 11, 2024

    @sanketj
    Member

    Thanks @mfreed7, @marcoscaceres, @domenic for the feedback on #10018. Calling out a few points about the new attribute that came out of that, which might be worth discussing in more detail during the next WHATNOT meeting.

    • true (enabled) by default on all elements
    • inheritance works across shadow boundaries
    • string type for getter/setter
  17. sanketj commented on Jan 11, 2024

    @sanketj
    Member

    Per discussion on the above points during today's WHATNOT call, the only suggested change to #10018 was to align the inheritance behavior with spellcheck, and address inheritance across shadow boundaries for both attributes (and possibly others) separately. I've updated that PR accordingly. Please let me know if there's additional feedback on that one.

  18. removed
    agenda+
    on Jan 11, 2024
  19. zcorpan commented on Feb 2, 2024

    @zcorpan
    Member

    This should define interaction with field-sizing CSS property, if writing suggestions can appear inline and contain potentially privacy-sensitive information. See #9903 (comment)

  20. annevk commented on Feb 9, 2024

    @annevk
    Member

    @sanketj Why does it work for type=email but not type=telephone?

  21. dandclark commented on Feb 9, 2024

    @dandclark
    Contributor

    @sanketj Why does it work for type=email but not type=telephone?

    I guess the principle of the current list is "types that expect character input that's not numbers-only, excepting password".

  22. dandclark commented on Feb 9, 2024

    @dandclark
    Contributor

    This should define interaction with field-sizing CSS property, if writing suggestions can appear inline and contain potentially privacy-sensitive information. See #9903 (comment)

    @zcorpan

    The scope of this new attribute just grants authors the ability to turn off UAs' writing suggestions capabilities. An attempt hasn't been made to standardize the details of those capabilities, and they could vary widely. So while I agree that the interaction of field-sizing with UA writing suggestions and autofill needs to be worked out, it's not really in the purview of the writingsuggestions toggle attribute defined here.

    Maybe worth a new issue?

  23. annevk commented on Feb 10, 2024

    @annevk
    Member

    @dandclark it seems weird to me to include email but not telephone. If this feature can suggest email addresses, surely it can suggest telephone numbers as well.

  24. dandclark commented on Feb 14, 2024

    @dandclark
    Contributor

    @annevk
    @sanketj pointed out to me that the list of supported elements was originally taken from element types of the spellcheck attribute under User agents must only consider the following pieces of text as checkable for the purposes of this feature.

    I think that list is a reasonable starting point, and given the current design in #10018 it could be expanded without breaking backwards compatibility, but I don't have any particular objection to adding "telephone".

  25. added
    agenda+
    on Feb 22, 2024
  26. added a commit that references this issue on Mar 13, 2024
    a187fec
  27. added a commit that references this issue on Mar 10, 2025
    e2d7324
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

    addition/proposalagenda+needs concrete proposaltopic: forms

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions