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/remove-anchor-dirty-layout.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<style>
#anchor {
anchor-name: --a;
}
#target {
position: absolute;
top: anchor(top);
position-anchor: --a;
}
</style>
<div id="anchor"></div>
<div id="target"></div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(resolve => step_timeout(resolve));
let element = document.getElementById("anchor");
element.remove();
await new Promise(resolve => requestAnimationFrame(resolve));
}, "Remove anchor");
</script>