W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2011

html5/spec Overview.html,1.4939,1.4940

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 16 May 2011 23:52:55 +0000
To: public-html-commits@w3.org
Message-Id: <E1QM7ap-0008U3-DC@lionel-hutz.w3.org>
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv32588

Modified Files:
	Overview.html 
Log Message:
Update some examples in line with spec changes. (whatwg r6141)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4939
retrieving revision 1.4940
diff -u -d -r1.4939 -r1.4940
--- Overview.html	16 May 2011 23:30:20 -0000	1.4939
+++ Overview.html	16 May 2011 23:52:51 -0000	1.4940
@@ -62364,38 +62364,35 @@
   is inserted <em>into the outer <code><a href="#document">Document</a></code>
   object</em>.</p>
 
-  <p>This also means that the <a href="#script-s-global-object">script's global object</a> is
-  the outer <a href="#browsing-context">browsing context</a>'s <code><a href="#window">Window</a></code>
-  object, <em>not</em> the <code><a href="#window">Window</a></code> object inside the
-  <code><a href="#the-iframe-element">iframe</a></code>.</p>
-
-  <p class="note">This isn't a security problem since the script that
-  moves the <code><a href="#the-div-element">div</a></code> into the outer <code><a href="#document">Document</a></code> can
-  only do so because the two <code><a href="#document">Document</a></code> object have the
-  same <a href="#origin">origin</a>.</p>
-
-  <p>Thus, the first alert says "http://example.com/outer".</p>
+  <p>This parsed into different <code><a href="#document">Document</a></code>s than the one
+  the parser was created for do not execute, so the first alert does
+  not show.</p>
 
   <p>Once the <code><a href="#the-div-element">div</a></code> element's end tag is parsed, the
   <code><a href="#the-div-element">div</a></code> element is popped off the stack, and so the next
   <code><a href="#the-script-element">script</a></code> element is in the inner <code><a href="#document">Document</a></code>:</p>
 
-  <ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-script-element">script</a></code><ul><li class="t3"><code>#text</code>: <span title="">alert(document.URL);</span></ul></ul></ul></ul><p>This second alert will say "http://example.com/inner".</p>
+  <ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-script-element">script</a></code><ul><li class="t3"><code>#text</code>: <span title="">alert(document.URL);</span></ul></ul></ul></ul><p>This script does execute, resulting in an alert that says "http://example.com/inner".</p>
 
 
   <h5 id="the-execution-of-scripts-that-are-moving-across-multiple-documents"><span class="secno">8.2.8.5 </span>The execution of scripts that are moving across multiple documents</h5>
 
   <p><i>This section is non-normative.</i></p>
 
-  <p>Elaborating on the example in the previous section, consider a
-  case where a <code><a href="#the-script-element">script</a></code> element with a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute is parsed, but while
-  the external script is being downloaded, the element is moved to
-  another document.</p>
+  <p>Elaborating on the example in the previous section, consider the
+  case where the second <code><a href="#the-script-element">script</a></code> element is an external
+  script (i.e. one with a <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
+  attribute). Since the element was not in the parser's
+  <code><a href="#document">Document</a></code> when it was created, that external script is
+  not even downloaded.</p>
 
-  <p>In this case, the <a href="#script-s-global-object">script's global object</a> is that
-  second document's <a href="#browsing-context">browsing context</a>'s
-  <code><a href="#window">Window</a></code> object, not the <code><a href="#window">Window</a></code> object of
-  the document into which the element was parsed.</p>
+  <p>In a case where a <code><a href="#the-script-element">script</a></code> element with a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute is parsed normally into
+  its parser's <code><a href="#document">Document</a></code>, but while the external script is
+  being downloaded, the element is moved to another document, the
+  script continues to download, but does not execute.</p>
+
+  <p class="note">In general, moving <code><a href="#the-script-element">script</a></code> elements
+  between <code><a href="#document">Document</a></code>s is considered a bad practice.</p>
 
 
 
Received on Monday, 16 May 2011 23:52:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 16 May 2011 23:53:02 GMT