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/sheet-going-away-002.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: invalidation of class changes when the sheet the style depends on goes away</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="match" href="sheet-going-away-002-ref.html">
<style>
p { color: green; }
</style>
<style id="style">
.red p { color: red; }
</style>
<body class="red">
<p>
Should be green.
</p>
<script>
document.body.offsetTop;
document.body.className = "";
style.remove();
</script>
</body>