ladybird/Libraries/LibWeb/DOM
Aliaksandr Kalenik d1fbb7b51e LibWeb: Invalidate less elements affected by CSS custom properties
Before this change, whenever element's attributes changed, we would add
a flag to "pending invalidation", indicating that all descendants whose
style uses CSS custom properties needed to be recomputed. This resulted
in severe overinvalidation, because we would run invalidation regardless
of whether any custom property on affected element actually changed.

This change takes another approach, and now we decide whether
descendant's style needs to be recomputed based on whether ancestor's
style recomputation results in a change of custom properties, though
this approach adds a little overhead to style computation as now we have
to compare old vs new hashmap of custom properties.

This brings substantial improvement on discord and x.com where, before
this change, advantage of using invalidation sets was lost and we had
to recompute all descendants, because almost all of them use custom
properties.
2025-07-30 11:06:05 +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
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
AbstractElement.cpp LibWeb: Allow to pass pseudo-element type in computed properties getter 2025-07-18 21:19:37 +02:00
AbstractElement.h LibWeb: Apply all animations and transitions before invalidating style 2025-07-19 11:08:46 -04: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
AccessibilityTreeNode.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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
CDATASection.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
CDATASection.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
CDATASection.idl
CharacterData.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
CharacterData.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
CharacterData.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
ChildNode.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
ChildNode.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
Comment.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
Comment.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
Comment.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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
Document.cpp LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Document.h LibWeb: Unregister ResizeObserver from Document when it has no targets 2025-07-30 00:54:57 +02:00
Document.idl LibWeb: Port document.execCommand and InputEvent to UTF-16 2025-07-26 00:40:06 +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
DocumentLoadEventDelayer.cpp LibWeb: Allow moving document load event delayers 2025-05-22 17:44:40 -04:00
DocumentLoadEventDelayer.h LibWeb: Allow moving document load event delayers 2025-05-22 17:44:40 -04:00
DocumentLoading.cpp LibWeb: Port node text content to UTF-16 2025-07-28 18:30:50 +02:00
DocumentLoading.h LibURL+LibWeb: Make URL::Origin default constructor private 2025-06-17 20:54:03 +02:00
DocumentObserver.cpp LibWeb/DOM: Support changing document to observe in DocumentObserver 2025-06-24 09:56:14 +02:00
DocumentObserver.h LibWeb/DOM: Support changing document to observe in DocumentObserver 2025-06-24 09:56:14 +02:00
DocumentOrShadowRoot.idl
DocumentType.cpp LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DocumentType.h LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DocumentType.idl
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+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
DOMImplementation.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
DOMImplementation.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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
EditingHostManager.cpp LibWeb: Port document.execCommand and InputEvent to UTF-16 2025-07-26 00:40:06 +02:00
EditingHostManager.h LibWeb+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16 2025-07-26 00:40:06 +02:00
Element.cpp LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Element.h LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Element.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +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: Implement SVGViewElement 2025-07-22 00:52:24 +02:00
ElementFactory.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01: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
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/CSP: Implement the script-src directive 2025-07-09 15:52:54 -06: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 Meta: Enforce newlines around namespaces 2025-05-14 02:01:59 -06:00
HTMLCollection.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
HTMLCollection.idl
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+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16 2025-07-26 00:40:06 +02: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
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
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/CSS: Match *-namespace selectors against all attributes 2025-05-16 16:41:57 +01:00
NamedNodeMap.h LibWeb/CSS: Match *-namespace selectors against all attributes 2025-05-16 16:41:57 +01:00
NamedNodeMap.idl
Node.cpp LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Node.h LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Node.idl LibWeb: Port node text content to UTF-16 2025-07-28 18:30:50 +02: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
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
NodeList.idl
NodeOperations.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
NodeOperations.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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: Throw pre insertion validity errors from the correct global 2025-07-25 09:08:14 +02:00
ParentNode.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
ParentNode.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
ProcessingInstruction.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
ProcessingInstruction.idl
PseudoElement.cpp LibWeb: Support counter-* properties on pseudo-elements 2025-06-19 12:35:31 +01:00
PseudoElement.h LibWeb: Include or declare missing definitions for PseudoElement.h 2025-07-15 13:54:17 +01:00
QualifiedName.cpp LibWeb: Make sure we run selectors for mixed-case tag names 2025-07-09 14:36:08 +02:00
QualifiedName.h LibWeb: Make sure we run selectors for mixed-case tag names 2025-07-09 14:36:08 +02:00
Range.cpp LibWeb: Port DOM::Range stringification to UTF-16 2025-07-25 18:16:22 +02:00
Range.h LibWeb: Port DOM::Range stringification to UTF-16 2025-07-25 18:16:22 +02:00
Range.idl
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: Include own shadow root in for_each_shadow_including_descendant 2025-07-11 16:21:11 +02:00
ShadowRoot.idl
Slot.cpp
Slot.h
Slottable.cpp LibWeb/DOM: Implement 'find flattened slottables' 2025-05-19 23:26:02 +12:00
Slottable.h LibWeb/DOM: Implement 'find flattened slottables' 2025-05-19 23:26:02 +12:00
Slottable.idl
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
StyleElementUtils.cpp LibWeb: Port node text content to UTF-16 2025-07-28 18:30:50 +02:00
StyleElementUtils.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
StyleInvalidator.cpp LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
StyleInvalidator.h LibWeb: Invalidate less elements affected by CSS custom properties 2025-07-30 11:06:05 +02:00
Text.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
Text.h LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
Text.idl LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02: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
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