Navigation Menu

Skip to content

Commit

Permalink
[giow] (3) Make content attribute event handlers work slightly more l…
Browse files Browse the repository at this point in the history
…ike in more browsers.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23956
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8376 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 6, 2014
1 parent b0aa103 commit da64092
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 34 deletions.
28 changes: 17 additions & 11 deletions complete.html
Expand Up @@ -71502,10 +71502,9 @@ <h5 id=event-handler-attributes><span class=secno>7.1.5.1 </span>Event handlers<

<div class=impl>

<!--CLEANUP-->
<p>When an <a href=#event-handler-content-attributes title="event handler content attributes">event handler content attribute</a>
is set, if the element is owned by a <code><a href=#document>Document</a></code> that is in a <a href=#browsing-context>browsing
context</a>, and <a href=#concept-bc-script title=concept-bc-script>scripting is enabled</a> for that
<a href=#browsing-context>browsing context</a>, the user agent must set the corresponding <a href=#event-handlers title="event
is set, the user agent must set the corresponding <a href=#event-handlers title="event
handlers">event handler</a> to an <a href=#internal-raw-uncompiled-handler>internal raw uncompiled handler</a> consisting of
the attribute's new value and the script location where the attribute was set to this value</p>

Expand All @@ -71517,10 +71516,6 @@ <h5 id=event-handler-attributes><span class=secno>7.1.5.1 </span>Event handlers<
see http://www.w3.org/Bugs/Public/show_bug.cgi?id=7626#c5 for reasoning
-->

<p class=note>When an <a href=#event-handler-content-attributes title="event handler content attributes">event handler content
attribute</a> is set on an element owned by a <code><a href=#document>Document</a></code> that is not in a
<a href=#browsing-context>browsing context</a>, the corresponding event handler is not changed.</p>

<hr><p>When an <a href=#event-handlers title="event handlers">event handler</a> <var title="">H</var> of an element
or object <var title="">T</var> implementing the <code><a href=#eventtarget>EventTarget</a></code> interface is first set
to a non-null value, the user agent must append an <a href=#concept-event-listener title=concept-event-listener>event
Expand Down Expand Up @@ -71723,6 +71718,12 @@ <h5 id=event-handler-attributes><span class=secno>7.1.5.1 </span>Event handlers<

</li>

<li><p>If <!--<var title="">element</var> is not null and--> <var title="">document</var> is
not in a <a href=#browsing-context>browsing context</a>, or if <a href=#concept-bc-script title=concept-bc-script>scripting is
enabled</a> for <var title="">document</var>'s <a href=#browsing-context>browsing context</a>, then return
null and abort the algorithm for <a href=#getting-the-current-value-of-the-event-handler>getting the current value of the event
handler</a>.</li>

<li><p>Let <var title="">body</var> be the uncompiled script body in the <a href=#internal-raw-uncompiled-handler>internal raw
uncompiled handler</a>.</li>

Expand Down Expand Up @@ -71831,15 +71832,20 @@ <h5 id=event-handler-attributes><span class=secno>7.1.5.1 </span>Event handlers<

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

</dl><!-- SCRIPT EXEC --><p>Let this new function be a new <a href=#concept-script title=concept-script>script</a>'s <a href=#code-entry-point>code
entry-point</a>.</p>
</dl><p>Let <var title="">function</var> be this new function.</p>

</li>

<li><p>Let that <a href=#concept-script title=concept-script>script</a>'s <a href=#settings-object>settings object</a> be
<li><p>Let <var title="">script</var> be a new <a href=#concept-script title=concept-script>script</a>.</li>

<!-- SCRIPT EXEC -->
<li><p>Let <var title="">script</var>'s <a href=#code-entry-point>code entry-point</a> be <var title="">function</var>.</li>

<!--CLEANUP-->
<li><p>Let <var title="">script</var>'s <a href=#settings-object>settings object</a> be
<var title="">script settings</var>.</li>

<li><p>Set <var title="">H</var> to the aforementioned function.</li>
<li><p>Set <var title="">H</var> to <var title="">function</var>.</li>

</ol></li>

Expand Down
28 changes: 17 additions & 11 deletions index
Expand Up @@ -71502,10 +71502,9 @@ dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>Even

<div class=impl>

<!--CLEANUP-->
<p>When an <a href=#event-handler-content-attributes title="event handler content attributes">event handler content attribute</a>
is set, if the element is owned by a <code><a href=#document>Document</a></code> that is in a <a href=#browsing-context>browsing
context</a>, and <a href=#concept-bc-script title=concept-bc-script>scripting is enabled</a> for that
<a href=#browsing-context>browsing context</a>, the user agent must set the corresponding <a href=#event-handlers title="event
is set, the user agent must set the corresponding <a href=#event-handlers title="event
handlers">event handler</a> to an <a href=#internal-raw-uncompiled-handler>internal raw uncompiled handler</a> consisting of
the attribute's new value and the script location where the attribute was set to this value</p>

Expand All @@ -71517,10 +71516,6 @@ dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>Even
see http://www.w3.org/Bugs/Public/show_bug.cgi?id=7626#c5 for reasoning
-->

<p class=note>When an <a href=#event-handler-content-attributes title="event handler content attributes">event handler content
attribute</a> is set on an element owned by a <code><a href=#document>Document</a></code> that is not in a
<a href=#browsing-context>browsing context</a>, the corresponding event handler is not changed.</p>

<hr><p>When an <a href=#event-handlers title="event handlers">event handler</a> <var title="">H</var> of an element
or object <var title="">T</var> implementing the <code><a href=#eventtarget>EventTarget</a></code> interface is first set
to a non-null value, the user agent must append an <a href=#concept-event-listener title=concept-event-listener>event
Expand Down Expand Up @@ -71723,6 +71718,12 @@ typedef <a href=#onbeforeunloadeventhandlernonnull>OnBeforeUnloadEventHandlerNon

</li>

<li><p>If <!--<var title="">element</var> is not null and--> <var title="">document</var> is
not in a <a href=#browsing-context>browsing context</a>, or if <a href=#concept-bc-script title=concept-bc-script>scripting is
enabled</a> for <var title="">document</var>'s <a href=#browsing-context>browsing context</a>, then return
null and abort the algorithm for <a href=#getting-the-current-value-of-the-event-handler>getting the current value of the event
handler</a>.</li>

<li><p>Let <var title="">body</var> be the uncompiled script body in the <a href=#internal-raw-uncompiled-handler>internal raw
uncompiled handler</a>.</li>

Expand Down Expand Up @@ -71831,15 +71832,20 @@ typedef <a href=#onbeforeunloadeventhandlernonnull>OnBeforeUnloadEventHandlerNon

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

</dl><!-- SCRIPT EXEC --><p>Let this new function be a new <a href=#concept-script title=concept-script>script</a>'s <a href=#code-entry-point>code
entry-point</a>.</p>
</dl><p>Let <var title="">function</var> be this new function.</p>

</li>

<li><p>Let that <a href=#concept-script title=concept-script>script</a>'s <a href=#settings-object>settings object</a> be
<li><p>Let <var title="">script</var> be a new <a href=#concept-script title=concept-script>script</a>.</li>

<!-- SCRIPT EXEC -->
<li><p>Let <var title="">script</var>'s <a href=#code-entry-point>code entry-point</a> be <var title="">function</var>.</li>

<!--CLEANUP-->
<li><p>Let <var title="">script</var>'s <a href=#settings-object>settings object</a> be
<var title="">script settings</var>.</li>

<li><p>Set <var title="">H</var> to the aforementioned function.</li>
<li><p>Set <var title="">H</var> to <var title="">function</var>.</li>

</ol></li>

Expand Down
31 changes: 19 additions & 12 deletions source
Expand Up @@ -79885,10 +79885,9 @@ dictionary <dfn>ErrorEventInit</dfn> : <span>EventInit</span> {

<div class="impl">

<!--CLEANUP-->
<p>When an <span data-x="event handler content attributes">event handler content attribute</span>
is set, if the element is owned by a <code>Document</code> that is in a <span>browsing
context</span>, and <span data-x="concept-bc-script">scripting is enabled</span> for that
<span>browsing context</span>, the user agent must set the corresponding <span data-x="event
is set, the user agent must set the corresponding <span data-x="event
handlers">event handler</span> to an <span>internal raw uncompiled handler</span> consisting of
the attribute's new value and the script location where the attribute was set to this value</p>

Expand All @@ -79900,10 +79899,6 @@ dictionary <dfn>ErrorEventInit</dfn> : <span>EventInit</span> {
see http://www.w3.org/Bugs/Public/show_bug.cgi?id=7626#c5 for reasoning
-->

<p class="note">When an <span data-x="event handler content attributes">event handler content
attribute</span> is set on an element owned by a <code>Document</code> that is not in a
<span>browsing context</span>, the corresponding event handler is not changed.</p>

<hr>

<p>When an <span data-x="event handlers">event handler</span> <var data-x="">H</var> of an element
Expand Down Expand Up @@ -80144,6 +80139,12 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent

</li>

<li><p>If <!--<var data-x="">element</var> is not null and--> <var data-x="">document</var> is
not in a <span>browsing context</span>, or if <span data-x="concept-bc-script">scripting is
enabled</span> for <var data-x="">document</var>'s <span>browsing context</span>, then return
null and abort the algorithm for <span>getting the current value of the event
handler</span>.</p></li>

<li><p>Let <var data-x="">body</var> be the uncompiled script body in the <span>internal raw
uncompiled handler</span>.</p></li>

Expand Down Expand Up @@ -80279,16 +80280,22 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent

</dl>

<!-- SCRIPT EXEC -->
<p>Let this new function be a new <span data-x="concept-script">script</span>'s <span>code
entry-point</span>.</p>
<p>Let <var data-x="">function</var> be this new function.</p>

</li>

<li><p>Let that <span data-x="concept-script">script</span>'s <span>settings object</span> be
<li><p>Let <var data-x="">script</var> be a new <span
data-x="concept-script">script</span>.</p></li>

<!-- SCRIPT EXEC -->
<li><p>Let <var data-x="">script</var>'s <span>code entry-point</span> be <var
data-x="">function</var>.</p></li>

<!--CLEANUP-->
<li><p>Let <var data-x="">script</var>'s <span>settings object</span> be
<var data-x="">script settings</var>.</p></li>

<li><p>Set <var data-x="">H</var> to the aforementioned function.</p></li>
<li><p>Set <var data-x="">H</var> to <var data-x="">function</var>.</p></li>

</ol>

Expand Down

0 comments on commit da64092

Please sign in to comment.