Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-ruby/crashtests/whitespace-reframe.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
#p::before { display: ruby; content: "a"; }
#p.swap::before { content: " "; }
</style>
</head>
<body>
<div id="p"></div>
<script>
const p = document.getElementById('p');
// Flush initial layout with ::before ruby content "a"
document.body.offsetHeight;
// Add class so that ::before content becomes " "
p.classList.add('swap');
// Force reflow with the generated content that is now whitespace-only
document.body.offsetHeight;
</script>
</body>
</html>