Re: [whatwg/dom] Redesign fire an event and target override (#344)

domenic approved this pull request.

All nits and suggestions. Overall a definite improvement.

>  
 <ol>
  <li><p>Set <var>event</var>'s <a>dispatch flag</a>.
 
  <li>
-  <p>If <var>targetOverride</var> is not given, let <var>targetOverride</var> be <var>target</var>.
+  <p>Let <var>targetOverride</var> be <var>target</var>, if <var>legacy target override flag</var>

Nit: I think "**the** _legacy target override flag_" is more consistent with what we've done so far.

> @@ -1379,14 +1379,25 @@ an <var>object</var> with <var>event</var>, run these steps:
 
 <h3 id=firing-events>Firing events</h3>
 
-To
-<dfn export id=concept-event-fire lt="fire an event">fire an event named <var>e</var></dfn>
-means that a new <a>event</a> using the
-{{Event}} interface, with its
-{{Event/type}} attribute initialized to
-<var>e</var>, and its {{Event/isTrusted}}
-attribute initialized to <code>true</code>, is to be
-<a>dispatched</a> to the given object.
+<p>To <dfn export id=concept-event-fire lt="fire an event">fire an event</dfn> named <var>e</var> at
+<var>target</var>, optionally given an <var>eventClass</var>, a description of how IDL attributes
+are to be initialized, and a <var>legacy target override flag</var>, run these steps:
+
+<ol>
+ <li><p>If <var>eventClass</var> is not given ,let <var>eventClass</var> be {{Event}}.

misplaced space before comma

> @@ -1379,14 +1379,25 @@ an <var>object</var> with <var>event</var>, run these steps:
 
 <h3 id=firing-events>Firing events</h3>
 
-To
-<dfn export id=concept-event-fire lt="fire an event">fire an event named <var>e</var></dfn>
-means that a new <a>event</a> using the
-{{Event}} interface, with its
-{{Event/type}} attribute initialized to
-<var>e</var>, and its {{Event/isTrusted}}
-attribute initialized to <code>true</code>, is to be
-<a>dispatched</a> to the given object.
+<p>To <dfn export id=concept-event-fire lt="fire an event">fire an event</dfn> named <var>e</var> at

This lt="" is now unnecessary

> @@ -1379,14 +1379,25 @@ an <var>object</var> with <var>event</var>, run these steps:
 
 <h3 id=firing-events>Firing events</h3>
 
-To
-<dfn export id=concept-event-fire lt="fire an event">fire an event named <var>e</var></dfn>
-means that a new <a>event</a> using the
-{{Event}} interface, with its
-{{Event/type}} attribute initialized to
-<var>e</var>, and its {{Event/isTrusted}}
-attribute initialized to <code>true</code>, is to be
-<a>dispatched</a> to the given object.
+<p>To <dfn export id=concept-event-fire lt="fire an event">fire an event</dfn> named <var>e</var> at
+<var>target</var>, optionally given an <var>eventClass</var>, a description of how IDL attributes

Maybe eventInterface is more accurate? I dunno, I want to use JS terms, but this is kind of Web IDL land. Could go either way.

> +
+<ol>
+ <li><p>If <var>eventClass</var> is not given ,let <var>eventClass</var> be {{Event}}.
+
+ <li><p>Let <var>event</var> be a new <a>event</a> using <var>eventClass</var>.
+
+ <li><p>Initialize <var>event</var>'s {{Event/type}} attribute to <var>e</var>.
+
+ <li><p>Initialize <var>event</var>'s {{Event/isTrusted}} attribute to true.
+
+ <li><p>Initialize any other IDL attributes of <var>event</var> as described in the invocation of
+ this algorithm.
+
+ <li><p>Return the result of <a>dispatching</a> <var>event</var> at <var>target</var>, with
+ <var>legacy target override flag</var> set if set.
+</ol>
 
 <p class="note no-backref">Fire in the context of DOM is short for creating, initializing,

It might be worth adding a more complex example that uses eventClass and initializes some extra attributes, and possibly uses the return value.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/344#pullrequestreview-4140339

Received on Thursday, 13 October 2016 18:56:12 UTC