Skip to content

Commit

Permalink
[] (0) Be better about how we define the creation of scripts for even…
Browse files Browse the repository at this point in the history
…t handler attributes (specifically, how we interact with the JS spec).

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11977

git-svn-id: http://svn.whatwg.org/webapps@5933 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 4, 2011
1 parent 0f140e5 commit c804cda
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 32 deletions.
57 changes: 46 additions & 11 deletions complete.html
Expand Up @@ -64825,14 +64825,54 @@ <h5 id=event-handler-attributes><span class=secno>7.1.6.1 </span>Event handlers<
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>

Expand All @@ -64851,8 +64891,7 @@ <h5 id=event-handler-attributes><span class=secno>7.1.6.1 </span>Event handlers<

<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>

Expand All @@ -64875,17 +64914,13 @@ <h5 id=event-handler-attributes><span class=secno>7.1.6.1 </span>Event handlers<

<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>,
Expand Down
57 changes: 46 additions & 11 deletions index
Expand Up @@ -64828,14 +64828,54 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {
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>

Expand All @@ -64854,8 +64894,7 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {

<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>

Expand All @@ -64878,17 +64917,13 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {

<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>,
Expand Down
61 changes: 51 additions & 10 deletions source
Expand Up @@ -73751,14 +73751,60 @@ interface <dfn>NavigatorOnLine</dfn> {

<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>

Expand Down Expand Up @@ -73787,8 +73833,7 @@ interface <dfn>NavigatorOnLine</dfn> {

<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>

Expand Down Expand Up @@ -73819,7 +73864,7 @@ interface <dfn>NavigatorOnLine</dfn> {

<dt>Boolean flag <var title="">Strict</var></dt>

<dd>False.</dd>
<dd>The value of <var title="">strict</var>.</dd>

</dl>

Expand All @@ -73828,10 +73873,6 @@ interface <dfn>NavigatorOnLine</dfn> {

</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>,
Expand Down

0 comments on commit c804cda

Please sign in to comment.