W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2008

[whatwg] Script, style and backwards compatibility

From: Samuel Santos <samaxes@gmail.com>
Date: Fri, 9 May 2008 00:50:20 +0100
Message-ID: <fe7db4750805081650t77629c5cg254e8c59f2777a30@mail.gmail.com>
On Thu, May 8, 2008 at 11:43 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Mon, 30 Apr 2007, Simon Pieters wrote:
> >
> > From http://forums.whatwg.org/viewtopic.php?t=38
> >
> > I can extract two requests.
> >
> > 1. Explain how authors are supposed to "comment" their <script> and
> > <style> elements in HTML5. (Post #171.)
> >
> > Something along the following lines could be inserted as a note in the
> > syntax section, e.g. after the "CDATA elements can have text, ..."
> > paragraph:
> >
> >    Old browsers that don't understand the style or script elements
> >    (introduced in HTML 3.2) will attempt render their contents. However,
> >    the strings "<!--" and "-->" are part of the CSS syntax, and "<!--" is
> >    equivalent to "//" in JavaScript, so authors who don't want to reveal
> >    their style sheets or scripts to users with such browsers can simply
> >    comment them out. [CSS21] [ECMA262]
> >
> >       <style>
> >       <!--
> >       ...
> >       -->
> >       </style>
> >
> >       <script>
> >       <!--
> >       ...
> >       //-->
> >       </script>
> >
> > (But it is an issue though that ECMAScript 262 still doesn't define the
> > <!-- magic.)
>
> Is there really any need to escape the contents of <script>/<style> at all
> these days?
>

In order to validate a page as valid HTML/XHTML you need to escape inline
<script> when using characters like &.

>
>
> > 2. Explain how HTML5 and XHTML5 differ in practice. (Post #187.)
> >
> > e.g. something like http://wiki.whatwg.org/wiki/HtmlVsXhtml could be
> > included as a non-normative appendix to the spec, or referenced to in
> > the HTML vs. XHTML section, or similar.
>
> I'd rather just leave this to non-normative documentation outside of the
> spec, if that's ok. It's easier to update things that aren't in the spec,
> and this is the kind of thing where we might well find things we've
> missed.
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>



-- 
Samuel Santos
http://www.samaxes.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080509/4f12c99c/attachment.htm>
Received on Thursday, 8 May 2008 16:50:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:02 UTC