[webkit-changes] [WebKit/WebKit] 79d2de: Add shadowrootclonable and align with declarative ...
Anne van Kesteren
noreply at github.com
Thu Feb 15 05:36:06 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 79d2dec92caef6f7df33125ab34bd70e36c982c2
https://github.com/WebKit/WebKit/commit/79d2dec92caef6f7df33125ab34bd70e36c982c2
Author: Anne van Kesteren <annevk at annevk.nl>
Date: 2024-02-15 (Thu, 15 Feb 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-name-shadow.html
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-name-shadow.html
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/w3c-import.log
M LayoutTests/imported/w3c/web-platform-tests/shadow-dom/shadow-root-clonable-expected.txt
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Element.h
M Source/WebCore/html/HTMLAttributeNames.in
M Source/WebCore/html/HTMLTemplateElement.cpp
M Source/WebCore/html/parser/HTMLConstructionSite.cpp
Log Message:
-----------
Add shadowrootclonable and align with declarative shadow root changes
https://bugs.webkit.org/show_bug.cgi?id=269361
Reviewed by Ryosuke Niwa.
This makes the following changes:
- Adds the new shadowrootclonable attribute to opt into a declarative
shadow root being clonable.
- As a result, declarative shadow roots are no longer clonable by
default. Web developers will have to explicitly opt in.
- When attachShadow() is called on a shadow host with an existing
declarative tree, throw if mode is a mismatch.
- In attachShadow() throw first for mode being set to "user-agent" as
this is to be caught by the binding layer in theory.
- And finally, only attach a declarative shadow root successfully for
the first template element.
New tests are upstreamed here:
https://github.com/web-platform-tests/wpt/pull/44568
Specification changes are here (not all have landed yet as various nits
are still being addressed, but all have agreement):
- https://github.com/whatwg/html/pull/10117
- https://github.com/whatwg/html/pull/10069
- https://github.com/whatwg/dom/pull/1246
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-name-shadow.html:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-name-shadow.html:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/shadow-root-clonable-expected.txt:
* Source/WebCore/dom/Element.cpp:
* Source/WebCore/dom/Element.h:
* Source/WebCore/html/HTMLAttributeNames.in:
* Source/WebCore/html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::attachAsDeclarativeShadowRootIfNeeded):
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLTemplateElement):
Canonical link: https://commits.webkit.org/274727@main
More information about the webkit-changes
mailing list