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

Re: Select a parrent node with s CSS selector?

From: Benjamin Blanco <benjo316@hotpop.com>
Date: Wed, 28 Jan 2009 12:10:06 -0600
Message-ID: <421e3c790901281010n442dbbcdod307b5fca7373510@mail.gmail.com>
To: www-style@w3.org
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

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:23 UTC