Intent to Ship: CSS spelling and grammar features

216 views
Skip to first unread message

Stephen Chenney

unread,
Oct 30, 2023, 8:37:34 PM10/30/23
to blink-dev

The CSS Spelling and Grammar feature has been active behind experimental web platform features since M89! There are no open bugs. I would like to turn it on at last for M120.


Contact emails

sche...@chromium.orgdaza...@igalia.com

Explainer

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error
https://drafts.csswg.org/css-pseudo-4/#selectordef-grammar-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-spelling-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-grammar-error

Specification

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error

Summary

CSS highlight pseudo-elements for styling text that the UA has flagged as misspelled or grammatically incorrect, and line decorations exposing the UA’s default decorations for spelling and grammar errors. These features allow authors to choose more legible colors for the default spelling and grammar errors, highlight misspelled words with background colors or other decorations, and implement custom spell checking with almost-native appearance.




Blink component

Blink>CSS

Search tags

spelling-errorgrammar-errorhighlight pseudos

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

https://developer.mozilla.org/en-US/docs/Web/CSS/::spelling-error https://developer.mozilla.org/en-US/docs/Web/CSS/::grammar-error



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/470)

WebKit: In development (https://lists.webkit.org/pipermail/webkit-dev/2021-January/031660.html) WebKit has an old WIP patch from 2018 at https://webkit.org/b/175784 CSS Working group minutes imply Safari is planning an implementation: https://github.com/w3c/csswg-drafts/issues/7522

Web developers: Positive (https://dev.to/lampewebdev/css-pseudo-elements-classes-you-have-never-heard-of-30hl#the-grammarerror-and-spellingerror-pseudoelement)

Other signals: The spec for the text-decoration-line: spelling-error/grammar-error is https://drafts.csswg.org/css-text-decor-4/#text-decoration-line-property

Ergonomics

The new pseudo-elements depend on the new ‘text-decoration-line’ values for UA stylesheet support. They are highlight pseudos, which should pose minimal performance risk due to the limited set of CSS properties they allow: <https://drafts.csswg.org/css-pseudo-4/#highlight-styling>



Security

See, for example, https://github.com/w3c/csswg-drafts/issues/5731 The final spec says that only a minimal set of properties is allowed, and those cannot load resources or otherwise expose timing attacks that inform of a user's dictionary. The reported styles (to JS, to DevTools) do not depend on whether or not the style is currently applied, so do not reveal anything about the state of the styled text.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

Devtools support is the same as ::selection, ::target-text, and ::highlight(), which appear in the Styles panel. Properties inherited from ancestor spelling and grammar styles are also shown in the Styles panel.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

There are no platform specific aspects to the feature and it is useful on all platforms.



Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/css/css-pseudo?label=experimental&label=master&aligned Internal web tests have greater coverage because there is no way in WPT to activate a spelling or grammar error. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/paint/markers/ https://source.chromium.org/search?q=spelling-error&ss=chromium%2Fchromium%2Fsrc https://source.chromium.org/search?q=grammar-error&ss=chromium%2Fchromium%2Fsrc



Flag name on chrome://flags

experimental-web-platform-features

Finch feature name

CSSSpellingGrammarErrors

Non-finch justification

The feature is new and poses no performance or crash risk. It has been in experimental for a long time already and is extensively tested.



Requires code in //chrome?

False

Tracking bug

https://crbug.com/1163437

Sample links


https://bucket.daz.cat/work/igalia/0/1.html

Estimated milestones

DevTrial on desktop89
DevTrial on Android89


Anticipated spec changes

The spec has stabilized and there is only one outstanding issue seeking clarification that is not expected to result in a change in behavior.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4811776539492352

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/8UEcRJViPEU

This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Nov 1, 2023, 4:26:17 AM11/1/23
to Stephen Chenney, blink-dev
On Tue, Oct 31, 2023 at 1:37 AM Stephen Chenney <sche...@chromium.org> wrote:

The CSS Spelling and Grammar feature has been active behind experimental web platform features since M89! There are no open bugs. I would like to turn it on at last for M120.


Contact emails

sche...@chromium.orgdaza...@igalia.com

Explainer

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error
https://drafts.csswg.org/css-pseudo-4/#selectordef-grammar-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-spelling-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-grammar-error

Specification

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error

Summary

CSS highlight pseudo-elements for styling text that the UA has flagged as misspelled or grammatically incorrect, and line decorations exposing the UA’s default decorations for spelling and grammar errors. These features allow authors to choose more legible colors for the default spelling and grammar errors, highlight misspelled words with background colors or other decorations, and implement custom spell checking with almost-native appearance.




Blink component

Blink>CSS

Search tags

spelling-errorgrammar-errorhighlight pseudos

TAG review

None

Can you file a TAG review?
 


TAG review status

Not applicable

Risks


Can you file an official position? 

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGsbWzSv%2B6V8aKpEw6hF95onWjtnU0x%2BwODnmXU-ScuvJKmMbA%40mail.gmail.com.

Rune Lillesveen

unread,
Nov 1, 2023, 5:19:15 AM11/1/23
to Stephen Chenney, blink-dev
On Tue, Oct 31, 2023 at 1:37 AM Stephen Chenney <sche...@chromium.org> wrote:

The CSS Spelling and Grammar feature has been active behind experimental web platform features since M89! There are no open bugs. I would like to turn it on at last for M120.


Finch feature name

CSSSpellingGrammarErrors

Please remove base_feature: "None" from runtime_enabled_features.json5

--
Rune Lillesveen

Stephen Chenney

unread,
Nov 3, 2023, 12:22:20 PM11/3/23
to Yoav Weiss, blink-dev
On Wed, Nov 1, 2023 at 4:26 AM Yoav Weiss <yoav...@chromium.org> wrote:


On Tue, Oct 31, 2023 at 1:37 AM Stephen Chenney <sche...@chromium.org> wrote:

The CSS Spelling and Grammar feature has been active behind experimental web platform features since M89! There are no open bugs. I would like to turn it on at last for M120.


Contact emails

sche...@chromium.orgdaza...@igalia.com

Explainer

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error
https://drafts.csswg.org/css-pseudo-4/#selectordef-grammar-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-spelling-error
https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-grammar-error

Specification

https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-error

Summary

CSS highlight pseudo-elements for styling text that the UA has flagged as misspelled or grammatically incorrect, and line decorations exposing the UA’s default decorations for spelling and grammar errors. These features allow authors to choose more legible colors for the default spelling and grammar errors, highlight misspelled words with background colors or other decorations, and implement custom spell checking with almost-native appearance.




Blink component

Blink>CSS

Search tags

spelling-errorgrammar-errorhighlight pseudos

TAG review

None

Can you file a TAG review?

 
 


TAG review status

Not applicable

Risks


Can you file an official position?

Mike Taylor

unread,
Nov 6, 2023, 10:23:01 AM11/6/23
to Stephen Chenney, blink-dev

Hi Stephen,

Could you please request reviews for all the other review gates in your chromestatus entry?

thanks,
Mike

Stephen Chenney

unread,
Nov 6, 2023, 7:28:09 PM11/6/23
to Mike Taylor, blink-dev
Thanks Mike.

On Mon, Nov 6, 2023 at 10:22 AM Mike Taylor <mike...@chromium.org> wrote:

Hi Stephen,

Could you please request reviews for all the other review gates in your chromestatus entry?

Yes, done. Sorry I overlooked that. 

Mike Taylor

unread,
Nov 6, 2023, 7:58:57 PM11/6/23
to Stephen Chenney, blink-dev

Thanks - LGTM1

Daniel Bratell

unread,
Nov 8, 2023, 10:24:41 AM11/8/23
to Mike Taylor, Stephen Chenney, blink-dev

LGTM2

This one could use a ping in the mozilla standards position issue like that other one.

/Daniel

Yoav Weiss

unread,
Nov 8, 2023, 10:32:49 AM11/8/23
to Daniel Bratell, Mike Taylor, Stephen Chenney, blink-dev
Reply all
Reply to author
Forward
0 new messages