W3C home > Mailing lists > Public > www-style@w3.org > March 2008

RE: [CSS3] ltr and rtl pseudo-class proposal

From: Justin Rogers <justrog@microsoft.com>
Date: Mon, 17 Mar 2008 08:04:01 -0700
To: Alan Gresley <alan@css-class.com>, Andrew Fedoniouk <news@terrainformatica.com>
CC: "www-style@w3.org" <www-style@w3.org>, "robert@ocallahan.org" <robert@ocallahan.org>
Message-ID: <00BD06E707F60B4F9D6A3E75C712209D4CEA00B853@NA-EXMSG-C104.redmond.corp.microsoft.com>

Alan, you should review :lang() as a pseudo-class. It is not much different from :rtl/:ltr in terms of functionality.

>>>
but rather an attribute belonging to the source. How can this be described as a pseudo-class? You are talking about a parent or ancestor element with a particular attribute. Almost no selector like that exist in CSS at this current time.
<<<

My warning as an implementer would be it is not easy to process a large number of "inherited" properties in the selector engine. The rules for walking your parent chain (as part of your selector and not part of resolving the rest of your complex rule) can be complex and costly, falling back (in the case of lang) to HTTP headers and META tag values as well meaning more places to search for values. Without appropriate caches performance is bad. The more caches you add for features like this the less useful the caches become.

I think where the conversation is going here is:
1) Are we done with just these two additions for inherited properties? (:ltr/:rtl)
2) Are more coming down the pipeline?

If 1 then just define the behavior in a module and let it go. If 2 then we need a special attribute selector which is capable of walking the parent chain with notes in the specification that performance of such a selector might be less than optimal.

Justin Rogers [MSFT]
Received on Monday, 17 March 2008 15:04:49 GMT

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