mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibWeb: Don't crash when interpolating single-value repeatable lists
Previously, when interpolating a repeatable list from a list with multiple values to a single value, we would crash.
This commit is contained in:
parent
8ded0c65dc
commit
17f14a277b
Notes:
github-actions[bot]
2025-06-02 10:34:09 +00:00
Author: https://github.com/tcl3
Commit: 17f14a277b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4952
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 26 additions and 1 deletions
|
@ -932,7 +932,7 @@ RefPtr<CSSStyleValue const> interpolate_repeatable_list(DOM::Element& element, C
|
|||
if (!from.is_value_list() && to.is_value_list())
|
||||
from_list = make_single_value_list(from, to.as_value_list().size(), to.as_value_list().separator());
|
||||
else if (!to.is_value_list() && from.is_value_list())
|
||||
to_list = make_single_value_list(to, from.as_value_list().size(), to.as_value_list().separator());
|
||||
to_list = make_single_value_list(to, from.as_value_list().size(), from.as_value_list().separator());
|
||||
else if (!from.is_value_list() && !to.is_value_list())
|
||||
return interpolate_value(element, calculation_context, from, to, delta, allow_discrete);
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
PASS (didn't crash!)
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- FIXME: Ideally this would be a crash test, but the test harness doesn't wait long enough for the crash to occur -->
|
||||
<script src="../include.js"></script>
|
||||
<div></div>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const element = document.querySelector('div');
|
||||
const animation = element.animate([
|
||||
{ backgroundSize: '10% 10%, 20% 20%' },
|
||||
{ backgroundSize: 'auto auto' }
|
||||
], {
|
||||
duration: 1000,
|
||||
});
|
||||
animation.finished.then(() => {
|
||||
println("PASS (didn't crash!)");
|
||||
done();
|
||||
});
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
animation.finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue