Re: [CSS2.1] Parsing Selectors with Brackets

On Wed, 26 Dec 2007 23:15:44 +0100, Christof Hoeke <>  
>> I believe there is far too much in the specification that is just text  
>> and not enough describing the grammar...
> I suspect that is really where all the browser incompatibilities come  
> from, does it not?

No, the most pertinent issues are related to differences in rendering, not  
differences in parsing a CSS file. Layout is one of the most complicated  
parts of the browser and therefore getting interoperability between N  
browsers is difficult.

>>  Error recovery in the parser can be extremely easy if we consider  
>> simple and concise rules in the error recovery section. There is no  
>> reason to be vague other than to leave options for implementation  
>> interpretation or to allow current implementations to be correct even  
>> if they don't follow the spec strictly.
> Just a thought, but is CSS really so different to other languages and  
> specs (like e.g. XML) that it is so difficult to actually state these  
> precise rules (no offense)?

XML only maps a certain set of byte streams to an XML document. CSS maps  
every byte stream to a CSS document. On top of that comes that the CSS  
grammar is more complex and evolves over time. If we add support for a new  
CSS unit, such as 'rem' for instance, the tokenizer needs to be modified.  
Having said that, I think we can do better, but the focus of the CSS WG  
has primarily been differences in rendering and if nobody is taking up the  
work, it is unlikely to get done. (David Baron has been looking into (or  
suggesting at least) a grammar which includes handling of errors for a  
CSS3 Module.)

Anne van Kesteren

Received on Thursday, 27 December 2007 09:55:19 UTC