Skip to content

Chrome 146 / Safari 26 add createElement option customElementRegistry#29216

Open
hamishwillee wants to merge 1 commit intomdn:mainfrom
hamishwillee:document_createlement_options_customeelementregistry
Open

Chrome 146 / Safari 26 add createElement option customElementRegistry#29216
hamishwillee wants to merge 1 commit intomdn:mainfrom
hamishwillee:document_createlement_options_customeelementregistry

Conversation

@hamishwillee
Copy link
Contributor

There is a new option customElementRegistry to the options parameter that can be passed to Document.createElement() or Document.createElementNS().

According to https://developer.chrome.com/blog/scoped-registries?hl=en#scope_to_an_individual_element support was added in Chrome 146 and Safari 26 - that seems likely for Safari from https://webkit.org/blog/17674/release-notes-for-safari-technology-preview-234/ and from the related APIs such as https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/CustomElementRegistry

This adds both an options.customElementRegistry and options.is parameter to the two methods. The assumption is that is was supported in Chrome from start (seems likely), and from Safari in 26. I can't see information confirming this for Safari, but I think it likely.

Note, no evidence Firefox supports either yet.

This fell out of work being done for

@github-actions github-actions bot added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:l [PR only] 101-1000 LoC changed labels Mar 10, 2026
@github-actions
Copy link
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

"opera": "mirror",
"opera_android": "mirror",
"safari": {
"version_added": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming Safari supports the subfeatures:

Suggested change
"version_added": "26"

The collector test for createElementNS passes in Safari 26.3. The test for options_parameter fails, but it only tests the is option.

"opera": "mirror",
"opera_android": "mirror",
"safari": {
"version_added": "26"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://collector.openwebdocs.org/tests/api/Document/createElementNS, is is not supported.

In Webkit, ElementCreationOptions only has a single member, customElementRegistry, so is seems to be unsupported.

Suggested change
"version_added": "26"
"version_added": false

@caugner caugner changed the title Document.createElement()/Ns() - options.customElementRegistry/is Chrome 146 / Safari 26 add createElement option customElementRegistry Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:l [PR only] 101-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants