[whatwg] Common Subset

Ian Hickson ian at hixie.ch
Sun Dec 10 13:15:38 PST 2006

On Sat, 9 Dec 2006, Alexey Feldgendler wrote:
> The HTML5 spec could somehow officially bless CDATA only when used like 
> this:
> <script>//<![CDATA[
> ...
> //]]></script>
> It would not harm because it is already interoperable. But it seems 
> somehow stupid to define that <![CDATA[ and ]]> are only allowed inside 
> <script> after "//".

I encourage this kind of thing to be put in the Wiki, rather than the 
spec; I don't think the spec should do anything to encourage people to use 
the straight-jacket "common" syntax. I mean, I don't think the spec should 
put up artificial barriers to people trying to write documents that can be 
parsed identically by XML and HTML parsers, since, as has been pointed out 
so many times, the two syntaxes are indeed so superficially similar. 
However, that doesn't mean the spec should in any way justify such strange 
behaviour, especially given how hard it is to actually get it right (as 
demonstrated by XHTML 1.0 Appendix C).

On Sat, 9 Dec 2006, Lachlan Hunt wrote:
> It's technically already allowed because script and style elements are 
> defined to contain CDATA.  So basically any string of text that doesn't 
> include '</' before the end tag is valid.

Well, it has to be valid JavaScript to be conformant. (Or valid whatever- 

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

More information about the whatwg mailing list