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-scripting-nested.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates - a script inside a template inside a patch should not execute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<section id="placeholder">
<script>
window.state = "init";
</script>
</section>
<template patchfor="placeholder"><template><script>window.state = 'patched';</script></template></template>
<script>
test(() => {
assert_not_equals(document.querySelector("#placeholder").firstElementChild, null);
assert_equals(window.state, "init");
});
</script>