Skip to content

Commit

Permalink
LibWeb: Skip transitions for pseudo elements
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 30f59cfe1aec0b385631a40da8b2447eed62ad79)
  • Loading branch information
CarwynNelson authored and nico committed Nov 11, 2024
1 parent 191b686 commit 7a76f8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,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) {
Expand Down

0 comments on commit 7a76f8b

Please sign in to comment.