Skip to content

Commit

Permalink
Define event constructing steps
Browse files Browse the repository at this point in the history
This hook can be used by complex Event subclasses, such as KeyboardEvent and TouchEvent, to initialize their internal state upon creation.

Follow-up: w3c/uievents#194 and w3c/touch-events#94.

Fixes #414.
  • Loading branch information
annevk authored Apr 6, 2018
1 parent 07c110c commit 4c95d89
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,14 @@ method must, when invoked, run these steps:

<h3 id=constructing-events>Constructing events</h3>

<a lt="Other applicable specifications">Specifications</a> may define
<dfn export id=concept-event-constructor-ext>event constructing steps</dfn> for all or some
<a for=/>events</a>. The algorithm is passed an <var>event</var> as indicated in the
<a>inner event creation steps</a>.

<p class=note>This construct can be used by {{Event}} subclasses that have a more complex structure
than a simple 1:1 mapping between their initializing dictionary members and IDL attributes.

<p>When a <dfn export for=Event id=concept-event-constructor>constructor</dfn> of the {{Event}}
interface, or of an interface that inherits from the {{Event}} interface, is invoked, these steps
must be run, given the arguments <var>type</var> and <var>eventInitDict</var>:
Expand Down Expand Up @@ -870,6 +878,8 @@ correct defaults.</p>
<var>event</var> has an attribute whose <a spec=webidl>identifier</a> is <var>member</var>, then
initialize that attribute to <var>value</var>.

<li><p>Run the <a>event constructing steps</a> with <var>event</var>.

<li><p>Return <var>event</var>.
</ol>

Expand Down

0 comments on commit 4c95d89

Please sign in to comment.