Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WritingSuggestions] Update explainer to propose new attribute instead of extending autocomplete. #726

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 0 additions & 101 deletions AutocompleteContentEditable/explainer.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ we move them into the [Alumni section](#alumni-) below.
| [Pen Events](PenEvents/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Pen%20Events"> ![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Pen%20Events?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=BoCupp-Microsoft%2C+gked&labels=Pen+Events&template=pen-events.md&title=%5BPenEvents%5D+%3CTITLE+HERE%3E) | Editing |
| [Pen Action](PenAction/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Pen%20Action"> ![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Pen%20Action?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=BoCupp-Microsoft%2C+gked&labels=Pen+Action&template=pen-action.md&title=%5Bpen-action%5D+%3CTITLE+HERE%3E) | Editing |
| [Delayed Clipboard Rendering](DelayedClipboard/DelayedClipboardRenderingExplainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Delayed%20Clipboard%20Rendering"> ![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Delayed%20Clipboard%20Rendering?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=anaskim&labels=Delayed+Clipboard+Rendering&template=delayed-clipboard-rendering.md&title=%5BDelayed+Clipboard+Rendering%5D+%3CTITLE+HERE%3E) | Editing |
| [Autocomplete Supports Edit Host Elements](AutocompleteContentEditable/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/AutocompleteEditHost">![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/AutocompleteEditHost?label=issues)</a> | [New Issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=bmathwig&labels=AutocompleteEditHost&template=autocomplete-edit-host.md&title=%5BAutocompleteEditHost%5D+Issue) | Editing |
| [WritingSuggestions attribute](WritingSuggestions/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/WritingSuggestions">![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/WritingSuggestions?label=issues)</a> | [New Issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=sajos&labels=WritingSuggestions&template=WritingSuggestions-edit-host.md&title=%5BWritingSuggestions%5D+Issue) | HTML/Editing |
| [Source Hashes in Stack Traces](DevTools/SourceHash/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Source+hash"> ![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Source+hash?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=robpaveza&labels=Source+hash&title=%5BSource+Hashes%5D+%3CTITLE+HERE%3E) | JavaScript |
| [PerformanceNavigationTiming User Agent Launch](PerformanceNavigationTiming%20for%20User%20Agent%20Launch/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/Perf%20timing%20during%20browser%20start">![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/Perf%20timing%20during%20browser%20start?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=dylank%2C+hemingzh&labels=Perf+timing+during+browser+start&template=performance-timing-during-browser-start.md&title=%5BPerf+Timing+during+launch%5D+%3CTITLE+HERE%3E) | Performance |
| [PerformanceNavigationTiming Protocol Launch](PerformanceNavigationTiming%20changes%20for%20protocol%20launch/explainer.md) | <a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/labels/PerformanceNavigationTiming%20for%20Protocol%20Launch">![GitHub issues by-label](https://img.shields.io/github/issues/MicrosoftEdge/MSEdgeExplainers/PerformanceNavigationTiming%20for%20Protocol%20Launch?label=issues)</a> | [New issue...](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/new?assignees=atulkatti&labels=PerformanceNavigationTiming+for+Protocol+Launch&template=performancenavigationtiming-protocol-launch-timing-information.md&title=) | Performance |
Expand Down
56 changes: 56 additions & 0 deletions WritingSuggestions/explainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Writingsuggestions attribute to control UA-provided writing assistance

Consider all sections required unless otherwise noted.

Authors: [Sanket Joshi](https://github.com/sanketj)
Previous authors: [Ben Mathwig](https://github.com/bmathwig)

## Status of this Document

This document is a starting point for engaging the community and standards bodies in developing collaborative solutions fit for standardization. As the solutions to problems described in this document progress along the standards-track, we will retain this document as an archive and use this section to keep the community up-to-date with the most current standards venue and content location of future work and discussions.

* This document status: **Active**
* Expected venue: [WHATWG](https://whatwg.org/)
* Current version: [Link](#)

## Introduction
UAs are starting to provide writing suggestions to users as they type on various editable fields across the web (see the [use case](#use-case) section below). While this is
generally useful for users, there are cases when developers may want to turn off UA-provided writing assistance, such as extensions or sites that wish to provide similar functionality on their own. To that end, this explainer proposes a solution that would allow developers to turn on/off UA-provided writing assistance.

## Use Case
A developer may use this control to take advantage of browser-provided writing assistance features like text prediction on `contenteditable` elements.

### Facebook.com: Writing a post
![Writing a post on facebook.com](facebook-post.png)

### Medium.com: Drafting an article
![Drafting an article on medium.com](medium-draft.png)

### Youtube.com: Commenting on a video
![Commenting on a video on youtube.com](youtube-video-comment.png)

This control could also be used to enable additional browser-provided writing suggestions in the future. See a hypothetical example below.

![Contact details suggestions example](contact-details-suggestions-example.png)

A developer may also use this control to turn off browser-provided writing suggestions if they want to provide their own writing assistance tools.

## Out of Scope
1. Defining expected user agent behavior or user interface design.
2. Styling of UA-provided writing suggestions.

## Proposed Solution
We propose the addition of a new attribute called `writingsuggestions` with values `on`/`off` that would allow developers to turn on/off browser-provided writing suggestions. This attribute will have a default state per element, as established by the UA. The attribute's state for an element can also be inherited from ancestor elements, thereby allowing developers to control this functionality at a per-element or per-document/sub-document scale.

## Privacy and Security Considerations
UAs may choose to provide users with personal settings to turn on/off writing assitance, similar to settings that are available for spellchecking. Similar to the `spellcheck` attribute, UAs must keep the values of the `writingsuggestions` attribute independent of the user's settings. Letting the user's setting influence the value of the attribute may introduce a new fingerprinting surface.

## Alternative Solutions
### Extending the `autocomplete` attribute to [editing hosts](https://html.spec.whatwg.org/multipage/interaction.html#editing-host)
The `autocomplete` attribute is primarily designed for form fill scenarios and supports a [large number of values](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute), many of which are not applicable to writing scenarios. Reasoning about how each of these values should behave on editing hosts would be complex for browser and web developers alike.

### Spellcheck Attribute
The `spellcheck` attribute is specifically designed to control the browser's spellcheck and grammar check capabilities, therefore it is not semantically appropriate for controling writing suggestions.

### Text Prediction Attribute
A `textprediction` attribute could be introduced that takes `on/off` values, allowing developers to control whether the browser's text prediction is available on a text control. Such an attribute would be specific to text prediction and would not be future proof against additional types of writing suggestions that browsers may introduce in the future.