Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-position/sticky/position-sticky-single-axis-used-values.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div style="overflow: hidden; width: 200px; height: 150px;">
<div style="overflow: hidden clip; width: 120px; height: 80px;">
<div id="target" style="position: sticky; inset: 50% calc(20% + 5px) calc(20% + 5px) 60%;"></div>
</div>
</div>
<script>
test(() => {
const style = getComputedStyle(document.getElementById('target'));
assert_equals(style.top, '75px');
assert_equals(style.right, '29px');
assert_equals(style.bottom, '35px');
assert_equals(style.left, '72px');
}, 'The used values from getComputedStyle() resolve against the correct scroller.');
</script>