Skip to content

[css-pseudo] Highlight pseudo-el cascade rules doesn't match reality #374

@tabatkins

Description

@tabatkins

All browsers (now?) agree in nearly all details for how to render ::selection (and presumably will apply the same to the other highlight pseudo-els). However, the spec text drastically conflicts with this.

In particular, IE/FF/Blink all:

  • have some default UA styles for the highlight

  • each element's segment of the highlight is styled according to that element's ::selection rules

  • if a given element doesn't style the highlight at all, it uses the UA rules (instead of inheriting them from the originating element or using initial values)

    (Definition of "doesn't style at all" is slightly inconsistent - all agree that an empty style rule for the element doesn't style it, and all agree that a highlight-valid property in the style rule does style it. IE assumes that a property that doesn't apply to the highlight (such as display) doesn't count as styling, while FF and Blink treat it as styled.)

There was some discussion/resolution about this in the past, of which the current spec text is apparently the result, but iirc browsers previously didn't agree as strongly so we believed there was some room to dictate a maximally "useful" result. However, they currently strongly agree (with only very minor differences) on what I described above. We should change the spec to match current browser behavior, which, while not ideal, is serviceable, simple, and mostly consistent with how other pseudo-elements work.

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