Skip to content

Commit

Permalink
Add serializable attribute to shadow roots, and prep for setHTML [1/2]
Browse files Browse the repository at this point in the history
This CL adds a `serializable` bool to ShadowRoot, and makes it available
to set via `attachShadow()` plus read/write via an IDL attribute. This
also adds a content attribute `serializable` on `HTMLTemplateElement`
and a corresponding reflection. The `serializable` state will be tested
as part of the next CL which implements `getHTML()` and uses
`serializable`.

This CL also takes the opportunity to do a few other things to prepare
for `getHTML()`:
 1. Add a feature flag `ElementGetHTML` which will gate the new function
    and which also gates the `serializable` changes above.
 2. Add a feature flag `ElementGetInnerHTML` which is default-"stable"
    and will gate the getInnerHTML() function (mostly in the next CL).
 3. Rename `IncludeShadowRoots` as used in *set* methods to
    `ParseDeclarativeShadowRoots` to better represent what it means,
    and also to disambiguate it from some of the `getInnerHTML`
    parameters, which are unrelated. These names refer to Chromium C++
    internal naming, and nothing web-exposed.

This work falls under these two chromestatus entries:
  https://chromestatus.com/feature/5081733588582400
  https://chromestatus.com/feature/5102952270528512
and these two blink-dev threads:
  https://groups.google.com/a/chromium.org/g/blink-dev/c/PE4VwMjLVTo
  https://groups.google.com/a/chromium.org/g/blink-dev/c/it0X7BOimKw

Bug: 1519972, 1517959
Change-Id: Ia57ad71553f162ddc9c304402ac9e7d356940946
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5218429
Commit-Queue: David Baron <[email protected]>
Reviewed-by: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1251428}
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jan 24, 2024
1 parent f8871bc commit 9ba1757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shadow-dom/declarative/declarative-shadow-dom-opt-in.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
assert_dsd(fragment.body,false);
fragment = parser.parseFromString(content, 'text/html', {includeShadowRoots: true});
assert_dsd(fragment.body,false);
}, 'DOMParser (includingShadowRoots is historical)');
}, 'DOMParser (includeShadowRoots is historical)');

test(() => {
const doc = document.implementation.createHTMLDocument('');
Expand Down

0 comments on commit 9ba1757

Please sign in to comment.