Skip to content

[css-pseudo] Can ::spelling-error and ::grammar-error occur anywhere? #623

@frivoal

Description

@frivoal

https://drafts.csswg.org/css-pseudo/#highlight-selectors

Generally, spelling/grammar mistake markers are only expected in editable content.

The behavior exhibited by chrome and safari (but not Firefox and Edge) in the following example feels like a bug to me. Something is editable and gets focused (and editted), so spelling mistakes get highlighted. Then when it is made non editable. I would expect the markers to go away, but they do not.

http://output.jsbin.com/caqusop

While I think that's wrong, there's nothing in the css-pseudo spec (or any other spec I am aware of) to support that opinion. Should there be?

Should we say that the ::spelling-error and ::grammar-error pseudos can only occur as children of editable elements, and the browsers must not highlight such things in non editable content?

Or should we instead say that browser can make them match anywhere, but mandate (or merely recommend?) a UA stylesheet that by default only highlights them when they are in editable content?

:read-write ::spelling-error {
  text-decoration: red dotted underline;
}
:read-write ::grammar-error {
  text-decoration: green dotted underline;
}

Or should we just leave it up to the UA, and report these against browsers separately not as a case of standards violation but as a case of bad UX?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions