Re: [w3c/uievents] Add .pseudoTarget property to selected event types (PR #413)

@dbaron commented on this pull request.



> @@ -54,6 +54,47 @@
 
   </div><!-- algorithm -->
 
+ <h3 id="pseudo-element-event-dispatch">Pseudo-Element Event Dispatch</h3>
+
+  When the target of a user interaction is a [=pseudo-element=], the
+  {{MouseEvent/pseudoTarget}}, {{FocusEvent/pseudoTarget}}, or
+  {{KeyboardEvent/pseudoTarget}} attribute is set to identify the specific pseudo-element involved.
+
+  <div class="algorithm" data-algorithm="set-pseudo-target-for-event">
+  <h4 id="set-pseudo-target-for-event-id"><dfn>set pseudo-target for event</dfn></h4>
+
+   : Input
+   :: |event|, the event being dispatched ({{MouseEvent}}, {{FocusEvent}}, or {{KeyboardEvent}})

What is the rationale for adding to just these three event types?

It seems like if you are adding to `MouseEvent` you may also want to add to `TouchEvent`.  And, similarly, if you're adding to `KeyboardEvent` you may also want to add to `TextEvent` and `CompositionEvent`.  And at that point I think you'd be adding to either all or nearly all the classes that derive from `UIEvent` so it might make sense to add only to `UIEvent`.

> +
+   1. Let |pseudoInstance| be the result of calling |originatingElement|.<code>pseudo(|type|)</code>
+
+    <p class="note">
+    This step ensures that |pseudoInstance| is the canonical {{CSSPseudoElement}} object
+    for that pseudo-element. It must be the same object instance that would be returned
+    by calling <code>originatingElement.pseudo(type)</code>.
+    </p>
+
+   1. Set |event|'s <code>pseudoTarget</code> attribute to |pseudoInstance|
+
+  </div><!-- algorithm -->
+
+  <p class="note">
+  The hit testing algorithm used to determine which element or pseudo-element
+  is at a given point is implementation-defined. When the result of hit testing

This feels like it might be a little bit too strongly undefined, given that https://www.w3.org/TR/uievents/#hit-test-id is at least somewhat defined, and it refers to things that at least say that they hope to be defined in a future specification.  It might be good to at least be a little more optimistic about defining it in the future (which will also help this text not contradict any future definition).

> @@ -55,6 +55,13 @@ url: https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint; type: d
  text: elementFromPoint
 url: https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint; type: dfn; spec: cssom-view
  text: elementsFromPoint
+<!-- CSS Pseudo-Elements -->

I'm a little surprised these are necessary as anchors?  Is it possible for them to be link-defaults instead (if the problem was that there were multiple possible definitions)?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/pull/413#pullrequestreview-3740824026
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/uievents/pull/413/review/3740824026@github.com>

Received on Monday, 2 February 2026 17:21:08 UTC