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

Justin Rogers wrote:

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

Yes you are correct but I really miss the point why there is such a pseudo class as :lang in the first place since it's does nothing once the style sheet is disabled. I believe that [lang="val"] is much more suited and the semantic meaning is always in the source (accessible).

[lang="fr"] {..}

<span lang="fr"> ... </span>

[lang|="fr"] {..}

<html lang="fr"> ... </html>

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

I would go for option two but this should be left for CSS4. The selector module has been in last call status for 3 years now. I believe it is almost refined enough to be shipped. I would like the "how to walk the chain" considered with other recent proposals like CSS constants. Can this be left for CSS4?

I do understand from a implementers perspective that such a selector is ridiculous.

ul>li>a:focus<li<ul { /* implementers nightmare */ }

This I believe could only be approached like this.


since it would possibly avoid any circular references (I'm not proposing this) but I do use this case since it's the state of the grandchild pseudo class (:focus) that styles the grandparent. That is the complete opposite to having a grandparent's HTML attribute style a grandchild. That's why I say that Andrew's proposal seems more the way that namespace selectors operate.

I have given two test cases showing that I can style a dir attribute by attribute selectors. If this type of selecting isn't sufficient enough then I would not like to imagine the multiple nestling of dir attributes in the source.

Also what happens when DOM created elements are generated in the source? An attribute selector is quite adequate in handling such cases. Would the same apply with :rtl or :ltr?

BTW, IE8 is a lot better, good work. Just a little more work to go.


Received on Monday, 17 March 2008 16:51:36 UTC