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/crashtests/nth-child-of-attribute-crash.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<style>
#elements [blue] {
color: blue;
}
#elements :nth-child(1 of :not([blue])) {
color: revert;
}
</style>
<div id="elements">
<div blue>Child 1</div>
<div>Child 2</div>
</div>
<script>
requestAnimationFrame(() =>
requestAnimationFrame(() => {
elements.children[1].setAttribute("blue", "");
elements.children[1].removeAttribute("blue");
elements.children[0].removeAttribute("blue");
}));
</script>