W3C home > Mailing lists > Public > www-style@w3.org > January 2005

Re: [CSS3] pseudo class for "current element"

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 27 Jan 2005 12:59:22 -0800
To: www-style@w3.org
Message-ID: <20050127205922.GA5504@ridley.dbaron.org>
On Tuesday 2005-01-25 17:26 -0800, Andrew Fedoniouk wrote:
> L. David Baron wrote:
> >On Tuesday 2005-01-25 15:59 -0800, Andrew Fedoniouk wrote:
> >>For example: 
> >><select> element (list box) is "focusable" element but its <options> are 
> >>not. Being in focus, <select> has one current item (option) which is 
> >>visually distinct from others. 

> >The selected option should probably match the :checked pseudo-class.  A
> >SELECT is logically pretty much the same thing as a radio group.  

> As discussed month ago in this list :checked corresponds to selected 
> state of an <option>
> E.g. for <SELECT multiple> it matches any <option selected>.
> In short, neither :selection  nor  :checked  cannot be used for :current 
> item.

I'm not sure what the various specifications that describe :focus say
about whether it can match multiple elements at once, but since focus is
often described as a hierarchy, it seems like perhaps :focus should be
able to match multiple elements simultaneously?  Does that solve your
problem?

Then again, I'm not sure what the behavior that you're describing is.

> >>I mean it is lack of "containment" selectors like:
> >>
> >>P < DIV  - any <div> which contains <p> 
> >>* < DIV  - non empty div 
> >>OPTION:focus < SELECT  - select having option in focus. 
> >>   
> >>
> >
> >These have been discussed extensively on this list and one proposal was
> >in early drafts of css3-selectors.   Search for ":subject" (the one that
> >was in css3-selectors), ":has", and ":matches".
> >
> >The problem is that they're all difficult to implement effeciently in
> >the processing model used for CSS selectors (used via a function that
> >maps (element, selector) -> boolean).
> > 
> >
> Proposed "8.3.2 Indirect adjacent combinator" [1] has the same 
> computational complexity
> as ":has" or "<" - O(n). So, if we will allow to use first why not to 
> allow use second?

It's most definitely not the same computational complexity.  See
http://lists.w3.org/Archives/Public/www-style/2004Mar/0192.html

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >

Received on Thursday, 27 January 2005 21:00:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:35 GMT