Re: [css3-selectors] ::selection

On Nov 26, 2007, at 2:34 PM, Allan Sandfeld Jensen wrote:

> On Monday 26 November 2007 19:05, Anne van Kesteren wrote:
>> The Selectors Level 3 specification should probably go into more  
>> detail on
>> how boxes for ::selection are to be generated so that it's clear  
>> how it
>> interacts with other styles, etc. That would also help if someone  
>> decides
>> to support background-image for ::selection.
>> WebKit and Gecko support it in such a way that it doesn't affect the
>> selection color of child elements. So if you have:
>>    p::selection { background:lime }
>>    <p>FOO<span>BAR</span>BAZ</p>
>> and someone selects "FOOBARBAZ" "BAR" will have the default selection
>> color. I don't really care about how this is going to be done, but  
>> I'd
>> like it to be defined.
>> (It would probably be good if someone tackled ::first-letter and
>> ::first-line too which have similar issues.)
> I am surprised WebKit doesn't support that case, since KHTML does  
> and I think
> we implemented ::selection after WebKit example.

::selection is not "inherited" in WebKit.  This was how I implemented  
it, since it was never really clear to me whether or not ::selection  
was supposed to be "inherited."  I am putting the word "inherited" in  
quotes because really any inheritance model would have to be more  
like text-decoration (with the concept of using the nearest enclosing  
ancestor that specified a ::selection as the one  that should draw).

It still isn't really clear to me how ::selection should be defined,  
especially with WebKit's selection model of OS X-style gap-filling to  
the edge of lines and between blocks (it's not clear who the "owner"  
of those gaps is as far as ::selection is concerned).


Received on Monday, 26 November 2007 20:52:03 UTC