Skip to content

event.composedPath() may return different results if DOM is modified between two calls #525

@smaug----

Description

@smaug----

If I read the spec right, composedPath() relies on the current tree structure to figure out what to return.
So, if a listener does then something like

var cp = event.composedPath();
/*move nodes around*/
var cp2 = event.composedPath();

cp and cp2 may contain different nodes, which is surprising, since the internal path for the event hasn't changed.
In particular, relying on "shadow-including inclusive ancestor" in https://dom.spec.whatwg.org/#concept-closed-shadow-hidden in https://dom.spec.whatwg.org/#dom-event-composedpath looks wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions