Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4700ae410c741d6fa2d1656ded65e85bbfe34ca8
      
https://github.com/WebKit/WebKit/commit/4700ae410c741d6fa2d1656ded65e85bbfe34ca8
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  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/Element-innerHTML-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/ShadowRoot-init-declarative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/ShadowRoot-init-declarative.html
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-custom-element-registry-customelementregistry-attribute-expected.txt
    M Source/WebCore/dom/DocumentFragment.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/ShadowRoot.cpp
    M Source/WebCore/editing/markup.cpp
    M Source/WebCore/editing/markup.h
    M Source/WebCore/html/parser/HTMLConstructionSite.cpp
    M Source/WebCore/html/parser/HTMLConstructionSite.h

  Log Message:
  -----------
  The last test case in 
custom-elements/registries/CustomElementRegistry-initialize.html fails
https://bugs.webkit.org/show_bug.cgi?id=319295

Reviewed by Anne van Kesteren.

The failure was caused by usesNullCustomElementRegistry not getting propagated 
to a node during
fragment parsing because the tree scope of a node during a fragment parsing is 
document, which
does not have usesNullCustomElementRegistry flag set like its context element. 
Propagate the flag
from the context element to the document fragment we use for parsing to fix the 
bug.

Also add a test case for constructing an element using setHTMLUnsafe inside a 
declarative shadow DOM
with null custom element registry, which was not tested by any existing test 
cases.

Tests: 
imported/w3c/web-platform-tests/custom-elements/registries/CustomElementRegistry-initialize.html
       
imported/w3c/web-platform-tests/custom-elements/registries/ShadowRoot-init-declarative.html

* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/CustomElementRegistry-initialize-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/Element-innerHTML-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/ShadowRoot-init-declarative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/ShadowRoot-init-declarative.html:
* 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/registries/scoped-custom-element-registry-customelementregistry-attribute-expected.txt:
* Source/WebCore/dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::parseHTML):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::replaceChildrenWithMarkup):
(WebCore::Element::setOuterHTML):
(WebCore::Element::insertAdjacentHTML):
* Source/WebCore/dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::replaceChildrenWithMarkup):
* Source/WebCore/editing/markup.cpp:
(WebCore::createFragmentForMarkup):
(WebCore::createFragmentForInnerOuterHTML):
(WebCore::createContextualFragment):
* Source/WebCore/editing/markup.h:
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::containerForCurrentNode):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
* Source/WebCore/html/parser/HTMLConstructionSite.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to