LibWeb: Use correct style rule index in view transitions

This used to crash a lot of attempted view transitions, now it
doesn't anymore.
This commit is contained in:
Psychpsyo 2025-09-09 13:33:07 +02:00 committed by Sam Atkins
commit 905e749575
Notes: github-actions[bot] 2025-09-09 11:51:16 +00:00
6 changed files with 101 additions and 1 deletions

View file

@ -526,7 +526,7 @@ void ViewTransition::setup_transition_pseudo_elements()
transition_name, "transform", width, height, "backdrop_filter")),
stylesheet->rules().length()));
// FIXME: all the strings above should be the identically named variables, serialized somehow.
captured_element->group_keyframes = as<CSS::CSSKeyframesRule>(stylesheet->css_rules()->item(0));
captured_element->group_keyframes = as<CSS::CSSKeyframesRule>(stylesheet->css_rules()->item(index));
// 6. Set capturedElements group animation name rule to a new CSSStyleRule representing the
// following CSS, and append it to documents dynamic view transition style sheet: