LibWeb: Support CSS transitions and animations on all pseudo-elements

Restricted pseudo-elements (like ::placeholder, ::first-letter,
::first-line, and ::selection) use property whitelists. These
whitelists did not include transition or animation properties.
As a result, pseudo_element_supports_property() rejected transition and
animation declarations during cascade filtering. This caused
transition-duration and transition-delay to resolve to their initial
values (0s), which triggered the zero-second optimization in
compute_transitioned_properties() and prevented transition
registration.

This change introduces a fast-path check in the generated function
pseudo_element_supports_property() to automatically accept all CSS
transition and animation properties on any styleable pseudo-element.
This commit is contained in:
Darshanx256 2026-05-20 21:52:09 +05:30 committed by Sam Atkins
parent 5c928eb7eb
commit e3cc5d1fe9

View file

@ -446,6 +446,26 @@ bool is_pseudo_element_root(PseudoElement pseudo_element)
bool pseudo_element_supports_property(PseudoElement pseudo_element, PropertyID property_id)
{
if (property_id == PropertyID::Transition
|| property_id == PropertyID::TransitionBehavior
|| property_id == PropertyID::TransitionDelay
|| property_id == PropertyID::TransitionDuration
|| property_id == PropertyID::TransitionProperty
|| property_id == PropertyID::TransitionTimingFunction
|| property_id == PropertyID::Animation
|| property_id == PropertyID::AnimationComposition
|| property_id == PropertyID::AnimationDelay
|| property_id == PropertyID::AnimationDirection
|| property_id == PropertyID::AnimationDuration
|| property_id == PropertyID::AnimationFillMode
|| property_id == PropertyID::AnimationIterationCount
|| property_id == PropertyID::AnimationName
|| property_id == PropertyID::AnimationPlayState
|| property_id == PropertyID::AnimationTimeline
|| property_id == PropertyID::AnimationTimingFunction) {
return true;
}
switch (pseudo_element) {
""")