Skip to content

Declarative shadow trees: getInnerHTML() is non-standard - #42833

Merged
jgraham merged 3 commits into
masterfrom
annevk/declarative-shadow-trees
Oct 30, 2023
Merged

jgraham merged 3 commits into
masterfrom
annevk/declarative-shadow-trees

Conversation

@annevk

@annevk annevk commented Oct 29, 2023

Copy link
Copy Markdown
Member

Also test shadowRootMode setter.

annevk pushed a commit to whatwg/html that referenced this pull request Oct 29, 2023
A longer explanation of this feature can be found at https://github.com/mfreed7/declarative-shadow-dom/blob/master/README.md. It was originally discussed in whatwg/dom#831.

Corresponding DOM PR: whatwg/dom#892.

Tests: shadow-dom/declarative in WPT with web-platform-tests/wpt#42833 being the latest PR as of this commit.

Closes #7069.
@annevk
annevk requested a review from mfreed7 October 30, 2023 15:44

@mfreed7 mfreed7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, with one change to the test description

fragment = parser.parseFromString(content, 'text/html', {includeShadowRoots: true});
assert_dsd(fragment.body,true);
assert_dsd(fragment.body,false);
}, 'DOMParser');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you change the description of this test to indicate "includeShadowRoots is non-standard" or something similar?

t.shadowRootMode = 'CLOSED';
assert_equals(t.shadowRootMode, 'closed');
t.getAttribute('shadowrootmode', 'CLOSED');
}, 'Shadowrootmode reflection, setter');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good catch

@annevk
annevk enabled auto-merge (squash) October 30, 2023 16:30
@jgraham
jgraham disabled auto-merge October 30, 2023 16:36
@annevk

annevk commented Oct 30, 2023

Copy link
Copy Markdown
Member Author

Commit title: Declarative shadow trees: align with the standard

Commit body:

getInnerHTML() isn't standardized yet so mark as tentative.

includeShadowRoots will not be standardized so test it's not supported.

Also test the shadowRootMode setter.

@jgraham
jgraham merged commit b4ab369 into master Oct 30, 2023
@jgraham
jgraham deleted the annevk/declarative-shadow-trees branch October 30, 2023 17:25
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request Oct 30, 2023
https://bugs.webkit.org/show_bug.cgi?id=263852
rdar://117655691

Reviewed by Ryosuke Niwa.

As discussed in whatwg/html#5465 shadowRootMode
is to be reflected as DOMString, not DOMString?.

DOMParser will also no longer be extended to have a dictionary
argument.

The tests have been synchronized with web-platform-tests up until and
including web-platform-tests/wpt#42833 which
upstreamed a couple minor adjustments.

* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-after-attachshadow-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-after-attachshadow.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-after-attachshadow.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-after-attachshadow.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-parser-interaction-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-parser-interaction.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-parser-interaction.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-parser-interaction.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment.tentative-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-basic.tentative-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-opt-in-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-opt-in.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-opt-in.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-opt-in.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-with-disabled-shadow-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-with-disabled-shadow.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-with-disabled-shadow.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-with-disabled-shadow.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-before-closing-tag-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-before-closing-tag.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-before-closing-tag.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-before-closing-tag.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-on-ordinary-template.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-on-ordinary-template.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/innerhtml-on-ordinary-template.tentative-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/move-template-before-closing-tag-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/move-template-before-closing-tag.tentative-expected.txt.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/move-template-before-closing-tag.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/move-template-before-closing-tag.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/script-access-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/script-access.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/script-access.tentative.html.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/script-access.tentative-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/support/helpers.js: Removed.
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/support/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/shadow-dom/declarative/w3c-import.log:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::shadowRootMode const):
(WebCore::HTMLTemplateElement::setShadowRootMode):
* Source/WebCore/html/HTMLTemplateElement.idl:
* Source/WebCore/xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* Source/WebCore/xml/DOMParser.h:
* Source/WebCore/xml/DOMParser.idl:
* Source/WebCore/xml/ParseFromStringOptions.h: Removed.
* Source/WebCore/xml/ParseFromStringOptions.idl: Removed.

Canonical link: https://commits.webkit.org/269976@main
lozy219 pushed a commit to lozy219/html that referenced this pull request Mar 10, 2025
A longer explanation of this feature can be found at https://github.com/mfreed7/declarative-shadow-dom/blob/master/README.md. It was originally discussed in whatwg/dom#831.

Corresponding DOM PR: whatwg/dom#892.

Tests: shadow-dom/declarative in WPT with web-platform-tests/wpt#42833 being the latest PR as of this commit.

Closes whatwg#7069.
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