Skip to content
Browse files

Introduce redispatching so seamless <iframe>s can bleed events to the…

…ir parent. Possibly useful for Shadow DOM too?

Might fix https://www.w3.org/Bugs/Public/show_bug.cgi?id=18780
  • Loading branch information...
1 parent 58d3391 commit 22ce02cb28a5225355883c4d77a3f3b1f257d820 @annevk annevk committed Nov 23, 2012
Showing with 58 additions and 22 deletions.
  1. +28 −10 Overview.src.html
  2. +30 −12 dom-core.html
View
38 Overview.src.html
@@ -1198,9 +1198,20 @@ <h2 class=no-num>Goals</h2>
<h3>Dispatching events</h3>
+<p>Specifications may define
+<dfn title=concept-event-redispatch>redispatching steps</dfn> to make it
+possible to <span title=concept-event-dispatch>dispatch</span> across
+distinct <span title=concept-tree>trees</span>. The
+<span title=concept-event-redispatch>redispatching steps</span> are passed a
+copy of the <span title=concept-event>event</span> that is dispatched and
+are only invoked if the
+<span title=concept-event-redispatch>redispatching steps</span> algorithm is
+passed to the <span title=concept-event-dispatch>dispatch</span> algorithm.
+
<p>To <dfn title=concept-event-dispatch>dispatch</dfn> an
-<span title=concept-event>event</span> to a given object run these steps:
-<!-- other specifications turn this into a requirement -->
+<span title=concept-event>event</span> to a given object, optionally with
+<span title=concept-event-redispatch>redispatching steps</span>, run these
+steps:
<ol>
<li><p>Let <var title>event</var> be the
@@ -1231,15 +1242,22 @@ <h2 class=no-num>Goals</h2>
<var title>event</var>, as long as <var title>event</var>'s
<span>stop propagation flag</span> is unset.
- <li><p>Initialize <var title>event</var>'s
- <code title=dom-Event-eventPhase>eventPhase</code> attribute to
- <code title=dom-Event-AT_TARGET>AT_TARGET</code>.
+ <li>
+ <p>If the <span title=concept-event-redispatch>redispatching steps</span>
+ are given, run them with a copy of <var title>event</var> and then go to
+ the next step. Otherwise run these substeps first:
- <li><p><span title=concept-event-listener-invoke>Invoke</span> the
- <span title=concept-event-listener>event listeners</span> of
- <var title>event</var>'s <code title=dom-Event-target>target</code>
- attribute value with <var title>event</var>, if <var title>event</var>'s
- <span>stop propagation flag</span> is unset.
+ <ol>
+ <li><p>Initialize <var title>event</var>'s
+ <code title=dom-Event-eventPhase>eventPhase</code> attribute to
+ <code title=dom-Event-AT_TARGET>AT_TARGET</code>.
+
+ <li><p><span title=concept-event-listener-invoke>Invoke</span> the
+ <span title=concept-event-listener>event listeners</span> of
+ <var title>event</var>'s <code title=dom-Event-target>target</code>
+ attribute value with <var title>event</var>, if <var title>event</var>'s
+ <span>stop propagation flag</span> is unset.
+ </ol>
<li>
<p>If <var title>event</var>'s
View
42 dom-core.html
@@ -10,7 +10,7 @@
<p><a class="logo" href="//www.whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-dom.svg" width="100"></a></p>
<h1>DOM</h1>
- <h2 class="no-num no-toc" id="living-standard-—-last-updated-19-november-2012">Living Standard — Last Updated 19 November 2012</h2>
+ <h2 class="no-num no-toc" id="living-standard-—-last-updated-23-november-2012">Living Standard — Last Updated 23 November 2012</h2>
<dl>
<dt>This Version:
@@ -42,7 +42,7 @@ <h2 class="no-num no-toc" id="living-standard-—-last-updated-19-november-2012"
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editors have waived all copyright and
related or neighboring rights to this work. In addition, as of
-19 November 2012, the editors have made this specification available
+23 November 2012, the editors have made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
@@ -1263,9 +1263,20 @@ <h3 id="interface-eventtarget"><span class="secno">4.5 </span>Interface <code><a
<h3 id="dispatching-events"><span class="secno">4.6 </span>Dispatching events</h3>
+<p>Specifications may define
+<dfn id="concept-event-redispatch" title="concept-event-redispatch">redispatching steps</dfn> to make it
+possible to <a href="#concept-event-dispatch" title="concept-event-dispatch">dispatch</a> across
+distinct <a href="#concept-tree" title="concept-tree">trees</a>. The
+<a href="#concept-event-redispatch" title="concept-event-redispatch">redispatching steps</a> are passed a
+copy of the <a href="#concept-event" title="concept-event">event</a> that is dispatched and
+are only invoked if the
+<a href="#concept-event-redispatch" title="concept-event-redispatch">redispatching steps</a> algorithm is
+passed to the <a href="#concept-event-dispatch" title="concept-event-dispatch">dispatch</a> algorithm.
+
<p>To <dfn id="concept-event-dispatch" title="concept-event-dispatch">dispatch</dfn> an
-<a href="#concept-event" title="concept-event">event</a> to a given object run these steps:
-<!-- other specifications turn this into a requirement -->
+<a href="#concept-event" title="concept-event">event</a> to a given object, optionally with
+<a href="#concept-event-redispatch" title="concept-event-redispatch">redispatching steps</a>, run these
+steps:
<ol>
<li><p>Let <var title="">event</var> be the
@@ -1296,15 +1307,22 @@ <h3 id="dispatching-events"><span class="secno">4.6 </span>Dispatching events</h
<var title="">event</var>, as long as <var title="">event</var>'s
<a href="#stop-propagation-flag">stop propagation flag</a> is unset.
- <li><p>Initialize <var title="">event</var>'s
- <code title="dom-Event-eventPhase"><a href="#dom-event-eventphase">eventPhase</a></code> attribute to
- <code title="dom-Event-AT_TARGET"><a href="#dom-event-at_target">AT_TARGET</a></code>.
+ <li>
+ <p>If the <a href="#concept-event-redispatch" title="concept-event-redispatch">redispatching steps</a>
+ are given, run them with a copy of <var title="">event</var> and then go to
+ the next step. Otherwise run these substeps first:
- <li><p><a href="#concept-event-listener-invoke" title="concept-event-listener-invoke">Invoke</a> the
- <a href="#concept-event-listener" title="concept-event-listener">event listeners</a> of
- <var title="">event</var>'s <code title="dom-Event-target"><a href="#dom-event-target">target</a></code>
- attribute value with <var title="">event</var>, if <var title="">event</var>'s
- <a href="#stop-propagation-flag">stop propagation flag</a> is unset.
+ <ol>
+ <li><p>Initialize <var title="">event</var>'s
+ <code title="dom-Event-eventPhase"><a href="#dom-event-eventphase">eventPhase</a></code> attribute to
+ <code title="dom-Event-AT_TARGET"><a href="#dom-event-at_target">AT_TARGET</a></code>.
+
+ <li><p><a href="#concept-event-listener-invoke" title="concept-event-listener-invoke">Invoke</a> the
+ <a href="#concept-event-listener" title="concept-event-listener">event listeners</a> of
+ <var title="">event</var>'s <code title="dom-Event-target"><a href="#dom-event-target">target</a></code>
+ attribute value with <var title="">event</var>, if <var title="">event</var>'s
+ <a href="#stop-propagation-flag">stop propagation flag</a> is unset.
+ </ol>
<li>
<p>If <var title="">event</var>'s

0 comments on commit 22ce02c

Please sign in to comment.
Something went wrong with that request. Please try again.