webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.13k stars 165 forks source link

[scoped-custom-element-registry] Improve issues related to `formAssociated` #581

Closed sorvell closed 4 weeks ago

sorvell commented 1 month ago

Fixes #546, #547, #580, #570, #549.

Note, bulk of changes in this commit.

The setting for a defined class' formAssociated cannot be properly polyfilled per registry. To address this, previously the polyfill always set the stand-in class to be formAssociated == true. However, this caused a series of subtle issues.

Instead, it is now set to whatever the first defined tag name's formAssociated is set. It's also possible to reserve a given name to always be formAssociated by adding it to customElementRegistryPolyfill.formAssociated.add(tagName).

Unconditionally installs polyfill.

Adds registry to ShadowRootInit

google-cla[bot] commented 1 month ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.