Re: Comment syntax

Double slashes in unquoted urls would trip-up regex based minification.

@import url( http://dont.com/even/look.css )
@import url( sccidental//but-valid/double/slash-path.css )

Drupal (one example) currently uses regex minification for its CSS files.



On 27 August 2012 12:44, Kang-Hao (Kenny) Lu <kanghaol@oupeng.com> wrote:

> (12/08/26 11:10), Zachary “Gamer_Z.” Yaro wrote:
> > I still do not quite see why the existence of minifiers matters here at
> > all.
>
> Well, it means that minimizers have to support //-style comments or it
> will turn out disastrous once Web Developers start to use these without
> updating their CSS minimizer. Also, it seems that CSS minimizers don't
> get update too frequently either (for example, YUI compressor[1] was
> last updated a year ago).
>
> Pragmatically speaking, browsers implementing //-style comments would
> honor much fewer style rules an input like
>
>   //some comments. a {...} div {...} section {...}
>
> (a very likely output from YUI compressor given //-style comments) then
> a browser not implementing //-style, which means that it's more likely
> for users of browsers implementing //-style to see pages broken. In such
> case, users will criticize browsers instead of Web developers or
> developers of the CSS minimizers, and that will be the reason why
> browser implementers don't want to adopt this.
>
> > Devs who use minifiers could just choose not to use // comments
>
> Yes, that's a solution to the potential disaster(s). Not adopting //
> comments in the standards is another solution, with better backwards
> compatibility.
>
> My point is that we all have a rough idea of the pros and cons here. We
> just need quantitative data, or just more data in general.
>
> > (and minifiers would likely update to support them if they became
> > standard).
>
> (12/08/25 13:01), Liam R E Quin wrote:
> > <span style="color: red;// background-color: yellow; font-size:
> > 36pt;"> Is "font-size" commented out in (1) the mind of the author,
> > (2) the mind of the parser?
>
> Can you elaborate? Are you suggesting "font-size" should not be
> commented out? That would be another proposal D.
>
> > In
> > <span style="color: red;
> >             // background-color: yellow;
> >             font-size: 36pt;">
> >
> > how does attribute value normalization interact with the comment?
>
> What is attribute value normalization?
>
> > What about css minimization tools that remove as much whitespace as
> > possible?
>
> So I did a bit of investigation in to CSS minimization tools. Two common
> CSS minimization tools mentioned my Web developers folks in the Chinese
> HTML5 IG, LESS and stylus, already support //-style comments (However,
> these two tools already diverge largely from the CSS syntax).
>
> On the other hand, some of the top hits when I google "css minimizer",
> including YUI compressor and CSSO (CSS Optimizer) do turn line feeds
> into whitespace.
>
> I suggest whoever is interested in pushing //-style comments contact
> developers of YUI compressor and CSSO and persuade them to implement
> //-style comments.
>
>
> [1] http://yuilibrary.com/download/yuicompressor/
>
>
>
> Cheers,
> Kenny
> --
> Web Specialist, Oupeng Browser, Beijing
> Try Oupeng: http://www.oupeng.com/
>
>


-- 
Pete Boere
Web Developer

Received on Monday, 27 August 2012 12:07:44 UTC