Re: [css-pseudo] element::selection and descendants

On Mon, Jan 12, 2015 at 8:48 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> Ah, that's a fascinating way to handle it, and seems like it would be
> pretty effective.  It cuts out a lot of the confusion about how things
> inherit, I think.

For reference (not as a proposal), there is a description of the
Presto implementation in more detail in an earlier mail [1]. A lot of
discussion about ::selection in the same thread. It describes some
weird stuff about currentColor and inheritance which I don't remember
why we had.

> It does involve some weirdness, like the fact that in the rule
> "p::selection, div { background-color: pink; }", this sets the
> 'background-color' for div, but the 'selection-background-color' for
> p::selection.  But maybe that's not too horrible.

Has it been discussed whether selection styling should be done through
a pseudo element at all?

Why couldn't it just be separate properties instead, also from the
author's point of view?

It's probably fine if you support color and background-color only, but
you'd get a lot of duplication when more properties are supported, I
guess.

[1] http://lists.w3.org/Archives/Public/www-style/2010May/0366.html

-- 
Rune Lillesveen

Received on Tuesday, 13 January 2015 13:14:19 UTC