blob: e5395d91966bc5e6611e3af5030bf89789b55d8c [file] [log] [blame]
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<style>
#ancestry { writing-mode: vertical-rl; }
#keg { contain: inline-size layout; }
@container (max-height: 200px) {
#target { width: 400px; }
}
@container (min-height: 400px) {
#target { width: 20px; }
}
</style>
<div id="ancestry">
<div id="keg">
<div id="target">
<div style="width:50px;"></div>
</div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
ancestry.style.height = "100px";
assert_equals(keg.offsetWidth, 400);
ancestry.style.height = "300px";
assert_equals(keg.offsetWidth, 50);
ancestry.style.height = "500px";
assert_equals(keg.offsetWidth, 20);
}, "inline-size containment only");
</script>