Skip to content

Commit

Permalink
Add boilerplate for 'position-fallback-bounds'
Browse files Browse the repository at this point in the history
This patch adds standard handling code for 'position-fallback-bounds'
under the css/ directory.

This patch on its own doesn't introduce any new behavior, but is split
off the main patch (crrev.com/c/4655384) simply to ease code review.

Spec: https://drafts.csswg.org/css-anchor-position-1/#fallback-bounds

Bug: 1455557
Change-Id: Ia334ffeb006ab158dfe442744b9f5400bfb19af7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4652743
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Auto-Submit: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1164533}
  • Loading branch information
xiaochengh authored and chromium-wpt-export-bot committed Jun 30, 2023
1 parent 0dfc2ab commit b8acf51
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions css/css-anchor-position/position-fallback-bounds-basics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<title>Tests basics of the 'position-fallback' property</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#propdef-position-fallback-bounds">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<script src="/css/support/inheritance-testcommon.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>

<div id="container">
<div id="target"></div>
</div>

<script>
// position-fallback-bounds: normal | <dashed-ident>
test_valid_value('position-fallback-bounds', 'normal');
test_valid_value('position-fallback-bounds', '--foo');
test_invalid_value('position-fallback-bounds', 'foo-bar');
test_invalid_value('position-fallback-bounds', '--foo --bar')
test_invalid_value('position-fallback-bounds', '--foo, --bar')
test_invalid_value('position-fallback-bounds', '100px');
test_invalid_value('position-fallback-bounds', '100%');

// Computed value: as specified
test_computed_value('position-fallback-bounds', 'normal');
test_computed_value('position-fallback-bounds', '--foo');

// Initial: normal
// Inherited: no
assert_not_inherited('position-fallback-bounds', 'normal', '--foo');

// Animation type: discrete
test_no_interpolation({
property: 'position-fallback-bounds',
from: '--foo',
to: 'normal',
});
</script>

0 comments on commit b8acf51

Please sign in to comment.