Re: [whatwg/dom] Composed and non bubbling event semantic dispatched in shadow tree (#742)

here is a very concrete example of the problem:

```html
<div>
    #shadowRoot 
       <div>
            <x-foo>
```

If component `<x-foo>` dispatches an custom event with `{ composed: true, bubbles: false }` via `this.dispatchEvent()`, it is extremely confusing that the event is observable from the outer div, but it is not observable by the inner div. From the teachability point of view, how do you teach that? It breaks all intuitions as far as I can tell.

From the technical point of view, the leaking aspect of it is pretty bad because the only way you have to prevent an event from leaking is by listening for it at the host level (during construction time), and stop immediate propagation, and you have to do so for all events dispatched by any of your child components in order to control the leakage, and still, there is a possibility that the host was upgraded after a listener for the event was added by someone else, in which case, you have no ways to prevent the leakage.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/742#issuecomment-477153927

Received on Wednesday, 27 March 2019 13:29:08 UTC