Re: Comment syntax

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 UTC