Re: [w3c/webcomponents] Events whose composed flag should be true (#513)

I've looked at this change for [the TouchEvents PR](https://github.com/w3c/touch-events/pull/67).  Since TouchEvents and PointerEvents are just sub-classes of UIEvents I think we'll be happy to follow whatever pattern is decided on there.  Probably not worth debating the issue for TouchEvents and PointerEvents specifically until a PR is approved for UIEvents.

I don't know much about ShadowDOM, so please excuse my ignorance. At first I thought it was odd that we'd need to explicitly specify that most types of UIEvent have `composed=true`, it would seem nicer if we could just specify the behavior by interface (and then eg. `PointerEvent` would inherit the behavior of `MouseEvent`).  It looks like this is what @rniwa was advocating, right?  But I understand @domenic's concern that that would be unusual.

Are there compat concerns to consider with the two different options here?  It's common to synthesize a `MouseEvent` from JavaScript, and in general we can expect that developers won't think to set `composed=true` on such events (and certainly won't have for existing code).  Is that a problem at all?  Or perhaps it actually makes sense that JS-synthesized input events typically would not cross shadow DOM boundaries (since the code generating the event is operating at one particular component boundary, unless it explicitly knows to poke down into ShadowDOM)?  In that case we can avoid encouraging the use of `composed=true` for synthetic events, except in scenarios where the developer is really trying to reason across component boundaries.

Note a variant of this problem exists today with `bubbles`.  I often see developers (especially those use to the legacy `TouchEvent.initTouchEvent` API) forget to set `bubbles=true` when creating synthetic input events (of course touch events should bubble!).  But that's obviously unlikely to change...

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/513#issuecomment-227552461

Received on Tuesday, 21 June 2016 19:54:50 UTC