W3C home > Mailing lists > Public > www-style@w3.org > May 2010

(unknown charset) Re: UA's implementation of ::selection

From: (unknown charset) L. David Baron <dbaron@dbaron.org>
Date: Sat, 15 May 2010 10:07:50 -0700
To: (unknown charset) David Hyatt <hyatt@apple.com>
Cc: (unknown charset) Fran├žois REMY <fremycompany_pub@yahoo.fr>, Boris Zbarsky <bzbarsky@MIT.EDU>, www-style@w3.org
Message-ID: <20100515170750.GA16825@pickering.dbaron.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT