[webkit-changes] [WebKit/WebKit] d7d926: Add cloneable flag to ShadowRootInit

Ryosuke Niwa noreply at github.com
Thu Dec 15 23:52:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d7d9268e700a19cd1b06de3920229b83f9071ad9
      https://github.com/WebKit/WebKit/commit/d7d9268e700a19cd1b06de3920229b83f9071ad9
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    A LayoutTests/fast/shadow-dom/cloneable-shadow-root-expected.txt
    A LayoutTests/fast/shadow-dom/cloneable-shadow-root.html
    M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic.tentative-expected.txt
    M LayoutTests/platform/win/TestExpectations
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ShadowRoot.cpp
    M Source/WebCore/dom/ShadowRoot.h
    M Source/WebCore/dom/ShadowRootInit.h
    M Source/WebCore/dom/ShadowRootInit.idl
    M Source/WebCore/html/parser/HTMLConstructionSite.cpp

  Log Message:
  -----------
  Add cloneable flag to ShadowRootInit
https://bugs.webkit.org/show_bug.cgi?id=249369

Reviewed by Chris Dumez.

Add the support for cloneable boolean flag on ShadowRootInit. ShadowRoot and its descendant nodes becomes cloneable
when this flag is set. The flag is set by default for declarative shadow DOM.

See https://github.com/whatwg/dom/issues/1137 for discussion.

* LayoutTests/fast/shadow-dom/cloneable-shadow-root-expected.txt: Added.
* LayoutTests/fast/shadow-dom/cloneable-shadow-root.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic.tentative-expected.txt:
* LayoutTests/platform/win/TestExpectations

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::cloneNodeInternal):
(WebCore::Element::cloneShadowTreeIfPossible): Added.
(WebCore::Element::cloneElementWithChildren):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ShadowRoot.cpp:s
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::childrenChanged):
(WebCore::ShadowRoot::cloneNodeInternal): Added the implementation.
* Source/WebCore/dom/ShadowRoot.h:
(WebCore::ShadowRoot): Renamed m_type to m_mode for consistency & clarity.
* Source/WebCore/dom/ShadowRootInit.h:
* Source/WebCore/dom/ShadowRootInit.idl:
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLTemplateElement): Allow declarative shadow DOM inside in a template content.

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




More information about the webkit-changes mailing list