Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/dom/partial-updates/tentative/template-for-superseded-by-shadowrootmode.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates: shadowrootmode supersedes for</title>
<link rel=help href="https://github.com/WICG/declarative-partial-updates">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="container">
<section id=outer marker="d"><?start name="d">Unchanged<?end name="d"></section>
<template shadowrootmode="open" for="d">
<section id=inner>Inside</section>
</template>
</div>
<script>
test(() => {
const outer = document.querySelector("#outer");
assert_equals(outer.textContent, "Unchanged");
const inner = document.querySelector("#container").shadowRoot.querySelector("#inner");
assert_not_equals(inner, null);
assert_equals(inner.textContent, "Inside");
});
</script>