event.composedPath() returns the complete ordered path an event follows as it bubbles, from its origin through containing elements to Window. Unlike event.target and event.currentTarget, it reveals the event’s propagation route. section 14.3
Inspecting a button click
A document-level click listener can log e.composedPath(). For a regular Web Component, the path is [button, sample-component, body, html, document, Window]. With Shadow DOM, the path includes the document fragment and shows how the event crosses the component boundary.
