This feature introduces "Platform-Provided Behaviors" to ElementInternals, allowing custom elements to adopt native behaviors without extending native elements or reimplementing complex logic. It adds a behaviors static class property that declares which behaviors the platform attaches to instances of the class. attachInternals() is the web author's access route to those already-existing instances, exposed through a new behaviors collection on ElementInternals
Custom element authors can't access native behaviors that are built into native HTML elements. This forces them to either: 1. Use customized built-ins (is/extends syntax), which have Shadow DOM limitations and can't use the ElementInternals API. 2. Try to reimplement native logic in JavaScript, which is error-prone, often less performant, and can't replicate certain platform-internal behaviors (notably pseudo-classes and native focusability algorithms). 3. Accept that their custom elements simply can't do what native elements can do. This creates a gap between what's possible with native elements and custom elements, limiting web components and forcing developers into suboptimal patterns.
Docs: https://docs.google.com/document/d/1LA1hhzxmi4OmZoGtIdnwvL3g7y48YjXTOoUvFtxFugE/edit?usp=sharing
Samples: https://microsoftedge.github.io/Demos/platform-provided-behaviors-for-custom-elements
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PlatformProvidedBehaviors/explainer.md