Re: [whatwg/dom] Define special dispatch behavior for click events (#342)

foolip commented on this pull request.



> @@ -1028,6 +1028,22 @@ specified otherwise it returns null.
 <p class="note no-backref"><a>Nodes</a>, <a for=/>shadow roots</a>, and <a>documents</a> override
 the <a>get the parent</a> algorithm.
 
+<p>Each {{EventTarget}} object can have an associated
+<dfn export for=EventTarget>activation behavior</dfn> algorithm. The <a>activation behavior</a>

Should the concept be dropped from HTML in favor of this? It becomes a bit weird to have activation behavior for both elements and event targets.

> @@ -1204,6 +1220,9 @@ for discussion).
  <li><p>Append (<var>target</var>, <var>targetOverride</var>, <var>relatedTarget</var>) to <var>event</var>'s
  <a for=Event>path</a>.
 
+ <li><p>Let <var>activationTarget</var> be <var>target</var>, if <var>target</var> has

No comma before if. ("Let relatedTarget be the result of retargeting event’s relatedTarget against target if event’s relatedTarget is non-null, and null otherwise.")

> @@ -1280,6 +1321,20 @@ for discussion).
 
  <li><p>Set <var>event</var>'s <a for=Event>path</a> to the empty list.
 
+ <li>
+  <p>If <var>event</var> is a {{MouseEvent}} object, <var>event</var>'s {{Event/type}} attribute is

Maybe factor out the condition into a variable? I'm pretty sure an implementation would, and it makes it very clear that there's no case where *activationTarget* has changed in the interim to consider.

> @@ -1280,6 +1321,20 @@ for discussion).
 
  <li><p>Set <var>event</var>'s <a for=Event>path</a> to the empty list.
 
+ <li>
+  <p>If <var>event</var> is a {{MouseEvent}} object, <var>event</var>'s {{Event/type}} attribute is
+  "<code>click</code>", and <var>activationTarget</var> is non-null, then:
+
+  <ol>
+   <li><p>If <var>event</var>'s <a>canceled flag</a> is unset and <var>activationTarget</var> has
+   <a>activation behavior</a>, then run <var>activationTarget</var>'s <a>activation behavior</a>

Doesn't *activationTarget* always have activation behavior, given the conditions where it's assigned?

-- 
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/342#pullrequestreview-4258510

Received on Friday, 14 October 2016 12:41:37 UTC