1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00
ladybird/Libraries/LibWeb/DOM
Andreas Kling 096eed35cc LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic
The play_or_cancel_animations_after_display_property_change() helper
was being called by Node::inserted() and Node::removed_from() and then
recursing into the shadow-including subtree.

This had quadratic complexity since inserted() and removed_from() are
themselves already invoked recursively for everything in the
shadow-including subtree.

Only one caller of this API actually needed the recursive behavior,
so this patch moves that responsibility to the caller and puts the logic
in style recomputation instead.

1.02x speedup on Speedometer's TodoMVC-jQuery.
2025-05-11 20:22:17 +02:00
..
AbortController.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbortController.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
AbortController.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
AbortSignal.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbortSignal.h LibWeb: Support removing callbacks from AbortSignal 2025-04-11 12:10:46 -04:00
AbortSignal.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
AbstractRange.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbstractRange.h LibWeb: Only clear command states and values if range actually changed 2025-01-24 23:53:26 +01:00
AbstractRange.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
AccessibilityTreeNode.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
AccessibilityTreeNode.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
AdoptedStyleSheets.cpp LibWeb: Fix insert/delete rule invalidation for adopted style sheets 2025-01-13 23:03:07 +01:00
AdoptedStyleSheets.h LibWeb: Fix insert/delete rule invalidation for adopted style sheets 2025-01-13 23:03:07 +01:00
Attr.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Attr.h LibWeb: Make node cloning methods const 2025-01-11 23:10:09 +01:00
Attr.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
CDATASection.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CDATASection.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
CDATASection.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
CharacterData.cpp AK+Everywhere: Recognise that surrogates in utf16 aren't all that common 2025-04-23 07:56:02 -06:00
CharacterData.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
CharacterData.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
ChildNode.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ChildNode.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Comment.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Comment.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Comment.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
CustomEvent.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CustomEvent.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
CustomEvent.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Document.cpp LibWeb: Set transition property name when firing transition events 2025-04-29 12:23:31 +02:00
Document.h LibWeb: Light dismiss dialogs on click 2025-04-28 19:41:38 -06:00
Document.idl LibWeb: Update focus-related spec text 2025-04-18 10:49:56 +02:00
DocumentFragment.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DocumentFragment.h LibWeb: Maintain a mapping for fast lookup in getElementById() 2025-03-26 08:36:25 +00:00
DocumentFragment.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
DocumentLoadEventDelayer.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
DocumentLoadEventDelayer.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
DocumentLoading.cpp LibWeb: Correct some spec typos 2025-04-10 04:01:37 +02:00
DocumentLoading.h LibWeb: Make a bunch of CSP classes not realm associated 2025-04-28 12:41:28 +02:00
DocumentObserver.cpp LibWeb: Add a document observer to be notified upon becoming active 2024-12-11 17:38:31 -07:00
DocumentObserver.h LibWeb: Add a document observer to be notified upon becoming active 2024-12-11 17:38:31 -07:00
DocumentOrShadowRoot.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
DocumentType.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DocumentType.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
DocumentType.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
DOMEventListener.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
DOMEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
DOMImplementation.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DOMImplementation.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
DOMImplementation.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
DOMTokenList.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
DOMTokenList.h LibWeb: Improve relList feature detection support 2024-12-06 18:09:53 +00:00
DOMTokenList.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
EditingHostManager.cpp LibWeb: Do not insert "return" key presses into input element values 2025-03-22 17:27:45 +01:00
EditingHostManager.h LibWeb: Do not insert "return" key presses into input element values 2025-03-22 17:27:45 +01:00
Element.cpp LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic 2025-05-11 20:22:17 +02:00
Element.h LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic 2025-05-11 20:22:17 +02:00
Element.idl LibWeb/DOM: Actually stub out pointer-capture API 2025-04-14 12:55:44 +02:00
ElementByIdMap.cpp LibWeb: Don't crash if ElementByIdMap already has an element 2025-03-27 14:44:51 +00:00
ElementByIdMap.h LibWeb: Maintain a mapping for fast lookup in getElementById() 2025-03-26 08:36:25 +00:00
ElementFactory.cpp LibWeb: Do not create a RootVector to invoke IDL callbacks 2025-04-16 07:32:02 -04:00
ElementFactory.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ElementReference.h LibWeb/CSS: Move and rename PseudoElement types to prep for code gen 2025-03-24 09:49:50 +00:00
Event.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Event.h LibJS+LibWeb: Add JS::Object::fast_is<T> helpers for some LibWeb types 2025-04-18 14:45:56 +02:00
Event.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
EventDispatcher.cpp LibWeb: Do not create a RootVector to invoke IDL callbacks 2025-04-16 07:32:02 -04:00
EventDispatcher.h LibWeb: Implement legacyOutputDidListenersThrowFlag 2024-11-26 14:50:27 +01:00
EventHandler.idl LibWeb/HTML: Dispatch command events 2025-04-18 12:09:57 +01:00
EventTarget.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
EventTarget.h LibWeb: Avoid dynamic_cast in EventTarget initialization 2025-04-18 14:45:56 +02:00
EventTarget.idl LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
HTMLCollection.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
HTMLCollection.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
HTMLCollection.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
IDLEventListener.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
IDLEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
InputEventsTarget.h LibWeb: Do not insert "return" key presses into input element values 2025-03-22 17:27:45 +01:00
LiveNodeList.cpp LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
LiveNodeList.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
MutationObserver.cpp LibWeb: Split out SimilarOriginWindowAgent from HTML::Agent 2025-04-25 14:07:51 +02:00
MutationObserver.h LibWeb: Make Agent's MutationObserver list weak 2025-02-07 16:53:11 +01:00
MutationObserver.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
MutationRecord.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
MutationRecord.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
MutationRecord.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
MutationType.cpp LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
MutationType.h LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
NamedNodeMap.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
NamedNodeMap.h LibWeb: Take namespace into account when matching attribute 2024-11-30 16:47:14 +00:00
NamedNodeMap.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Node.cpp LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic 2025-05-11 20:22:17 +02:00
Node.h LibWeb: Avoid O(n^2) traversal in play-or-cancel-animations logic 2025-05-11 20:22:17 +02:00
Node.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
NodeFilter.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
NodeFilter.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
NodeFilter.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
NodeIterator.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
NodeIterator.h LibWeb: Return actual callback object from NodeIterator::filter 2025-02-24 18:29:03 +01:00
NodeIterator.idl LibWeb: Return actual callback object from NodeIterator::filter 2025-02-24 18:29:03 +01:00
NodeList.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
NodeList.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
NodeList.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
NodeOperations.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
NodeOperations.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
NodeType.h LibWeb: Move DOM::NodeType to its own file 2025-02-19 08:45:51 -05:00
NonDocumentTypeChildNode.h AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
ParentNode.cpp LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
ParentNode.h LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
ParentNode.idl LibWeb: Implement 'State-preserving atomic move integration' 2025-04-26 08:45:37 -06:00
Position.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Position.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ProcessingInstruction.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
ProcessingInstruction.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ProcessingInstruction.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
QualifiedName.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
QualifiedName.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Range.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Range.h LibWeb: Add Range::for_each_contained() 2025-01-10 23:33:35 +01:00
Range.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
SelectionchangeEventDispatching.h LibWeb: Fix selectionchange typo 2025-01-06 08:55:00 +00:00
ShadowRoot.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
ShadowRoot.h LibWeb: Make Document::m_shadow_roots an IntrusiveList 2025-04-10 04:01:00 +02:00
ShadowRoot.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Slot.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Slot.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Slottable.cpp LibWeb: Split out SimilarOriginWindowAgent from HTML::Agent 2025-04-25 14:07:51 +02:00
Slottable.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Slottable.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
StaticNodeList.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
StaticNodeList.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
StaticRange.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
StaticRange.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
StaticRange.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
StyleElementUtils.cpp LibWeb/DOM: Create style element style sheets with document's base URL 2025-05-03 12:01:43 +01:00
StyleElementUtils.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Text.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Text.h LibWeb: Remove unused pointer from DOM::Text to its "owner" element 2024-12-27 12:27:03 +01:00
Text.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
TreeWalker.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
TreeWalker.h LibWeb: Return actual callback object from TreeWalker::filter 2025-02-24 18:29:03 +01:00
TreeWalker.idl LibWeb: Return actual callback object from TreeWalker::filter 2025-02-24 18:29:03 +01:00
Utils.cpp AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
Utils.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
XMLDocument.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
XMLDocument.h Everywhere: Use URL::about_XXX factory functions 2025-02-15 17:05:55 +00:00
XMLDocument.idl Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00