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

>> 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

Let's imagine that we have something like

input[type=text] < form  { background-color:orange; }

This means: any form element which has text input element among
its children.

To find such form element you need to scan once all N children 
of the form - this is a complexity of O(N).

And here is a definition of  "8.3.2 Indirect adjacent combinator"

"The elements represented by the two sequences share 
the same parent in the document tree and the element 
represented by the first sequence precedes (not necessarily 
immediately) the element represented by the second one"

To find another child of the parent you need to scan potentially all (max=N-1) 
siblings. This task has also O(N) complexity mathematicaly speaking. 

-----------------------------------------

>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?

By definition of GUI::focus it is the element which accepts keyboard
input. As you have only one keyboard (my optimistic guess) attached to your 
PC/Mac thus it can be the only one element which has the focus and any
given moment of time and system wide.

:focus does not work to be short. 

We need something like :current 
(((or reformulating of definition of :active which is used currently 
as :activated or :pressed))).


Andrew Fedoniouk.
http://terrainformatica.com

  
======= At 2005-01-27, 12:59:22 L. David Baron wrote: =======

>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 "" [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/ >
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.6 (GNU/Linux)
>
>iD4DBQFB+VYqA17gpBIYPJsRAjQkAJiZcrZsCekpPjGPBz3iebsgq5NbAJ0fFOc+
>elzilf+NlKQAamN1yeVcsw==
>=B6l7
>-----END PGP SIGNATURE-----
>

= = = = = = = = = = = = = = = = = = = =
			
Andrew Fedoniouk
news@terrainformatica.com
2005-01-27

Received on Friday, 28 January 2005 06:03:12 UTC