Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbfaf8556c9e9733968bd24de9b9fe602f5ee974
      
https://github.com/WebKit/WebKit/commit/cbfaf8556c9e9733968bd24de9b9fe602f5ee974
  Author: Ryosuke Niwa <[email protected]>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/CustomElementRegistry-initialize-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/CustomElementRegistry-initialize.html
    A 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window.html
    A 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window.js
    A 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize.html
    M Source/WebCore/dom/CustomElementRegistry.cpp
    M Source/WebCore/dom/CustomElementRegistry.h
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/DocumentFragment.cpp

  Log Message:
  -----------
  CustomElementRegistry.prototype.initialize doesn't work on a single element
https://bugs.webkit.org/show_bug.cgi?id=291723

Reviewed by Anne van Kesteren.

Fix the bug in CustomElementRegistry::initialize which wasn't updating the 
registry of the root when it's not a shadow root.

This PR also changes so that Document now sets 
setUsesNullCustomElementRegistry() when it does not have a browsing context,
and fixes Document::createElement and friends to propagate the null registry 
status from Document to a newly created element.

Finally, this PR makes Document::customElementRegistryForBindings fallback to 
TreeScope::customElementRegistry() when no
LocalDOMWindow is associated with the document (i.e. registry is manually set 
by CustomElementRegistry::initialize).

This PR imports a WPT added in 
https://github.com/web-platform-tests/wpt/pull/52045 and updated in
https://github.com/web-platform-tests/wpt/pull/51976 and adds another WPT for 
more comprehensive testing of
CustomElementRegistry.prototype.initialize and customElementRegistry getter on 
Document and Element.

* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/pseudo-class-defined.window.js:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-registry-initialize.html:
 Added.
* Source/WebCore/dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::initialize):
* Source/WebCore/dom/CustomElementRegistry.h:
(WebCore::CustomElementRegistry::registryForNodeOrTreeScope):
* Source/WebCore/dom/Document.cpp:
(WebCore::m_syncData):
(WebCore::createUpgradeCandidateElement):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createElement):
(WebCore::Document::customElementRegistryForBindings):
(WebCore::Document::createElementNS):
* Source/WebCore/dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::DocumentFragment):

Canonical link: https://commits.webkit.org/293968@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to