Re: Document conformance and non-empty <script src>

On Thu, 15 May 2008, Simon Pieters wrote:
> On Thu, 15 May 2008 00:06:31 +0200, Ian Hickson <ian@hixie.ch> wrote:
> > >
> > > Things authors put in <script src> deliberatly:
> > > 
> > >  A: An empty comment, ";", "var dummy=0;", etc, as a way to prevent their
> > >     server side XSLT to emit "<script ... />" (though most empty comments
> > >     are likely just cargo cult). Banning this means that authors have to
> > >     change their backend in order to move to HTML5, which seems to be an
> > >     unnecessary blocker for adoption.
> > > 
> > >  B: A comment containing a description of the script and/or copyright
> > >     information. Moving this comment to outside the script element seems
> > >     pointless and has less chance of surviving copy-paste, and I'd imagine
> > >     authors would get stumped when the comment says "This notice MUST stay
> > >     intact for legal use".
> > > 
> > >  C: Empty function declarations with the same names as the functions
> > >     declared in the external script. Personally I find this slightly
> > >     confusing and would rather put them in a comment.
> > 
> > All of the above can use a comment, which is allowed (in the XML variant,
> > at least -- you can't put a comment in the text/html variant).
> 
> I didn't mean comment as in a DOM Comment node, but rather as in a javascript
> comment.

Right but I'm saying that a regular DOM Comment node comment would work.


> > For A, would a single space work?
> 
> I guess that depends on whether there's whitespace mangling down the 
> toolchain.

Well, if they mangling stuff, they can mangle scripts too...


> > I suppose we could allow /* ... */, but that seems oddly specific...
> 
> The spec could allow any text and conformance checkers could compete on 
> being useful. Or the spec can be oddly specific. :-) Note though that // 
> and <!-- are also javascript comments.

I suppose if we want to support this for text/html...

What syntaxes do we want to allow? Only zero or more /*...*/ and //...\n 
strings with any amount of whitespace before and after?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 5 August 2008 20:37:49 UTC