<!DOCTYPE html>
<meta charset="UTF-8">
<title>height composition with interpolate-size: allow-keywords</title>
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#propdef-height">
<link rel="help" href="https://drafts.csswg.org/css-values-5/#interpolate-size">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<style>
:root {
interpolate-size: allow-keywords;
}
.parent {
height: 200px;
}
.target {
width: 100px;
height: 150px;
}
.target::before {
display: block;
content: "";
width: 100px;
height: 50px;
}
</style>
<body>
<script>
test_composition({
property: 'height',
underlying: 'fit-content', /* 50px */
addFrom: '100px',
addTo: '200px',
}, [
{at: -0.3, expect: '120px'},
{at: 0, expect: '150px'},
{at: 0.5, expect: '200px'},
{at: 1, expect: '250px'},
{at: 1.5, expect: '300px'},
]);
test_composition({
property: 'height',
underlying: 'fit-content', /* ignored because the keywords aren't compatible */
addFrom: 'min-content', /* 50px */
addTo: '200px',
}, [
{at: -0.3, expect: '5px'},
{at: 0, expect: '50px'},
{at: 0.5, expect: '125px'},
{at: 1, expect: '200px'},
{at: 1.5, expect: '275px'},
]);
</script>
</body>