W3C home > Mailing lists > Public > www-svg@w3.org > September 2010

Re: [Bug 10901] New: Use same parsing for HTML <script> and SVG <script>

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 30 Sep 2010 23:26:21 +0000 (UTC)
To: ddailey <ddailey@zoominternet.net>
cc: Doug Schepers <schepers@w3.org>, www-svg <www-svg@w3.org>
Message-ID: <Pine.LNX.4.64.1009302310250.3271@ps20323.dreamhostps.com>
On Thu, 30 Sep 2010, ddailey wrote:
> Any idea of what those rare edge cases might be?

The main one (assuming we do the CDATA thing) would be use of entities, so 

     if (x &lt; 3)

...would no longer compile.

Also, document.write() would become re-entrant in SVG <script> if we made 
this change. Should people then try to use the same scripts in non-browser 
SVG clients, this will introduce a world of pain for those implementors 
the likes of which they have never experienced, if the equivalent pain 
felt by browser vendors over the years is any indication.

There's also other edge cases when it comes to non-conforming content 
(e.g. nested <script> elements would get treated radically differently, 
and the parsing of scripts containing strings containing "</script>" or 
"<!--" would become highly unintuitive). These don't affect valid 
documents though.

On a side note, one effect of the proposal that might affect HTML user 
agents is that <script>s in HTML containing CDATA-like blocks would begin 
to parse differently. How compatible this is with the Web, I don't know.

Ian Hickson               U+HTML5                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 30 September 2010 23:27:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:22 UTC