Re: [css3-syntax] First draft of parser section completed

(12/06/13 19:24), Simon Sapin wrote:
> Le 13/06/2012 12:29, Kang-Hao (Kenny) Lu a écrit :
>> 1. If a tinycss UA doesn't update it's tinycss and things like '$foo:
>> bar' becomes prevalent, would these input break the tinycss UA?
>>
>> Given that tinycss doesn't raise a exception to the UA, the answer here
>> is normally "No", but if this tinycss UA serializes CSS (say, a
>> minimizer) than the answer would be "Yes" (because '$foo: bar' is
>> dropped). I am curious about other tools that might answer "Yes" here.
> 
> No, nothing would break in this scenario. Older UAs with an older parser
> will continue to see this input as invalid and drop declarations or rules.

Why not? I think the comparison here is that serializing 'var-foo: bar'
won't be broken while serializing '$foo: bar' will be, and the amount of
'$foo: bar' out there were ignorable.

> Officially tinycss only has a serializer for selectors and property
> values. These are serialized exactly as parsed (the original strings are
> preserved), so the serialization should not change even if the token
> objects do.

Which means that it handles 'var-foo' fine, right?

>> I don't know what lessons can be learned here but my general opinion to
>> css3-syntax "3.6. Tree Construction" and tinycss is that they should not
>> drop anything when a "Parse Error" is encountered.
> 
> Ignored stuff is not needed for an UA with cascade and all that. Keeping
> it would help for minifiers. See the discussion at
> https://github.com/SimonSapin/tinycss/issues/1#issuecomment-6298097
> 
> This is a tinycss issue and has nothing to do with css3-syntax.

I think the goal here is to make sure that css3-syntax doesn't trip
ourselves 10 years later like CSS 2.1 Core Grammar is tripping us now.
It's just a fact that folks on this list mention tools as reasons why we
should not break the Core Grammar and adopt the '$foo: bar' proposal.
While I don't like '$foo: bar' either, using the incomplete CSS 2.1 Core
Grammar as a reason is just pretty lame.

(12/06/13 19:24), Simon Sapin wrote:
> Le 13/06/2012 12:29, Kang-Hao (Kenny) Lu a écrit :
>> Given that tinycss has its design based on the CSS 2.1 Core Grammar,
>> I do think the job of css3-syntax is not only for browser
>> convergence but also for tool designer who wants to get an idea
>> about how a CSS parser is implemented. In particular, we should keep
>> in mind that "3.6. Tree Construction" isn't compatible with
>> css-hierarchy and if I were to build a parser like tinycss that
>> guarantees forwards-compatibility, I could't really just copy "3.6.
>> Tree Construction".
>
> If css3-syntax is not compatible with css-hierarchy, it is a spec
> issue that should be resolved in spec. It has nothing to do with
> tinycss or other implementations.

The reason I am saying this is that: The "3.6. Tree Construction" as it
is is closer to tinycss than, for example, Gecko because Gecko doesn't,
say, preserve unrecognized declarations. So, if tinycss has a way to
guarantee a good amount of future-compatibility, say, to include
css-heirarchy at least, it can be used as potential input to "3.6. Tree
Construction".


Cheers,
Kenny

Received on Wednesday, 13 June 2012 12:35:42 UTC