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

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