Re: [CSS21] DELIM? in core syntax

fantasai wrote:
> 
> Anne van Kesteren wrote:
>>
>> Does anyone recall why DELIM? is part of the declaration production in 
>> the core syntax? It was suggested this might be because of vendor 
>> prefixed properties, but that is already covered by the IDENT token.
> 
> Please check errata first when raising issues with the spec. :)
>   
> http://www.w3.org/Style/css2-updates/CR-CSS21-20070719-errata.html#s.4.1.1

While IDENT does fully cover vendor-prefixed properties, note that 
DELIM? also (incidentally) allowed the following "star property" 
parsing-bug hack for passing properties to IE7 and below

*width: 100px;

to be parsed and discarded as a malformed declaration by conforming 
implementations, rather than rendering the entire input untokenizable.

This hack is not uncommon. For example, YUI foundation uses it:

http://yui.yahooapis.com/2.5.1/build/reset-fonts-grids/reset-fonts-grids.css

IE6 and IE7 error-correct *property: value; to property: value;.

As best as I can tell, other popular web engines treat *property: value; 
as a malformed declaration  (Opera, Gecko, KHTML) or an unknown property 
(probably WebKit, Amaya) and continue to process the remaining 
declarations in the block.

A known exception is the (ex-Steady State) SACParser used by the Lobo 
browser, which skips the whole block where it occurs.

I'd suggest that for future implementations to be compatible with a not 
insignificant body of existing CSS and most existing user-agents, 
*property: value; should be treated as a malformed declaration 
tokenizable with the core syntax, rather than leaving handling undefined.

We don't need all of DELIM? for that. It could be more surgical:

declaration: '*'? property S* ':' S* value ';';

--
Benjamin Hawkes-Lewis

Received on Saturday, 5 April 2008 09:28:40 UTC