LibWeb: Add mechanism to invalidate only inherited styles

We can now mark an element as needing an "inherited style update" rather
than a full "style update". This effectively means that the next style
update will visit the element and pull all of its inherited properties
from the relevant ancestor element.

This is now used for descendants of elements with animated style.
This commit is contained in:
Andreas Kling 2024-12-22 11:59:58 +01:00 committed by Andreas Kling
commit dc8343cc23
Notes: github-actions[bot] 2024-12-23 16:06:18 +00:00
7 changed files with 55 additions and 16 deletions

View file

@ -175,6 +175,8 @@ public:
[[nodiscard]] GC::Ref<ComputedProperties> compute_properties(DOM::Element&, Optional<Selector::PseudoElement::Type>, CascadedProperties&) const;
void absolutize_values(ComputedProperties&) const;
private:
enum class ComputeStyleMode {
Normal,
@ -194,7 +196,6 @@ private:
void compute_math_depth(ComputedProperties&, DOM::Element const*, Optional<CSS::Selector::PseudoElement::Type>) const;
void compute_defaulted_values(ComputedProperties&, DOM::Element const*, Optional<CSS::Selector::PseudoElement::Type>) const;
void start_needed_transitions(ComputedProperties const& old_style, ComputedProperties& new_style, DOM::Element&, Optional<Selector::PseudoElement::Type>) const;
void absolutize_values(ComputedProperties&) const;
void resolve_effective_overflow_values(ComputedProperties&) const;
void transform_box_type_if_needed(ComputedProperties&, DOM::Element const&, Optional<CSS::Selector::PseudoElement::Type>) const;