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-contentmethod-style-in-head.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset="utf-8" />
<title>HTML partial updates - patch updates style with plain text</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="placeholder" contentname="cn"></style>
<body>
<div id="target"></div>
<template contentmethod="replace">
<style contentname="cn" id="placeholder">
#target { color: rgba(100, 0, 100); }
#something:after { content: "<div id=dontparseme></div>" };
</style>
</template>
<script>
test(() => {
assert_equals(document.querySelector("#placeholder").firstElementChild, null);
assert_equals(getComputedStyle(document.getElementById("target")).color, "rgb(100, 0, 100)");
});
</script>