- From: Lea Verou <notifications@github.com>
- Date: Thu, 30 Jul 2026 09:53:44 -0700
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/1219/5133794585@github.com>
LeaVerou left a comment (w3ctag/design-reviews#1219) It would be good for the TAG to take a closer look at this because it is about to get prototyped in UAs. I have severe reservations about how this fits in with broader web architecture which I have expressed [here](https://github.com/whatwg/html/issues/12150#issuecomment-5133106649). TL;DR: - This is introducing a parallel primitive for traits, which is a problem that should be solved at the language level (and _is_ being worked on at TC39). - JS has no primitive for traits right now, which would be the appropriate primitive for some of these. Rather than trying to invent JS traits ad hoc in HTML, IMO the best course forwards is to **find what the low-level missing capabilities are** and expose them separately. Not as a terminal solution, but as an intermediate way to solve the immediate pain points, and as a result buy us more time to eventually expose a nicer API. - A lot of these use cases are fundamentally inheritance use cases. A button with some additional functionality is fundamentally an `HTMLButtonElement`, not an `HTMLElement` with an `HTMLButtonBehavior`! I think it's worth putting more effort in exploring how we can support inheritance (on the JS side, NOT the current Customizable built-ins API which is severely flawed and veto-ed by Apple). This extends to not just "how can we make `MyElement extends HTMLButtonElement` work?" but also "How can we make composable shadow roots work?" or "How can we make `ElementInternals` access work?". These are all questions we'll have to answer eventually _anyway_, for custom attributes and traits too, so kicking the can down the road doesn't help. -- Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/1219#issuecomment-5133794585 You are receiving this because you are subscribed to this thread. Message ID: <w3ctag/design-reviews/issues/1219/5133794585@github.com>
Received on Thursday, 30 July 2026 16:53:48 UTC