Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/invalidation/part-pseudo.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>CSS Selectors Invalidation: ::part()</title>
<link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org">
<link rel="match" href="part-pseudo-ref.html">
<style id="sheet">#host::part(green) { color: red; }</style>
</head>
<body>
<div id="host">
<template shadowrootmode="open">
<div>
<div part="green">Should be green</div>
</div>
</template>
</div>
<script>
document.body.offsetTop;
sheet.innerText = "#host::part(green) { color: green; }";
</script>
</body>