W3C home > Mailing lists > Public > www-style@w3.org > January 2015

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

From: Rune Lillesveen <rune@opera.com>
Date: Wed, 7 Jan 2015 13:57:38 +0100
Message-ID: <CANz6XvQEvT0ho9Q5SnF38LsDdrqUQQqeay+EgfqVuLQji2SewA@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "www-style@w3.org" <www-style@w3.org>
On Wed, Jan 7, 2015 at 1:31 AM, fantasai <fantasai.lists@inkedblade.net> wrote:
> Testcase:
>   data:text/html;charset=utf-8,<!DOCTYPE
> html>%0D%0A<style>%0D%0Ap%3A%3Aselection { background%3A
> rgba(0%2C255%2C0%2C0.5)%3B }%0D%0A<%2Fstyle>%0D%0A<p>Test me <em>and
> me<%2Fem>.<%2Fp>
>
> Given
>
>   p::selection { background: <color> }
>
> and
>
>   <p>Some <em>text</em>.</p>
>
> I would expect (from an authoring perspective) that, in the absence
> of rules to the contrary, <em> gets the same highlight styles as <p>.
> However, only Presto does this. Gecko, Trident, and Blink style the
> <em>'s highlight using the system default colors.
> (This probably relates to how Presto handles inheritance.)

In Presto, we implemented ::selection color/background-color as
synthesized properties that cascaded/inherited independently of
color/background-color. So,

p::selection { background-color: pink }

was represented internally as

p { selection-background-color: pink }

I assume selection-background-color had inherited:yes (as opposed to
background-color).

-- 
Rune Lillesveen
Received on Wednesday, 7 January 2015 12:58:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:56 UTC