mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Skip animation invalidation for elements nested in display none
Paper over the fact we sometimes fail to cancel animations for elements nested in display none, and do lots of wasted work.
This commit is contained in:
parent
268143681e
commit
868981a46b
Notes:
github-actions[bot]
2025-03-08 23:07:13 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 868981a46b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3863
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 7 additions and 0 deletions
|
@ -923,6 +923,13 @@ void KeyframeEffect::update_computed_properties()
|
|||
if (!target || !target->is_connected())
|
||||
return;
|
||||
|
||||
if (target->has_inclusive_ancestor_with_display_none()) {
|
||||
// FIXME: Reaching this point means we failed to cancel animation for an element that started
|
||||
// being nested in "display: none".
|
||||
// For now this hack is needed to avoid lots of unnecessary work.
|
||||
return;
|
||||
}
|
||||
|
||||
GC::Ptr<CSS::ComputedProperties> style = {};
|
||||
if (!pseudo_element_type().has_value())
|
||||
style = target->computed_properties();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue