- From: Helmut Januschka <notifications@github.com>
- Date: Mon, 09 Nov 2026 05:03:28 -0800
- To: w3c/uievents <uievents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/uievents/issues/423@github.com>
hjanuschka created an issue (w3c/uievents#423)
### Problem
UI Events (and the event-algo draft) does not specify what happens to
the synthetic `click` event when the element the `mousedown` was
dispatched on is removed from the tree before `mouseup`.
Implementations diverge in subtle ways, and Blink has an unspecified
carve-out that fires `click` on the originating element when the
removed `mousedown` target was a pseudo-element.
### Repro
An SVG `<use>` whose `href` is changed from its own `mousedown` handler
tears down the shadow instance tree the hit test landed in. After the
mouseup, there is no shared ancestor and no `click` fires.
```html
<svg>
<use href="#a" id="u" onmousedown="u.setAttribute('href', '#b')"
onclick="log('click')"/>
<circle id="a" r="20"/>
<circle id="b" r="20" fill="red"/>
</svg>
```
Expected: `click` fires on `<use>`. Observed in Blink: no `click`
(a fix is under review at https://crrev.com/c/8558402). Gecko/WebKit
behavior TBD, would appreciate confirmation.
### Questions
1. Should `click` fire when the `mousedown` target has been removed but
a stable author-visible ancestor (shadow host, originating element)
still exists?
2. If yes, what is the target? The nearest connected ancestor in the
flat tree? The shadow host? The originating element for pseudos?
3. Should the pseudo-element fallback currently in Blink be lifted into
the spec, or is it legacy-only?
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/423
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/uievents/issues/423@github.com>
Received on Monday, 9 November 2026 13:03:32 UTC