mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Iterate over fewer properties in start_needed_transitions
We don't need to iterate every property in start_needed_transitions, only those that appear in transition-property or have an existing transition Reduces the time spent in start_needed_transitions from ~5% to ~0.03% when loading https://en.wikipedia.org/wiki/2023_in_American_television
This commit is contained in:
parent
bbb344d534
commit
dd9d6d22ee
Notes:
github-actions[bot]
2025-11-10 11:12:55 +00:00
Author: https://github.com/Calme1709
Commit: dd9d6d22ee
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6773
3 changed files with 58 additions and 28 deletions
|
|
@ -179,6 +179,16 @@ void Animatable::add_transitioned_properties(Optional<CSS::PseudoElement> pseudo
|
|||
}
|
||||
}
|
||||
|
||||
Vector<CSS::PropertyID> Animatable::property_ids_with_matching_transition_property_entry(Optional<CSS::PseudoElement> pseudo_element) const
|
||||
{
|
||||
auto const* maybe_transition = ensure_transition(pseudo_element);
|
||||
|
||||
if (!maybe_transition)
|
||||
return {};
|
||||
|
||||
return maybe_transition->transition_attribute_indices.keys();
|
||||
}
|
||||
|
||||
Optional<Animatable::TransitionAttributes const&> Animatable::property_transition_attributes(Optional<CSS::PseudoElement> pseudo_element, CSS::PropertyID property) const
|
||||
{
|
||||
auto* maybe_transition = ensure_transition(pseudo_element);
|
||||
|
|
@ -190,6 +200,16 @@ Optional<Animatable::TransitionAttributes const&> Animatable::property_transitio
|
|||
return {};
|
||||
}
|
||||
|
||||
Vector<CSS::PropertyID> Animatable::property_ids_with_existing_transitions(Optional<CSS::PseudoElement> pseudo_element) const
|
||||
{
|
||||
auto const* maybe_transition = ensure_transition(pseudo_element);
|
||||
|
||||
if (!maybe_transition)
|
||||
return {};
|
||||
|
||||
return maybe_transition->associated_transitions.keys();
|
||||
}
|
||||
|
||||
GC::Ptr<CSS::CSSTransition> Animatable::property_transition(Optional<CSS::PseudoElement> pseudo_element, CSS::PropertyID property) const
|
||||
{
|
||||
auto* maybe_transition = ensure_transition(pseudo_element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue