This commit is contained in:
Mohamed amine Bounya 2025-04-19 11:18:51 +00:00 committed by GitHub
commit 11268e67cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 2 deletions

View file

@ -287,11 +287,11 @@ double EasingStyleValue::CubicBezier::evaluate_at(double input_progress, bool) c
}))
return found->y;
if (nearby_index == m_cached_x_samples.size() || nearby_index + 1 == m_cached_x_samples.size()) {
if (nearby_index + 1 >= m_cached_x_samples.size()) {
// Produce more samples until we have enough.
auto last_t = m_cached_x_samples.last().t;
auto last_x = m_cached_x_samples.last().x;
while (last_x <= x && last_t < 1.0) {
while (last_x <= x || last_t < 1.0) {
last_t += 1. / 60.;
auto solution = solve(last_t);
m_cached_x_samples.append(solution);

View file

@ -0,0 +1 @@
PASS! (Didn't crash)

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<style>
#foo {
animation-name: move;
animation-duration: 2s;
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
animation-iteration-count: 0.1;
animation-direction: reverse;
}
@keyframes move {}
</style>
<div id="foo"></div>
<script src="../include.js"></script>
<script>
asyncTest(async (done) => {
const foo = document.getElementById("foo");
const anim = foo.getAnimations()[0];
anim.onfinish = function () {
println("PASS! (Didn't crash)");
done();
};
anim.play();
});
</script>