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-reverse.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates: patch should appear after its target</title>
<link rel=help href="https://github.com/WICG/declarative-partial-updates">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<template for="placeholder">New content</template>
<div id="placeholder" marker="placeholder"><?start name="placeholder">Old content<?end name="placeholder"></div>
<script>
test(() => {
assert_equals(document.querySelector("#placeholder").innerText, "Old content");
assert_not_equals(document.querySelector("template[for=placeholder]"), null, "Template should attach");
});
</script>