[html5] r6141 - [e] (0) Update some examples in line with spec changes.

whatwg at whatwg.org whatwg at whatwg.org
Mon May 16 16:52:47 PDT 2011


Author: ianh
Date: 2011-05-16 16:52:45 -0700 (Mon, 16 May 2011)
New Revision: 6141

Modified:
   complete.html
   index
   source
Log:
[e] (0) Update some examples in line with spec changes.

Modified: complete.html
===================================================================
--- complete.html	2011-05-16 23:30:13 UTC (rev 6140)
+++ complete.html	2011-05-16 23:52:45 UTC (rev 6141)
@@ -88895,41 +88895,38 @@
   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>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 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>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>13.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>
 
 
+
   <h5 id=unclosed-formatting-elements><span class=secno>13.2.8.6 </span>Unclosed formatting elements</h5>
 
   <p><i>This section is non-normative.</i></p>

Modified: index
===================================================================
--- index	2011-05-16 23:30:13 UTC (rev 6140)
+++ index	2011-05-16 23:52:45 UTC (rev 6141)
@@ -84868,41 +84868,38 @@
   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>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 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>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>11.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>
 
 
+
   <h5 id=unclosed-formatting-elements><span class=secno>11.2.8.6 </span>Unclosed formatting elements</h5>
 
   <p><i>This section is non-normative.</i></p>

Modified: source
===================================================================
--- source	2011-05-16 23:30:13 UTC (rev 6140)
+++ source	2011-05-16 23:52:45 UTC (rev 6141)
@@ -100885,44 +100885,41 @@
   is inserted <em>into the outer <code>Document</code>
   object</em>.</p>
 
-  <p>This also means that the <span>script's global object</span> is
-  the outer <span>browsing context</span>'s <code>Window</code>
-  object, <em>not</em> the <code>Window</code> object inside the
-  <code>iframe</code>.</p>
+  <p>This parsed into different <code>Document</code>s than the one
+  the parser was created for do not execute, so the first alert does
+  not show.</p>
 
-  <p class="note">This isn't a security problem since the script that
-  moves the <code>div</code> into the outer <code>Document</code> can
-  only do so because the two <code>Document</code> object have the
-  same <span>origin</span>.</p>
-
-  <p>Thus, the first alert says "http://example.com/outer".</p>
-
   <p>Once the <code>div</code> element's end tag is parsed, the
   <code>div</code> element is popped off the stack, and so the next
   <code>script</code> element is in the inner <code>Document</code>:</p>
 
   <ul class="domTree"><li class="t1"><code>html</code><ul><li class="t1"><code>head</code></li><li class="t1"><code>body</code><ul><li class="t1"><code>script</code><ul><li class="t3"><code>#text</code>: <span title="">alert(document.URL);</span></li></ul></li></ul></li></ul></li></ul>
 
-  <p>This second alert will say "http://example.com/inner".</p>
+  <p>This script does execute, resulting in an alert that says "http://example.com/inner".</p>
 
 
   <h5>The execution of scripts that are moving across multiple documents</h5>
 
   <!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
 
-  <p>Elaborating on the example in the previous section, consider a
-  case where a <code>script</code> element with a <code
-  title="attr-script-src">src</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>script</code> element is an external
+  script (i.e. one with a <code title="attr-script-src">src</code>
+  attribute). Since the element was not in the parser's
+  <code>Document</code> when it was created, that external script is
+  not even downloaded.</p>
 
-  <p>In this case, the <span>script's global object</span> is that
-  second document's <span>browsing context</span>'s
-  <code>Window</code> object, not the <code>Window</code> object of
-  the document into which the element was parsed.</p>
+  <p>In a case where a <code>script</code> element with a <code
+  title="attr-script-src">src</code> attribute is parsed normally into
+  its parser's <code>Document</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>script</code> elements
+  between <code>Document</code>s is considered a bad practice.</p>
 
 
+
   <h5>Unclosed formatting elements</h5>
 
   <!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->




More information about the Commit-Watchers mailing list