Skip to content

Commit

Permalink
Bug 1913843 [wpt PR 47677] - Fix top-layer position:sticky., a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Fix top-layer position:sticky.

We incorrectly only checked for position:relative and position:static
when performing the out-of-flow position adjusted specified:
https://drafts.csswg.org/css-position-4/#top-styling

Explicitly check if we don't have out-of-flow position instead.

Change-Id: I3be27b3d54f96f1c35796f50cec9715a08a86049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5797251
Commit-Queue: Ian Kilpatrick <[email protected]>
Auto-Submit: Ian Kilpatrick <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1343850}

--

wpt-commits: 6fdc6a3f49a427c5ddaa9fb6c6ac513c23375d7f
wpt-pr: 47677
  • Loading branch information
bfgeek authored and moz-wptsync-bot committed Aug 21, 2024
1 parent 99f4a04 commit a1136ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions testing/web-platform/tests/css/css-position/sticky-dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>position:sticky computes to position:absolute</title>
<link rel="help" href="https://drafts.csswg.org/css-position-4/#top-styling">
<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>

0 comments on commit a1136ca

Please sign in to comment.