W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: Comment syntax

From: Greg Houston <gregory.houston@gmail.com>
Date: Mon, 27 Aug 2012 18:07:53 -0500
Message-ID: <CAOtq01AqYLhNi2Aa1Y5-Nbayh2+1XqMiBZ=G7YLAnX2c3ARqfg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "Kang-Hao (Kenny) Lu" <kanghaol@oupeng.com>, "Zachary “Gamer_Z.” Yaro" <zmyaro@gmail.com>, Liam R E Quin <liam@w3.org>, WWW Style <www-style@w3.org>, "Jens O. Meiert" <jens@meiert.com>
On Mon, Aug 27, 2012 at 5:27 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> This is the big thing I'm afraid of, and would like a compat study
> done for before I could support this.
>
> Right now, you can naively minify just by replacing all runs of
> whitespace with a single space.  (The only exception is if you use a \
> at the end of a line to create a multi-line string, but this is rare
> enough that I wouldn't be surprised if there were plenty of naive
> minifiers that didn't take this into account.)  If you use // comments
> on your source document, the minified document today will act
> identically (the next property will be ignored as invalid).  If we
> switched behavior, it would instead remove the entire rest of the
> stylesheet.
>
> This is, unfortunately, a problem with *existing* stylesheets, so we
> can't just rely on the "well, don't do that" defense.  I'd like a
> reasonable assurance that adding this wouldn't cause a significant
> number of sites to suddenly break due to this. ^_^
>
> ~TJ
>

In all these years of working with CSS I'm pretty sure I've never seen
// in a stylesheet. I think such a study would find that the chances
of // being used in a stylesheet AND the stylesheet being minified
will be incredibly few if not none.

Regarding causing trouble for developers, I think most developers
check their work; particularly those that minify their code. If it
looks good unminified and then suddenly does not once minified, it is
a short troubleshooting path to find that once minified a bunch of
rules were cut off right after a single line comment. Okay, I can't
use single line comments with this minifier until it is updated.
Received on Monday, 27 August 2012 23:08:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT