Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/dom/partial-updates/tentative/template-for-gradual-append.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates - append gradually</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=target marker="results"><?start name="results">Loading...</div>
<script>
const contents = [];
const target = document.querySelector("#target");
function step() {
contents.push(target.textContent);
}
step();
</script>
<template for="results">A<?start name=results></template>
<script>step();</script>
<template for="results">B<?marker name=results></template>
<script>step();</script>
<template for="results"><?start name=results>C<?end name=results></template>
<script>step();</script>
<template for="results"><?marker name=results>D</template>
<script>step();</script>
<template for="results">C</template>
<script>step();</script>
<script>
test(() => {
assert_array_equals(contents, ['Loading...', 'A', 'AB', 'ABC', 'ABD', 'ABCD']);
}, "Multiple <template for>");
</script>