mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibWeb: Handle non-numeric font-weight values in keyframes
Previously, using `font-weight` with a keyword or `calc()` value inside a keyframe rule would cause a crash.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
e69d9fb331
commit
48f56cad08
Notes:
github-actions[bot]
2025-06-25 07:03:08 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/48f56cad088 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5206 Reviewed-by: https://github.com/gmta ✅
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<title>CSS Values and Units Test: sibling-index() changing font-weight 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 {
|
||||
font-weight: calc(100 * sibling-index());
|
||||
}
|
||||
to {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
#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).fontWeight, "300");
|
||||
}, "Initially, the sibling-index() is 3 for #target");
|
||||
|
||||
test(() => {
|
||||
rm.remove();
|
||||
assert_equals(getComputedStyle(target).fontWeight, "200");
|
||||
}, "Removing a preceding sibling of #target reduces the sibling-index()");
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user