W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2009

[whatwg] scripts, defer, document.write and DOMContentLoaded

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 28 Aug 2009 00:23:32 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0908280014000.13789@hixie.dreamhostps.com>
On Sun, 16 Aug 2009, Kristof Zelechovski wrote:
>
>  1.  What counts for "script source" if the inline XML contained within 
> the SCRIPT tag is invalid, assuming that the document is HTML or the 
> document is XHTML and the embedded invalid XML code is within a CDATA 
> section so that the containing XHTML document is valid?

Could you give an example of what you mean? Maybe we are misunderstanding 
each other. I don't see how you can have any inline XML in text/html 
<script> (except, I guess, if another script generates it using the DOM), 
and ill-formed XML in an XML document causes the parser to abort long 
before we get to the script processing.


>  2.  Why don't you say that the "script source" for "text/javascript" is 
> the AST?  How would declaring the "script source" to be the embedded 
> text break XML-based script languages?  The interpreter can parse the 
> XML text itself, can't it?

(AST?) The whole point is that if the script is XML, there's no text to 
parse -- it's already a DOM.


>  3.  In general, I am asking that XML be treated just as all other 
> script types, unless you allow XML data in a SCRIPT element, where the 
> execution of such data means creating a new XML document and attaching 
> it to the SCRIPT element as a property for other scripts to peruse.  
> This is how it works in Internet Explorer.  Of course, such a script 
> cannot be used to handle events in the containing document.
>
> Example:
> 	<SCRIPT ID=M TYPE="text/xml" ><root /></SCRIPT >
> 	<SCRIPT TYPE="text/vbscript" ><!--
> 	MSGBOX TYPENAME(DOCUMENT. GETELEMENTBYID("M"). XMLDOCUMENT),, "XML
> DOCUMENT"
> 	REM --></SCRIPT >

There's no XML there, at least not in the sense used by the HTML5 spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 27 August 2009 17:23:32 UTC

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