Re: Parent Combinator / Parent pseudo-class

Francois Remy wrote:
> 
> JScript / ECMAScript is very slow in comparaison of C++ or some other 
> native language.
> But I've done the test-case, any way. But it's only to give an idea of 
> that.


Many months ago when a similar topic came up (as often happens), I
theorized a selector like this.

#navigation ul+(li+a:focus) {...}


When the anchor element was in focus the style for the grandparent <ul>
element would be applied. The use case would be with this menu system or
any similar one.

http://css-class.com/articles/ursidae/bears5ddh-kbaccess.htm


The reason for this type of menu was for keyboard accessibility. When a
given anchor was in focus the grandparent <ul> would be rendered. This
need came crumbling down when I tested the menu in Opera 9.5. I have 
used both of these sets of selectors in this menu system for the 
accessibility functioning.

#navigation li li a:focus { /* The focus position for anchors */
	position : relative;
	left: 10000px;
	top:0;
	z-index:1;
}

and

#navigation li a:focus+ul {
	top: 0;
	left: 0;
	margin-left: 0;
	top: 2.35em;
}

This can be seen in action with Gecko and Webkit by tabbing (IE7- uses 
the active pseudo-class). In Opera 9.5 it does something that I have not 
even declared since it implements my theorized selector,

#navigation ul+(li+a:focus) {...}

and somehow mysteriously walks the chain backwards when using the SHIFT 
with the arrow keys. With Opera I can skip across top tree level list 
items with  anchors. I have now created a new demo just for Opera 9.5 
using just this CSS.

#navigation li a:focus+ul {
	top: 0;
	left: 0;
	margin-left: 0;
	top: 2.35em;
}

http://css-class.com/articles/ursidae/bears5ddh-kbaccess-opera.htm


The behavior with Opera 9.5 is the same as with the original demo. My
use case is already archived simply by focus without using any scripting
whatever apart from the API in Opera 9.5. One in which multiple
anchors of a particular DOM tree are in focus and a functioning that 
many scripts have tried to achieve but failed cross browser.

My question is what are the use cases for a parent pseudo-class or a
parent child combinator? I don't think it up to the implementors like 
Boriz to prove the performance hit. I as one author can not see a use case.

I would also suggest that before we venture down the road of parent 
pseudo-class or a parent child combinator, we first have a look at what 
the affects of *focus* is before we destroy this very powerful pseudo-class.



-- 
Alan http://css-class.com/

Nearly all men can stand adversity, but if you want to test a man's
character, give him power - Abraham Lincoln

Received on Thursday, 24 July 2008 12:19:59 UTC