[html5] r893 - /

whatwg at whatwg.org whatwg at whatwg.org
Thu Jun 14 15:29:18 PDT 2007


Author: ianh
Date: 2007-06-14 15:29:17 -0700 (Thu, 14 Jun 2007)
New Revision: 893

Modified:
   index
   source
Log:
[] (0) Made <script> elements not run when set via innerHTML. Also, editorial fixes.

Modified: index
===================================================================
--- index	2007-06-14 22:17:34 UTC (rev 892)
+++ index	2007-06-14 22:29:17 UTC (rev 893)
@@ -3999,6 +3999,11 @@
      title=dom-innerHTML-HTML><a href="#innerhtml0">innerHTML</a></code>
      attribute is being set, preserving their order.</p>
   </ol>
+
+  <p class=note><code><a href="#script0">script</a></code> elements inserted
+   using <code title=dom-innerHTML-HTML><a
+   href="#innerhtml0">innerHTML</a></code> do not execute when they are
+   inserted.</p>
   <!-- XXX must make sure we spec that innerHTML causes mutation
   events to fire, but document.write() doesn't. (the latter is already
   req-stated in the parser section, btw) -->
@@ -4029,9 +4034,9 @@
 
 -->
 
-  <p>The <dfn id=innerhtml2
-   title=dom-innerHTML-XML><code>innerHTML</code></dfn> attributes, on the
-   other hand, in an XML context, are usable.
+  <p>On the other hand, however, the <dfn id=innerhtml2
+   title=dom-innerHTML-XML><code>innerHTML</code></dfn> attribute is indeed
+   usable in an XML context.
 
   <p>On getting, the <code title=dom-innerHTML-XML><a
    href="#innerhtml2">innerHTML</a></code> DOM attribute on <code><a
@@ -4044,8 +4049,10 @@
    href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a>
 
   <p>On setting, in an XML context, the <code title=dom-innerHTML-HTML><a
-   href="#innerhtml0">innerHTML</a></code> DOM attribute on must run the
-   following algorithm:
+   href="#innerhtml0">innerHTML</a></code> DOM attribute on <code><a
+   href="#htmlelement">HTMLElement</a></code>s and <code><a
+   href="#htmldocument">HTMLDocument</a></code>s must run the following
+   algorithm:
 
   <ol>
    <li>
@@ -4105,6 +4112,11 @@
      preserving their order.</p>
   </ol>
 
+  <p class=note><code><a href="#script0">script</a></code> elements inserted
+   using <code title=dom-innerHTML-XML><a
+   href="#innerhtml2">innerHTML</a></code> do not execute when they are
+   inserted.
+
   <h3 id=apis-in><span class=secno>2.6. </span>APIs in HTML documents</h3>
   <!-- XXX case-sensitivity training required here. -->
 
@@ -18953,10 +18965,15 @@
    <li>
     <p>If <a href="#scripting1">scripting is disabled</a>, or if the
      <code>Document</code> has <code title=dom-document-designMode><a
-     href="#designMode">designMode</a></code> enabled, or if the user agent
-     does not <a href="#support">support the scripting language</a> given by
-     <var><a href="#the-scripts">the script's type</a></var> for this
-     <code><a href="#script0">script</a></code> element, or if the <code><a
+     href="#designMode">designMode</a></code> enabled, or if the <code><a
+     href="#script0">script</a></code> element was created by a parser (an <a
+     href="#html-0">HTML parser</a> or an <span>XML parser</span>) that
+     itself was created as part of the processing of the <code
+     title=dom-innerHTML><a href="#innerhtml">innerHTML</a></code>
+     attribute's setter, or if the user agent does not <a
+     href="#support">support the scripting language</a> given by <var><a
+     href="#the-scripts">the script's type</a></var> for this <code><a
+     href="#script0">script</a></code> element, or if the <code><a
      href="#script0">script</a></code> element has its <a
      href="#already">"already executed"</a> flag set, then the user agent
      must abort these steps at this point. The script is not executed.</p>

Modified: source
===================================================================
--- source	2007-06-14 22:17:34 UTC (rev 892)
+++ source	2007-06-14 22:29:17 UTC (rev 893)
@@ -2640,6 +2640,10 @@
 
   </ol>
 
+  <p class="note"><code>script</code> elements inserted using <code
+  title="dom-innerHTML-HTML">innerHTML</code> do not execute when they
+  are inserted.</p>
+
   <!-- XXX must make sure we spec that innerHTML causes mutation
   events to fire, but document.write() doesn't. (the latter is already
   req-stated in the parser section, btw) -->
@@ -2671,8 +2675,9 @@
 
 -->
 
-  <p>The <dfn title="dom-innerHTML-XML"><code>innerHTML</code></dfn>
-  attributes, on the other hand, in an XML context, are usable.</p>
+  <p>On the other hand, however, the <dfn
+  title="dom-innerHTML-XML"><code>innerHTML</code></dfn> attribute is
+  indeed usable in an XML context.</p>
 
   <p>On getting, the <code title="dom-innerHTML-XML">innerHTML</code>
   DOM attribute on <code>HTMLElement</code>s and
@@ -2685,8 +2690,9 @@
   href="#refsXMLNS">[XMLNS]</a></p>
 
   <p>On setting, in an XML context, the <code
-  title="dom-innerHTML-HTML">innerHTML</code> DOM attribute on must
-  run the following algorithm:</p>
+  title="dom-innerHTML-HTML">innerHTML</code> DOM attribute on
+  <code>HTMLElement</code>s and <code>HTMLDocument</code>s must run
+  the following algorithm:</p>
 
   <ol>
 
@@ -2781,6 +2787,9 @@
 
   </ol>
 
+  <p class="note"><code>script</code> elements inserted using <code
+  title="dom-innerHTML-XML">innerHTML</code> do not execute when they
+  are inserted.</p>
 
 
 
@@ -16759,11 +16768,15 @@
     <p>If <span>scripting is disabled</span>, or if the
     <code>Document</code> has <code
     title="dom-document-designMode">designMode</code> enabled, or if
+    the <code>script</code> element was created by a parser (an
+    <span>HTML parser</span> or an <span>XML parser</span>) that
+    itself was created as part of the processing of the <code
+    title="dom-innerHTML">innerHTML</code> attribute's setter, or if
     the user agent does not <span>support the scripting
-    language</span> given by <var>the script's type</var> for
-    this <code>script</code> element, or if the <code>script</code>
-    element has its <span>"already executed"</span> flag set, then the
-    user agent must abort these steps at this point. The script is not
+    language</span> given by <var>the script's type</var> for this
+    <code>script</code> element, or if the <code>script</code> element
+    has its <span>"already executed"</span> flag set, then the user
+    agent must abort these steps at this point. The script is not
     executed.</p>
 
    </li>




More information about the Commit-Watchers mailing list