Bug
1843619 [wpt PR 41048] - Add declarative DOM Parts syntax, a=testonly
Automatic update from web-platform-tests
Add declarative DOM Parts syntax
This CL adds the ability to construct DOM Parts during document
parsing via "fake" processing instructions:
<section>
<h1 id="name">
<?child-node-part?> <?/child-node-part?>
</h1>
Email: <?node-part metadata?><a id="link"></a>
</section>
In this example, <?child-node-part?><?/child-node-part?> will
be left in the document, but a ChildNodePart will also be constructed
with previous/next endpoints of those two comment nodes. And the
<?node-part> will be left in place, but a NodePart will be attached
to the <a> element.
Note that <?foo?> is exactly equivalent to <!--?foo?-->, and both
are tested in the new WPT.
This CL also:
- adds a virtual test suite that makes sure no functionality breaks
or leaks when DOMPartAPI is disabled.
- revamps the WPT, adding a `assertEqualParts()` that checks a given
parts list via the type of parts and the metadata. This is then
used everywhere.
- add testing of declarative DOM Parts for three cases:
1. main document parsing (passes with this CL)
2. template parsing (doesn't yet pass)
3. cloned templates (not even sure if this should ever pass)
Bug:
1453291,
1465062
Change-Id: I2eaef72a21fc2deaa251deb0731b5ff55ef19d8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
4686189
Reviewed-by: David Baron <dbaron@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#
1170849}
--
wpt-commits:
eeab1cbd50bdb860552e6edebf0da9e259860908
wpt-pr: 41048