[whatwg] scripts, defer, document.write and DOMContentLoaded
ian at hixie.ch
Sat Aug 15 20:11:52 PDT 2009
On Tue, 11 Aug 2009, Kristof Zelechovski wrote:
> 1. The specification defines the term "script source" to mean
> either the text or the infoset, depending whether the script is
> text-based or XML-based. What is the script source for type text/xml
Assuming you mean an internal script, the children of the <script>
> What happens when the XML is invalid?
Assuming you mean in an XHTML document, the parser would have failed long
before the <script> element was completely parsed and executed.
If you mean a text/html document, then I don't know which XML you mean.
> 2. Why doesn't "script source" mean the text of the script in all
Because that would break XML-based scripting languages.
> 3. Microsoft Internet Explorer supports XHTML as "text/xml",
> although it does not support XHTML as "application/xhtml+xml". But I did
> not mention XHTML anywhere in my question. OTOH, any XML makes a SCRIPT for
> IE - a "data script". Or did you mean a "data script" to be necessarily
> plain text? I fail to see it specified.
I have no idea what you are asking.
> 4. So, the question is whether such data scripts are allowed to be
> loaded externally. AIUI, they are not allowed. AFAIK, they are supported,
> at least in MSIE.
I'm not aware of any UAs implementing an XML-based scripting language, so
I don't know how one would be able to say.
> 5a: XML-based scripts are not accessible as infosets, they can only
> be executed;
> 5b: data scripts are only text/plain;
> 5c: XML islands in SCRIPT elements are not supported. In
> particular, execution of arbitrary XML data in the browser is not allowed to
> attach an XML document to the SCRIPT element. (Why not, given that you
> allow the browser to do whatever it likes with script of type
> Is that correct?
I have no idea what you're talking about here.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg