webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.13k stars 166 forks source link

[ShadyDOM] `event.eventPhase` can be incorrect #471

Closed sorvell closed 2 years ago

sorvell commented 2 years ago

Description

When an event is re-targeted, its eventPhase should typically be AT_TARGET. ShadyDOM is not currently handling this correctly.

Example

Expected behavior

eventPhase should be AT_TARGET (2) for elements in the composedPath() that have a shadowRoot that is also in the composedPath.

Actual behavior

eventPhase is either BUBBLING_PHASE (3) or CAPTURING_PHASE (1) for these elements.