Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/chrome-377324991-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="test-wait">
<title>CSS Anchor Positioning Test: crash for simultaneous @position-try and display:none change</title>
<style>
@position-try --opt {
position-area: right center;
}
#anchor {
width: 100px;
height: 100px;
background-color: green;
anchor-name: --a;
}
#anchored {
position: absolute;
width: 100px;
height: 100px;
background-color: lime;
position-anchor: --a;
position-area: left center;
position-try-fallbacks: --opt;
}
</style>
<div id="anchor"></div>
<div id="anchored"></div>
<script>
requestAnimationFrame(() => {
requestAnimationFrame(() => {
anchored.style.display = 'none';
document.styleSheets[0].insertRule("@position-try --opt {}");
document.documentElement.classList.remove("test-wait");
});
});
</script>