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.
https://developer.mozilla.org/en-US/docs/Web/CSS/::spelling-error https://developer.mozilla.org/en-US/docs/Web/CSS/::grammar-error
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>
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.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
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.
There are no platform specific aspects to the feature and it is useful on all platforms.
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
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.
DevTrial on desktop | 89 |
DevTrial on Android | 89 |
The spec has stabilized and there is only one outstanding issue seeking clarification that is not expected to result in a change in behavior.
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.org, daza...@igalia.comExplainer
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-errorSpecification
https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-errorSummary
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>CSSSearch tags
spelling-error, grammar-error, highlight pseudosTAG review
None
TAG review status
Not applicableRisks
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
--
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.
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
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.org, daza...@igalia.comExplainer
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-errorSpecification
https://drafts.csswg.org/css-pseudo-4/#selectordef-spelling-errorSummary
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>CSSSearch tags
spelling-error, grammar-error, highlight pseudosTAG review
NoneCan you file a TAG review?
TAG review status
Not applicableRisks
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/7522Can you file an official position?
Hi Stephen,
Could you please request reviews for all the other review gates in your chromestatus entry?
thanks,
Mike
Hi Stephen,
Could you please request reviews for all the other review gates in your chromestatus entry?
Thanks - LGTM1
LGTM2
This one could use a ping in the mozilla standards position issue
like that other one.
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fc13402f-f90d-4b0f-923b-695470717369%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/44bcfbd7-35cf-4ce4-970d-1754f4cd2e05%40gmail.com.