W3C home > Mailing lists > Public > public-html-diffs@w3.org > March 2011

hixie: Be better about how we define the creation of scripts for event handler attributes (specifically, how we interact with the JS spec). (whatwg r5933)

From: poot <cvsmail@w3.org>
Date: Thu, 03 Mar 2011 19:53:22 -0500
To: public-html-diffs@w3.org
Message-Id: <E1PvJGk-0005Qy-3D@jay.w3.org>
hixie: Be better about how we define the creation of scripts for event
handler attributes (specifically, how we interact with the JS spec).
(whatwg r5933)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4773&r2=1.4774&f=h
http://html5.org/tools/web-apps-tracker?from=5932&to=5933

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4773
retrieving revision 1.4774
diff -u -d -r1.4773 -r1.4774
--- Overview.html	4 Mar 2011 00:02:36 -0000	1.4773
+++ Overview.html	4 Mar 2011 00:52:09 -0000	1.4774
@@ -48537,14 +48537,54 @@
   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>
 
@@ -48563,8 +48603,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>
 
@@ -48587,17 +48626,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>,
Received on Friday, 4 March 2011 00:53:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 4 March 2011 00:53:24 GMT