Re: Selectors, vendor prefixes (again...) and IE9 and Opera and WebKit

On Fri, 14 May 2010 12:41:38 +0200, Daniel Glazman  
<daniel.glazman@disruptive-innovations.com> wrote:

> Le 14/05/10 12:23, Philippe Wittenbergh a écrit :
>
>> I don't want to disappoint you, but WebKit also supports ::selection  
>> (no vendor prefix).
>
> Then WebKit should move back to ::-webkit-selection too.
>
> Weird feelings to see that something everyone agreed to remove from a
> spec because "at risk" is implemented w/o prefix and even w/o a common
> definition as if it were already a standard.
>
> I am requesting from Microsoft, Opera and the WebKit team an email to
> this list explaining *precisely* their specification of ::selection.

Here's a description of how our implementation works (not a  
specification), I'm not saying that this is a good solution:

1. Opera supports color and background-color for ::selection.

2. Opera implements ::selection as synthesized selection-color and  
selection-background-color properties. There are no pseudo elements as  
such in the internal dom.

3. As opposed to background-color, selection-background-color is  
inherited:yes.

4. selection-background-color and selection-color are implicitly  
inherited, but explicit inheritance will inherit from the actual element.  
That is, for the case below, "YYY" will have red color when selected:

   <style>
   span { color: red; }
   span::selection { color: inherit; background-color: pink; }
   </style>
   <div>XXX <span>YYY</span> ZZZ</div>

That is possibly weird. The same goes for currentColor which also refers  
to the color on the actual element and not the pseudo element.


For accessibility:

5. If only one of color/background-color computes to the default  
color/background-color for ::selection, the computed  
color/background-color for the actual element is used (for the property  
that computes to the default selection property value).

6. If the computed value for selection-color is transparent, the computed  
value for color will be used. This does not apply for rgba with alpha=0  
(?!).


-- 
Rune Lillesveen
Senior Core Developer
Opera Software ASA

Received on Tuesday, 18 May 2010 08:29:58 UTC