Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
graouts authored Jan 31, 2023
1 parent 5362f7c commit ae74e9c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions css/css-animations/responsive/line-height.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Animations: line-height animations respond to style changes</title>
<link rel="help" href="https://drafts.csswg.org/css-inline/#line-height-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#target {
animation-name: line-height-animation;
animation-duration: 4s;
animation-timing-function: linear;
animation-delay: -2s;
animation-play-state: paused;
}
@keyframes line-height-animation {
from { line-height: inherit; }
to { line-height: 20px; }
}
</style>
</head>
<body>
<div id="container">
<div id="target"></div>
</div>
<script>
'use strict';
const container = document.getElementById('container');
const target = document.getElementById('target');

test(() => {
container.style.lineHeight = '100px';
assert_equals(getComputedStyle(target).lineHeight, '60px');

container.style.lineHeight = '50px';
assert_equals(getComputedStyle(target).lineHeight, '35px');

container.style.lineHeight = '100px';
assert_equals(getComputedStyle(target).lineHeight, '60px');
}, 'line-height responds to inherited changes');

</script>
</body>
</html>

0 comments on commit ae74e9c

Please sign in to comment.