LibWeb: Skip transitions for pseudo elements

Transitions are currently not implemented for pseudo elements which
causes the transition to be applied to the "real"/"parent" element. When
a transition adjusts width/height on a pseudo element this causes the
real elements layout to break.

As a quick fix we just skip doing transitions when they are against
pseudo elements.
This commit is contained in:
Carwyn Nelson 2024-10-07 08:06:20 +01:00 committed by Andreas Kling
commit 30f59cfe1a
Notes: github-actions[bot] 2024-10-07 11:41:17 +00:00

View file

@ -1238,7 +1238,8 @@ static void compute_transitioned_properties(StyleProperties const& style, DOM::E
void StyleComputer::start_needed_transitions(StyleProperties const& previous_style, StyleProperties& new_style, DOM::Element& element, Optional<Selector::PseudoElement::Type> pseudo_element) const
{
// FIXME: Implement transitions for pseudo-elements
(void)pseudo_element;
if (pseudo_element.has_value())
return;
// https://drafts.csswg.org/css-transitions/#transition-combined-duration
auto combined_duration = [](Animations::Animatable::TransitionAttributes const& transition_attributes) {