Re: HTML5 script start tag should select appropriate content model according to src

David Woolley wrote:
> The claim on the lynx-dev list was that a real problem was being caused 
> because, unamed popular browsers were treating <script src=.... /> as 
> empty, whereas Lynx was eating the following code in CDATA mode.  Their 
> analysis was that <tag /> means <tag></tag> in modern HTML, but that is 
> not born out by the HTML5 lexical rules, and would be an undesirable of 
> XHTML behaviour into HTML.
> 
> http://lists.gnu.org/archive/html/lynx-dev/2007-04/msg00019.html

Actually, the parsing of script in current browsers is quite complex and 
mostly non-interoperable.

Safari does indeed treat <script /> and <script src=""/> as an empty 
element for HTML, though it treats <script/> as a normal start tag.

In Firefox 2, once it hits the end of file (EOF), it will go back, close 
the script element and reparse everything after the start tag.

IE and Opera just keep parsing until they hit EOF.

The spec is defined much closer to IE and Operas behaviour because 
reparsing has both performance and potential security issues.

In any case, lynx should attempt to follow the HTML5 spec, as that is 
what browsers will be implementing.  Implementation feedback from them 
would also be very welcome.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Sunday, 22 April 2007 14:19:50 UTC