ladybird/Libraries/LibWeb/DOM
Andreas Kling fa579754bf LibWeb: Use invalidation plans for pseudo-class changes
Replace PseudoClassInvalidator's subtree scan with targeted
invalidation for elements whose pseudo-class state changes. This scopes
state changes to affected selectors instead of rechecking a whole
common-ancestor subtree.

Use the ancestor chain that matches each pseudo-class. Hover walks the
shadow-including chain. :focus-within walks the flat-tree chain, so
slotted content invalidates its assigned slot and relevant shadow-tree
descendants. Focus, FocusVisible, and Target invalidate just the state
node.

Route each affected element through Element::invalidate_style with the
pseudo-class property. This uses the same invalidation-plan machinery as
Disabled, Checked, and other pseudo-class state changes.

Interaction state pseudo classes are not tracked in :has() metadata, so
schedule :has() ancestor invalidation explicitly when the state flips.
The callers no longer need cross-scope branching. The chain walk handles
shadow boundaries, and property invalidation already visits every
observer style scope.
2026-05-23 23:37:36 +02:00
..
AbortController.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
AbortController.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
AbortController.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
AbortSignal.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
AbortSignal.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
AbortSignal.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
AbstractElement.cpp LibWeb: Apply "element-reference" pseudo inline styles correctly 2026-05-21 14:26:22 +01:00
AbstractElement.h LibWeb: Apply "element-reference" pseudo inline styles correctly 2026-05-21 14:26:22 +01:00
AbstractRange.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
AbstractRange.h
AbstractRange.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
AccessibilityTreeNode.cpp
AccessibilityTreeNode.h AK+LibWeb: Reduce recompilation impact of DOM/Node.h 2026-02-11 20:02:28 +01:00
AdoptedStyleSheets.cpp LibWeb: Move adopted stylesheet invalidation into a helper 2026-04-29 15:47:23 +02:00
AdoptedStyleSheets.h
AnchorNameMap.cpp LibWeb: Keep track of elements with an anchor-name set 2026-04-01 19:41:46 +01:00
AnchorNameMap.h LibWeb: Keep track of elements with an anchor-name set 2026-04-01 19:41:46 +01:00
Attr.cpp LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
Attr.h
Attr.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
CDATASection.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
CDATASection.h
CDATASection.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
CharacterData.cpp LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
CharacterData.h LibWeb: Account text and image storage as external memory 2026-05-07 10:03:09 +02:00
CharacterData.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
ChildNode.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
ChildNode.idl LibWeb: Remove some outdated #import related FIXMEs 2026-05-03 10:56:45 +02:00
Comment.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
Comment.h
Comment.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
CustomEvent.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
CustomEvent.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
CustomEvent.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Document.cpp LibWeb: Use invalidation plans for pseudo-class changes 2026-05-23 23:37:36 +02:00
Document.h LibWeb: Avoid cold rule cache builds for :has() checks 2026-05-23 22:03:46 +02:00
Document.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
DocumentFragment.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
DocumentFragment.h
DocumentFragment.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
DocumentLoadEventDelayer.cpp
DocumentLoadEventDelayer.h
DocumentLoading.cpp LibWeb: Ensure XML error documents always finish loading 2026-05-22 09:59:19 +01:00
DocumentLoading.h LibWeb: Remove "signal to continue SHTQ" from document loading 2026-04-01 06:47:59 +02:00
DocumentObserver.cpp
DocumentObserver.h LibWeb: Give IDL exposed PlatformObjects an InterfaceName 2026-02-14 20:22:40 +01:00
DocumentOrShadowRoot.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
DocumentOrShadowRoot.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
DocumentType.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
DocumentType.h Utilities: Add dump-html-tree 2026-05-17 15:35:56 +02:00
DocumentType.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
DOMEventListener.cpp
DOMEventListener.h
DOMImplementation.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
DOMImplementation.h
DOMImplementation.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
DOMTokenList.cpp LibWeb: Account DOM state as external memory 2026-05-07 10:03:09 +02:00
DOMTokenList.h LibWeb: Account DOM state as external memory 2026-05-07 10:03:09 +02:00
DOMTokenList.idl
EditingHostManager.cpp LibWeb: Do not scroll cursor into view on programmatic selection changes 2026-02-17 10:24:00 +01:00
EditingHostManager.h
Element.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
Element.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
Element.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
ElementByIdMap.cpp LibWeb: Lazify ElementByIdMap resolution and cache first element 2026-02-21 13:56:00 +01:00
ElementByIdMap.h LibWeb: Lazify ElementByIdMap resolution and cache first element 2026-02-21 13:56:00 +01:00
ElementFactory.cpp LibWeb: Implement scoped custom element registries 2026-03-27 19:49:55 +00:00
ElementFactory.h LibWeb: Implement scoped custom element registries 2026-03-27 19:49:55 +00:00
Event.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Event.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
Event.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
EventDispatcher.cpp LibWeb: Skip event dispatching work if there are no relevant listeners 2026-03-10 16:57:36 +01:00
EventDispatcher.h
EventHandler.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
EventListener.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
EventTarget.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
EventTarget.h LibWeb: Avoid GC::Root churn in wheel listener checks 2026-05-15 17:25:10 +02:00
EventTarget.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
FragmentSerializationMode.h AK+LibWeb: Reduce recompilation impact of DOM/Node.h 2026-02-11 20:02:28 +01:00
HoverEventData.h LibWeb: Populate platform mouse event data 2026-05-19 11:22:02 +02:00
HTMLCollection.cpp LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
HTMLCollection.h LibWeb: Implement the required virtual owner_cell() on HTMLCollection 2026-05-14 13:27:56 +01:00
HTMLCollection.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
IDLEventListener.cpp
IDLEventListener.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
InputEventsTarget.h
LiveNodeList.cpp LibGC: Default-construct RootVector from the global heap 2026-05-20 20:37:55 +02:00
LiveNodeList.h LibWeb: Give IDL exposed PlatformObjects an InterfaceName 2026-02-14 20:22:40 +01:00
MutationObserver.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
MutationObserver.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
MutationObserver.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
MutationRecord.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
MutationRecord.h
MutationRecord.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
MutationType.cpp
MutationType.h
NamedNodeMap.cpp LibWeb: Stop retaining fragment-parsing documents after adoption 2026-05-21 08:56:41 +02:00
NamedNodeMap.h LibWeb: Stop retaining fragment-parsing documents after adoption 2026-05-21 08:56:41 +02:00
NamedNodeMap.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Node.cpp LibWeb: Stop idle animated CSS image timers 2026-05-23 11:36:53 +02:00
Node.h LibWeb: Limit non-inherited inherit tracking to direct children 2026-05-22 09:38:59 +02:00
Node.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
NodeFilter.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
NodeFilter.h LibWeb/Bindings: Implement callback interface object bindings 2026-03-11 21:16:44 +01:00
NodeFilter.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
NodeIterator.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
NodeIterator.h LibWeb/Bindings: Implement callback interface object bindings 2026-03-11 21:16:44 +01:00
NodeIterator.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
NodeList.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
NodeList.h
NodeList.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
NodeOperations.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
NodeOperations.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
NodeType.h
NonDocumentTypeChildNode.h
ParentNode.cpp LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
ParentNode.h LibWeb: Unify WebIDL C++ type generation 2026-05-23 18:26:12 +02:00
ParentNode.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Position.cpp
Position.h AK+LibWeb: Reduce recompilation impact of DOM/Node.h 2026-02-11 20:02:28 +01:00
ProcessingInstruction.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
ProcessingInstruction.h
ProcessingInstruction.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
PseudoElement.cpp LibWeb: Forward non-synthetic pseudo-elt accesses to relevant element 2026-05-21 14:26:22 +01:00
PseudoElement.h LibWeb: Apply "element-reference" pseudo inline styles correctly 2026-05-21 14:26:22 +01:00
QualifiedName.cpp
QualifiedName.h
Range.cpp LibWeb: Repaint when a range is dissociated from a selection 2026-05-20 21:32:00 +02:00
Range.h
Range.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
RequestFullscreenError.h LibWeb: Move RequestFullscreenError out of Element.h 2026-03-17 18:58:37 -05:00
SelectionchangeEventDispatching.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ShadowRoot.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ShadowRoot.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
ShadowRoot.idl LibWeb: Align declarative shadow root parsing 2026-05-17 15:35:56 +02:00
Slot.cpp LibJS+LibWeb: Use the unified Visitor for Variant-holding members 2026-05-15 08:51:17 +02:00
Slot.h
SlotRegistry.cpp
SlotRegistry.h
Slottable.cpp LibWeb: Move slotted style invalidation into a helper 2026-04-29 15:47:23 +02:00
Slottable.h
Slottable.idl LibWeb: Remove some outdated #import related FIXMEs 2026-05-03 10:56:45 +02:00
StaticNodeList.cpp LibWeb: Account DOM state as external memory 2026-05-07 10:03:09 +02:00
StaticNodeList.h LibWeb: Account DOM state as external memory 2026-05-07 10:03:09 +02:00
StaticRange.cpp LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
StaticRange.h LibWeb/Bindings: Generate struct definitions from IDL dictionaries 2026-05-09 10:49:49 +02:00
StaticRange.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
StyleElementBase.cpp LibWeb: Replace spin_until in HTMLParser::the_end() with state machine 2026-03-28 23:14:55 +01:00
StyleElementBase.h LibWeb: Delay the load event until critical style subresources load 2026-02-12 16:23:12 +01:00
StyleInvalidationReason.h LibWeb: Use invalidation plans for pseudo-class changes 2026-05-23 23:37:36 +02:00
Text.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
Text.h
Text.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
TreeWalker.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
TreeWalker.h LibWeb/Bindings: Implement callback interface object bindings 2026-03-11 21:16:44 +01:00
TreeWalker.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
Utils.cpp LibWeb: Replace is<T> + as<T> with as_if<T> 2026-03-10 15:17:51 +01:00
Utils.h
ViewportClient.h LibWeb: Reduce recompilation impact of DOM/Document.h 2026-02-11 20:02:28 +01:00
XMLDocument.cpp LibWeb/Bindings: Emit one bindings header and cpp per IDL 2026-04-21 07:36:13 +02:00
XMLDocument.h
XMLDocument.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00