Re: Select a parrent node with s CSS selector?

I think a large part of the problem (having to re-check child-nodes) could
be avoided; if you apply the styles which check the parent of a node first,
then all the other styles, you would not have to check the child nodes
again. The only problem I see with this solution is that it changes the
order in which styles are applied; but if you are going to be working in the
opposite direction anyway, does it not make sense to change the flow also?

Given that it is fundamentally impossible to apply styles like the
following...

ul li:before {
content:"=> ";
}
ul li < :not(a[href]) {
content: "* ";
}

....without the proposed selector or applying class attributes to the
individual li elements that have a child without an href attribute
dynamically; I think it would be a big help, and believe it would be worth
the decrease in performance, if any, for use cases such as these. As I have
little experience with JavaScript, I can't say whether it would be faster to
create the class dynamically with JavaScript or not, or if it is even
possible in xhtml(I think document.write() doesn't work in documents served
as application/xhtml+xml, and I'm not sure of the alternatives). It may also
be possible in PHP, but I'm not sure that would be ideal on high traffic
servers; besides, PHP and JavaScript are out of scope in this discussion.
That leaves just CSS. Where does that leave us?

--
Please do not reply to this e-mail address. If you must reply directly, then
replace hotpop.com with gmail.com. Thank you. ^.^

Received on Wednesday, 28 January 2009 18:26:15 UTC