[html5] r5933 - [] (0) Be better about how we define the creation of scripts for event handler a [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Mar 3 16:52:04 PST 2011


Author: ianh
Date: 2011-03-03 16:52:03 -0800 (Thu, 03 Mar 2011)
New Revision: 5933

Modified:
   complete.html
   index
   source
Log:
[] (0) Be better about how we define the creation of scripts for event handler attributes (specifically, how we interact with the JS spec).
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11977

Modified: complete.html
===================================================================
--- complete.html	2011-03-04 00:02:30 UTC (rev 5932)
+++ complete.html	2011-03-04 00:52:03 UTC (rev 5933)
@@ -64825,15 +64825,55 @@
   following steps to create a <a href=#concept-script title=concept-script>script</a> after setting the content
   attribute to its new value:</p>
 
-  <ol><li><p>Set up a <a href=#script-execution-environment>script execution environment</a> for
+  <ol><li><p>Set the corresponding <a href=#event-handlers title="event handlers">event
+   handler</a> to null.</li>
+
+   <li><p>Set up a <a href=#script-execution-environment>script execution environment</a> for
    JavaScript.</li>
 
+   <li><p>Let <var title="">body</var> be the <a href=#event-handler-content-attributes title="event
+   handler content attributes">event handler content
+   attribute</a>'s new value.</li>
+
    <li>
 
-    <p>Using this script execution environment, create a function
-    object (as defined in ECMAScript edition 5 section 13.2 Creating
-    Function Objects), with:</p>
+    <p>If <var title="">body</var> is not parsable as
+    <i>FunctionBody</i> then abort these steps.</p>
 
+    <p class=note><i>FunctionBody</i> is defined in ECMAScript
+    edition 5 section 13 Function Definition. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">body</var> begins with a Directive Prologue
+    that contains a Use Strict Directive then let <var title="">strict</var> be true, otherwise let <var title="">strict</var> be false.</p> <!-- we can't defer to 10.1.1
+    since we're not using a Function constructor but doing it
+    ourselves. -->
+
+    <p class=note>The terms "Directive Prologue" and "Use Strict
+    Directive" are defined in ECMAScript edition 5 section 14.1
+    Directive Prologues and the Use Strict Directive. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">strict</var> is true, and anything in <var title="">body</var> is a <code>SyntaxError</code> according to the
+    Strict Mode Restrictions, then abort these steps.</p>
+
+    <p class=note>The Strict Mode Restrictions are those listed in
+    ECMAScript edition 5 section 13.1 Strict Mode Restrictions. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>Using the script execution environment created above, create a
+    function object (as defined in ECMAScript edition 5 section 13.2
+    Creating Function Objects), with:</p>
+
     <dl><dt>Parameter list <var title="">FormalParameterList</var></dt>
 
      <dd>
@@ -64851,8 +64891,7 @@
 
      <dt>Function body <var title="">FunctionBody</var></dt>
 
-     <dd>The <a href=#event-handler-content-attributes title="event handler content attributes">event
-     handler content attribute</a>'s new value.</dd>
+     <dd>The result of parsing <var title="">body</var> above.</dd>
 
      <dt>Lexical Environment <var title="">Scope</var></dt>
 
@@ -64875,17 +64914,13 @@
 
      <dt>Boolean flag <var title="">Strict</var></dt>
 
-     <dd>False.</dd>
+     <dd>The value of <var title="">strict</var>.</dd>
 
     </dl><p>Let this new function be the only entry in the script's
     <a href=#list-of-code-entry-points>list of code entry-points</a>.</p>
 
    </li>
 
-   <li><p>If the previous steps failed to compile the script, then set
-   the corresponding <a href=#event-handlers title="event handlers">event handler</a>
-   to null and abort these steps.</li>
-
    <li><p>Set up the <a href="#script's-global-object">script's global object</a>, the
    <a href="#script's-browsing-context">script's browsing context</a>, the <a href="#script's-document">script's
    document</a>, the <a href="#script's-url-character-encoding">script's URL character encoding</a>,

Modified: index
===================================================================
--- index	2011-03-04 00:02:30 UTC (rev 5932)
+++ index	2011-03-04 00:52:03 UTC (rev 5933)
@@ -64828,15 +64828,55 @@
   following steps to create a <a href=#concept-script title=concept-script>script</a> after setting the content
   attribute to its new value:</p>
 
-  <ol><li><p>Set up a <a href=#script-execution-environment>script execution environment</a> for
+  <ol><li><p>Set the corresponding <a href=#event-handlers title="event handlers">event
+   handler</a> to null.</li>
+
+   <li><p>Set up a <a href=#script-execution-environment>script execution environment</a> for
    JavaScript.</li>
 
+   <li><p>Let <var title="">body</var> be the <a href=#event-handler-content-attributes title="event
+   handler content attributes">event handler content
+   attribute</a>'s new value.</li>
+
    <li>
 
-    <p>Using this script execution environment, create a function
-    object (as defined in ECMAScript edition 5 section 13.2 Creating
-    Function Objects), with:</p>
+    <p>If <var title="">body</var> is not parsable as
+    <i>FunctionBody</i> then abort these steps.</p>
 
+    <p class=note><i>FunctionBody</i> is defined in ECMAScript
+    edition 5 section 13 Function Definition. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">body</var> begins with a Directive Prologue
+    that contains a Use Strict Directive then let <var title="">strict</var> be true, otherwise let <var title="">strict</var> be false.</p> <!-- we can't defer to 10.1.1
+    since we're not using a Function constructor but doing it
+    ourselves. -->
+
+    <p class=note>The terms "Directive Prologue" and "Use Strict
+    Directive" are defined in ECMAScript edition 5 section 14.1
+    Directive Prologues and the Use Strict Directive. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">strict</var> is true, and anything in <var title="">body</var> is a <code>SyntaxError</code> according to the
+    Strict Mode Restrictions, then abort these steps.</p>
+
+    <p class=note>The Strict Mode Restrictions are those listed in
+    ECMAScript edition 5 section 13.1 Strict Mode Restrictions. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>Using the script execution environment created above, create a
+    function object (as defined in ECMAScript edition 5 section 13.2
+    Creating Function Objects), with:</p>
+
     <dl><dt>Parameter list <var title="">FormalParameterList</var></dt>
 
      <dd>
@@ -64854,8 +64894,7 @@
 
      <dt>Function body <var title="">FunctionBody</var></dt>
 
-     <dd>The <a href=#event-handler-content-attributes title="event handler content attributes">event
-     handler content attribute</a>'s new value.</dd>
+     <dd>The result of parsing <var title="">body</var> above.</dd>
 
      <dt>Lexical Environment <var title="">Scope</var></dt>
 
@@ -64878,17 +64917,13 @@
 
      <dt>Boolean flag <var title="">Strict</var></dt>
 
-     <dd>False.</dd>
+     <dd>The value of <var title="">strict</var>.</dd>
 
     </dl><p>Let this new function be the only entry in the script's
     <a href=#list-of-code-entry-points>list of code entry-points</a>.</p>
 
    </li>
 
-   <li><p>If the previous steps failed to compile the script, then set
-   the corresponding <a href=#event-handlers title="event handlers">event handler</a>
-   to null and abort these steps.</li>
-
    <li><p>Set up the <a href="#script's-global-object">script's global object</a>, the
    <a href="#script's-browsing-context">script's browsing context</a>, the <a href="#script's-document">script's
    document</a>, the <a href="#script's-url-character-encoding">script's URL character encoding</a>,

Modified: source
===================================================================
--- source	2011-03-04 00:02:30 UTC (rev 5932)
+++ source	2011-03-04 00:52:03 UTC (rev 5933)
@@ -73751,15 +73751,61 @@
 
   <ol>
 
+   <li><p>Set the corresponding <span title="event handlers">event
+   handler</span> to null.</p></li>
+
    <li><p>Set up a <span>script execution environment</span> for
    JavaScript.</p></li>
 
+   <li><p>Let <var title="">body</var> be the <span title="event
+   handler content attributes">event handler content
+   attribute</span>'s new value.</p></li>
+
    <li>
 
-    <p>Using this script execution environment, create a function
-    object (as defined in ECMAScript edition 5 section 13.2 Creating
-    Function Objects), with:</p>
+    <p>If <var title="">body</var> is not parsable as
+    <i>FunctionBody</i> then abort these steps.</p>
 
+    <p class="note"><i>FunctionBody</i> is defined in ECMAScript
+    edition 5 section 13 Function Definition. <a
+    href="#refsECMA262">[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">body</var> begins with a Directive Prologue
+    that contains a Use Strict Directive then let <var
+    title="">strict</var> be true, otherwise let <var
+    title="">strict</var> be false.</p> <!-- we can't defer to 10.1.1
+    since we're not using a Function constructor but doing it
+    ourselves. -->
+
+    <p class="note">The terms "Directive Prologue" and "Use Strict
+    Directive" are defined in ECMAScript edition 5 section 14.1
+    Directive Prologues and the Use Strict Directive. <a
+    href="#refsECMA262">[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">strict</var> is true, and anything in <var
+    title="">body</var> is a <code>SyntaxError</code> according to the
+    Strict Mode Restrictions, then abort these steps.</p>
+
+    <p class="note">The Strict Mode Restrictions are those listed in
+    ECMAScript edition 5 section 13.1 Strict Mode Restrictions. <a
+    href="#refsECMA262">[ECMA262]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>Using the script execution environment created above, create a
+    function object (as defined in ECMAScript edition 5 section 13.2
+    Creating Function Objects), with:</p>
+
     <dl>
 
      <dt>Parameter list <var title="">FormalParameterList</var></dt>
@@ -73787,8 +73833,7 @@
 
      <dt>Function body <var title="">FunctionBody</var></dt>
 
-     <dd>The <span title="event handler content attributes">event
-     handler content attribute</span>'s new value.</dd>
+     <dd>The result of parsing <var title="">body</var> above.</dd>
 
      <dt>Lexical Environment <var title="">Scope</var></dt>
 
@@ -73819,7 +73864,7 @@
 
      <dt>Boolean flag <var title="">Strict</var></dt>
 
-     <dd>False.</dd>
+     <dd>The value of <var title="">strict</var>.</dd>
 
     </dl>
 
@@ -73828,10 +73873,6 @@
 
    </li>
 
-   <li><p>If the previous steps failed to compile the script, then set
-   the corresponding <span title="event handlers">event handler</span>
-   to null and abort these steps.</p></li>
-
    <li><p>Set up the <span>script's global object</span>, the
    <span>script's browsing context</span>, the <span>script's
    document</span>, the <span>script's URL character encoding</span>,




More information about the Commit-Watchers mailing list