Bug 1852631 [wpt PR 41918] - Add {{}} syntax for NodeParts, a=testonly
commit809e4ab7a9daa7115deef6bf945e9da5d6419c09
authorMason Freed <masonf@chromium.org>
Wed, 27 Sep 2023 11:59:11 +0000 (27 11:59 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 28 Sep 2023 14:56:47 +0000 (28 14:56 +0000)
tree74858cc4625d5240fc0d53aa0477bc39bfafea3c
parentf5e211398089a8e7132eae6a6ed9db11a8ae8d72
Bug 1852631 [wpt PR 41918] - Add {{}} syntax for NodeParts, a=testonly

Automatic update from web-platform-tests
Add {{}} syntax for NodeParts

This CL enables this syntax:

  <span parseparts>
    <div {{}} id=nodepart_here></div>
  </span>

The above snippet will now delete the {{}} and connect a NodePart to
the `<div>`.

This is implemented by adding a bit `needs_node_part` to `HTMLToken`
and `AtomicHTMLToken`. The tokenizer is updated to look for `{{}}`
while in the two states where this could be encountered while
tokenizing attribute names, and the `needs_node_part` bit is set.
This same bit is plumbed through `HTMLConstructionSiteTask`. If found
in `HTMLConstructionSite::ExecuteTask()`, `ConstructNodePart` adds a
`NodePart`.

Bug: 1453291
Change-Id: Ib7b2f34b39fdafd19816cbb4cdd93c292cd5c6fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4848471
Reviewed-by: David Baron <dbaron@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1196015}

--

wpt-commits: 1c1ae80474b9a620a26770a596decfda3528609e
wpt-pr: 41918
testing/web-platform/tests/dom/parts/basic-dom-part-declarative-brace-syntax.tentative.html