1
0
Fork 0
firefox/testing/web-platform/tests/css/css-anchor-position/try-tactic-back-to-base.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

35 lines
908 B
HTML

<!DOCTYPE html>
<title>CSS Anchor Positioning: try-tactic, back to base values</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#typedef-position-try-fallbacks-try-tactic">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#cb {
position: absolute;
width: 400px;
height: 200px;
border: 1px solid black;
}
#target {
position: absolute;
width: 50px;
height: 50px;
/* Does not fit ... */
left: 180px;
top: 190px;
/* ... and neither does this. */
position-try-fallbacks: flip-block;
background-color: coral;
}
</style>
<div id=cb>
<div id=target></div>
</div>
<script>
test(() => {
let cs = getComputedStyle(target);
assert_equals(cs.left, '180px');
assert_equals(cs.top, '190px');
}, 'Should use base values when nothing fits');
</script>