Re: UA's implementation of ::selection

On Saturday 2010-05-15 11:48 -0500, David Hyatt wrote:
> Selection would work much better if it was a property that was
> just part of the cascade and inherited by default, e.g.,
> 
> #mydiv {
>   selection: green;
> }
> 
> Or if we want to have more flexibility for extensibility, you
> could use some kind of identifier reference to point to an
> external rule:
> 
> @selection myselection {
>   background-color: green;
> }
> 
> #mydiv {
>   selection: myselection;
> }
> 
> Alternatively we could say ::selection is only queried against the
> root element, and then have the pseudo element itself take an
> argument identifier:
> 
> html::selection(myselection) {
>   background-color: green
> }|
> 
> #mydiv {
>   selection: myselection;
> }

One piece of flexibility this wouldn't give us, which I'd like to
have, is the ability to style multiple types of selections.  I'd
actually like to have a DOM API for creating named selections that
CSS can style, which could be used for implementing spellcheck,
find-in-page, etc. (both in the browser and in Web Apps).

I think the effect of what you're proposing is similar to the effect
of proposals (B) and (C) in
http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html ,
though.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Saturday, 15 May 2010 17:08:22 UTC