blob: a1e9dcbc3cdbc13fd59c6851fb5ae179fadaa878 [file] [log] [blame]
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<style>
#keg { contain: block-size layout; }
@container (max-width: 200px) {
#target { height: 400px; }
}
@container (min-width: 400px) {
#target { height: 20px; }
}
</style>
<div id="ancestry">
<div id="keg">
<div id="target">
<div style="height:50px;"></div>
</div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
// Since the axis queried isn't size-contained, the query should never
// match.
ancestry.style.width = "100px";
assert_equals(target.offsetHeight, 50);
ancestry.style.width = "300px";
assert_equals(target.offsetHeight, 50);
ancestry.style.width = "500px";
assert_equals(target.offsetHeight, 50);
}, "Axis mismatch between query and size containment");
</script>