Bug 262608
| Summary: | support includeShadowRoots in JSAPI for streaming declarative shadow dom | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Onur Gumus <onur> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | annevk, rniwa |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Onur Gumus
The following code works in chrome allowing declarative shadow dom parsed and inserted with javascript.
<script>
const html = `
<div>
<template shadowrootmode="open"></template>
</div>
`;
const div = document.createElement('div');
div.innerHTML = html; // No shadow root here
const fragment = new DOMParser().parseFromString(html, 'text/html', {
includeShadowRoots: true
}); // Shadow root here
</script>
However includeShadowRoots parameter is ignored by WebKit
For more info:
https://developer.chrome.com/articles/declarative-shadow-dom/#parser-only
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
The plan is to add parseHTMLUnsafe and support declarative shadow DOM there, not add an option to DOMParser.