LibWeb/DOM: Set the pseudo_element on created Animation/TransitionEvents

Also import a couple of WPT tests that now pass.
This commit is contained in:
Sam Atkins 2025-12-02 11:40:59 +00:00 committed by Andreas Kling
parent d717dd64b3
commit ed7a86b8cc
Notes: github-actions[bot] 2025-12-03 12:31:02 +00:00
5 changed files with 84 additions and 2 deletions

View file

@ -2696,10 +2696,12 @@ void Document::dispatch_events_for_transition(GC::Ref<CSS::CSSTransition> transi
type,
CSS::TransitionEventInit {
{ .bubbles = true },
// FIXME: Correctly set pseudo_element
MUST(String::from_utf8(transition->transition_property())),
elapsed_time,
String {},
transition->owning_element()->pseudo_element().map([](auto it) {
return MUST(String::formatted("::{}", CSS::pseudo_element_name(it)));
})
.value_or({}),
}),
.animation = transition,
.target = transition->owning_element()->element(),
@ -2791,6 +2793,10 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
{ .bubbles = true },
css_animation.animation_name(),
elapsed_time_seconds,
owning_element->pseudo_element().map([](auto it) {
return MUST(String::formatted("::{}", CSS::pseudo_element_name(it)));
})
.value_or({}),
}),
.animation = css_animation,
.target = *target,