W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: [css3-syntax] Consumation of comment tokens during tree construction

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 27 Jan 2013 23:54:14 -0800
Message-ID: <CAAWBYDCCNd5VbSstioCa=Z_nAZjUCn6Tt=Kp7QtYLoFH736pQg@mail.gmail.com>
To: Peter Moulder <peter.moulder@monash.edu>, www-style list <www-style@w3.org>
On Wed, Jan 23, 2013 at 9:07 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Wed, Jan 23, 2013 at 4:03 AM, Peter Moulder <peter.moulder@monash.edu> wrote:
>> On Wed, Jan 23, 2013 at 09:45:40AM +0100, Simon Sapin wrote:
>>> As much as I dislike having to do this, shouldn’t some comment
>>> tokens be preserved where the tree has "lists of primitives" so it
>>> can be serialized back correctly? Namely:
>>>
>>> * at-rule prelude
>>> * selector
>>> * declaration value
>>>
>>> Example of pathological input:
>>> border: 1px/**/solid
>>
>> One possible answer is that it's the job of the serializer to insert a
>> comment token if asked to serialize the sequence DIMENSION IDENT, whether
>> or not we strip out comment tokens.
>
> I'm thinking of going this way.  The list of preserved tokens is small
> and should rarely grow, so it's easy to plot out the handful of
> problematic cases that need a comment inserted between them if there's
> no whitespace.  I think it's just:
>
> hash or at-rule followed by number, ident, dimension, or a function.
> number, ident, and dimension in any combination.
> number, ident, or dimension followed by a function.
> ident followed by (.

Done.  I might still be missing some of the delim cases, and I'm going
to try and trim down some of the existing ones.

~TJ
Received on Monday, 28 January 2013 07:55:01 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT