Skip to content

Conversation

@rniwa
Copy link
Contributor

@rniwa rniwa commented Nov 14, 2025

No description provided.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Looks good, but console.log issue needs to be addressed.

<body>
<script>

function runTest(title, makeDocument, makeCustomElementRegistry) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: we don't need makeCustomElementRegistry it seems as it's always the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, removed.


const registry2 = makeCustomElementRegistry();
undefinedElement2 = doc1.createElementNS(htmlNS, 'a-b', {customElementRegistry: registry2});
console.log(undefinedElement2);
Copy link
Member

Choose a reason for hiding this comment

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

console.log should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, removed.

@rniwa rniwa force-pushed the add-scoped-custom-element-registry-initialize-upgrade-test branch from 8c2b5ba to 10333de Compare November 19, 2025 00:56
@rniwa rniwa merged commit 8293902 into web-platform-tests:master Nov 19, 2025
24 checks passed
@rniwa rniwa deleted the add-scoped-custom-element-registry-initialize-upgrade-test branch November 19, 2025 01:09
registry.define('a-b', class ABElement extends HTMLElement { });
assert_equals(element.customElementRegistry, null);
registry.initialize(element);
assert_equals(element.customElementRegistry, registry);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also want to assert that element is an instance of ABElement here?

@ja-y-son
Copy link
Contributor

Like mentioned in whatwg/html#11913 (comment), we probably want to add a test to verify that the descendant with the same registry also gets upgraded in the initialize call.

annevk added a commit to whatwg/html that referenced this pull request Nov 21, 2025
CustomElementRegistry's upgrade() wasn't adjusted for scoped registries and we decided that initialize() should upgrade as well (but not into shadow trees as upgrade() does).

The initialize() design here favors a single tree traversal for setting the registry and then upgrading the element.

Tests:
- web-platform-tests/wpt#56034
- web-platform-tests/wpt#56132

Fixes #11858 and fixes #11908.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants