blob: 30b64b20d24ada2d581cec4a6b561737ee574a52 [file] [log] [blame]
<!DOCTYPE html>
<style type="text/css">
.container {
font-size: 20px;
line-height: 1;
}
@font-face {
font-family : 'testFont';
src : url('../../resources/opensans/OpenSans-Regular.woff') format("woff");
}
.parent {
font-size-adjust: 3;
}
.target {
display: inline-block;
font-family: testFont;
font-size-adjust: 1;
}
.expected {
color: green;
margin-right: 30px;
}
</style>
<template id="target-template">
<span class="container">
<div class="target">x</span>
</div>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
assertInterpolation({
property: 'font-size-adjust',
from: neutralKeyframe,
to: '2',
}, [
{at: -2, is: '0'},
{at: -0.3, is: '0.7'},
{at: 0, is: '1'},
{at: 0.3, is: '1.3'},
{at: 0.6, is: '1.6'},
{at: 1, is: '2'},
{at: 1.5, is: '2.5'},
]);
assertNoInterpolation({
property: 'font-size-adjust',
from: 'initial',
to: '2',
});
assertInterpolation({
property: 'font-size-adjust',
from: 'inherit',
to: '2',
}, [
{at: -2, is: '5'},
{at: -0.3, is: '3.3'},
{at: 0, is: '3'},
{at: 0.3, is: '2.7'},
{at: 0.6, is: '2.4'},
{at: 1, is: '2'},
{at: 1.5, is: '1.5'},
]);
assertInterpolation({
property: 'font-size-adjust',
from: 'unset',
to: '2',
}, [
{at: -2, is: '5'},
{at: -0.3, is: '3.3'},
{at: 0, is: '3'},
{at: 0.3, is: '2.7'},
{at: 0.6, is: '2.4'},
{at: 1, is: '2'},
{at: 1.5, is: '1.5'},
]);
assertInterpolation({
property: 'font-size-adjust',
from: '0',
to: '1.2'
}, [
{at: -2, is: '0'},
{at: -0.3, is: '0'},
{at: 0, is: '0'},
{at: 0.3, is: '0.36'},
{at: 0.6, is: '0.72'},
{at: 1, is: '1.2'},
{at: 1.5, is: '1.8'},
]);
assertNoInterpolation({
property: 'font-size-adjust',
from: 'none',
to: '1.2'
});
assertInterpolation({
property: 'font-size-adjust',
from: '0.2',
to: '1.2'
}, [
{at: -2, is: '0'}, // CSS font-size-adjust can't be negative.
{at: -0.3, is: '0'},
{at: 0, is: '0.2'},
{at: 0.3, is: '0.5'},
{at: 0.6, is: '0.8'},
{at: 1, is: '1.2'},
{at: 1.5, is: '1.7'},
]);
</script>