Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-position/sticky-dialog.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>position:sticky computes to position:absolute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<dialog style="position: sticky"></dialog>
<script>
test(() => {
const dialog = document.querySelector('dialog');
assert_equals(getComputedStyle(dialog).position, 'sticky');
dialog.showModal();
assert_equals(getComputedStyle(dialog).position, 'absolute');
}, 'Once in the top-layer position:sticky computes to position:absolute');
</script>