Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/dynamic-visible-to-clip-002.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>The viewport scrollbar is updated when the root element's overflow is dynamically changed to 'clip'</title>
<link rel="match" href="dynamic-visible-to-clip-002-ref.html">
<style>
#fill {
height: 200vh;
}
</style>
<div id="fill"></div>
<script>
onload = function() {
// Force an initial layout so the viewport scrollbar is present.
window.unused = document.documentElement.getBoundingClientRect();
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.style.overflow = "clip";
document.documentElement.removeAttribute("class");
}));
}
</script>