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-patchfor-reverse.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates: patch should appear after its target</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<template patchfor="placeholder">New content</template>
<div id="placeholder">Old content</div>
<script>
test(() => {
assert_equals(document.querySelector("#placeholder").innerText, "Old content");
assert_equals(document.querySelector("template[patchfor=placeholder]").content.textContent, "New content",
"<template patchfor> without a match should parse normally");
}, "<template patchfor> should apply directly to its target");
</script>