Skip to content

[css-pseudo-4] Original color of highlight pseudo inside ::first-letter/::first-line #4625

Closed

Description

Image for: Description

Currently, if an author specifies a background color for selection highlights but does not specify a color, we use the color of the originating element.

This gets really interesting in the presence of ::first-letter or ::first-line... basically, highlighting the text changes its color, because it's now looking up the color of the paragraph element instead of the ::first-letter or ::first-line element.

Probably this behavior would be OK in the case of selections, but it's probably quite unexpected if we're handling ::spelling-error or ::grammar-error. It would mean that a spelling error in the first line would end up with the paragraph text color even if the rest of the line has its own color.

What do we want to do about this?

Issue found via @TalbotG’s proposed test active-selection-027 in web-platform-tests/wpt#20028 see testcase

Metadata

Image for: Metadata

Metadata

Image for: 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

    Image for: Issue actions