1
0
Fork 0
firefox/testing/web-platform/tests/css/css-values/tree-counting/sibling-index-keyframe-percent-dynamic.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

34 lines
930 B
HTML

<!DOCTYPE html>
<title>CSS Values and Units Test: sibling-index() changing percentage during @keyframes animation</title>
<link rel="help" href="https://drafts.csswg.org/css-values-5/#tree-counting">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes --anim {
from {
text-size-adjust: calc(50% * sibling-index());
}
to {
text-size-adjust: 90%;
}
}
#target {
animation: --anim 1000s step-end;
}
</style>
<div>
<div id="rm"></div>
<div></div>
<div id="target"></div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(target).textSizeAdjust, "150%");
}, "Initially, the sibling-index() is 3 for #target");
test(() => {
rm.remove();
assert_equals(getComputedStyle(target).textSizeAdjust, "100%");
}, "Removing a preceding sibling of #target reduces the sibling-index()");
</script>