Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb/CSS+Animations+DOM: Add support for TransitionEvents #3024

Merged
merged 6 commits into from
Dec 25, 2024
Prev Previous commit
Next Next commit
LibWeb/CSS: Don't assume that animations have an associated effect
... when computing properties.
  • Loading branch information
LucasChollet committed Dec 23, 2024
commit 5fe4a4828364e188ba23febd1d11551f77992e33
6 changes: 5 additions & 1 deletion Libraries/LibWeb/CSS/StyleComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,9 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optional<CSS::

static void apply_animation_properties(DOM::Document& document, CascadedProperties& cascaded_properties, Animations::Animation& animation)
{
if (!animation.effect())
return;

auto& effect = verify_cast<Animations::KeyframeEffect>(*animation.effect());

Optional<CSS::Time> duration;
Expand Down Expand Up @@ -2401,7 +2404,8 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::Element& elem
animation->play().release_value_but_fixme_should_propagate_errors();
} else {
// The animation hasn't changed, but some properties of the animation may have
apply_animation_properties(m_document, cascaded_properties, *element.cached_animation_name_animation(pseudo_element));
if (auto animation = element.cached_animation_name_animation(pseudo_element); animation)
apply_animation_properties(m_document, cascaded_properties, *animation);
}
}
} else {
Expand Down