ladybird/Libraries/LibWeb/DOM
Aliaksandr Kalenik 5874b7a76f LibWeb: Skip update_associated_selection() when there's no selection
This change fixes at least two issues:
- `update_associated_selection()` is responsible for selectionchange
  dispatch, and we were incorrectly dispatching this event on ranges
  that were not associated with a selection.
- `Range::get_client_rects()` was using `update_associated_selection()`
  to refresh the selection state in the paintable tree for the current
  range, but since a range might not be associated with a selection,
  this could make the painted selection reflect the state of an
  arbitrary range instead of the actual selection range.

Fixes a bug on Discord where any text typed into the message input would
get selected.
2025-07-03 22:16:39 +02:00
..
AbortController.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
AbortController.h
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: Support counter-* properties on pseudo-elements 2025-06-19 12:35:31 +01:00
AbstractElement.h LibWeb: Support counter-* properties on pseudo-elements 2025-06-19 12:35:31 +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
AccessibilityTreeNode.cpp
AccessibilityTreeNode.h
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: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CDATASection.h
CDATASection.idl
CharacterData.cpp AK+Everywhere: Allow lonely UTF-16 surrogates by default 2025-07-03 09:51:56 -04:00
CharacterData.h
CharacterData.idl
ChildNode.h
ChildNode.idl
Comment.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
Comment.h
Comment.idl
CustomEvent.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
CustomEvent.h
CustomEvent.idl
Document.cpp LibURL: Replace use of URL::get_public_suffix 2025-06-29 12:47:57 +01:00
Document.h LibWeb: Avoid infinite loop in HTMLElement.scrollParent 2025-06-30 20:38:21 +01:00
Document.idl LibWeb: Implement Document.rootElement (SVG2 extension to Document) 2025-05-16 20:36:07 +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: Correct some spec typos 2025-04-10 04:01:37 +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
DOMEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
DOMImplementation.cpp LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DOMImplementation.h LibWeb: Update DOMImplementation.createDocumentType() name validation 2025-06-19 07:55:47 -04:00
DOMImplementation.idl
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: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +02:00
EditingHostManager.h LibWeb: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +02:00
Element.cpp LibWeb/DOM: Serialize pseudo-elements in the correct order 2025-07-03 09:56:56 +01:00
Element.h LibWeb/DOM: Serialize pseudo-elements in the correct order 2025-07-03 09:56:56 +01: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
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
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 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
IDLEventListener.h LibWeb: Correctly implement event listeners default passive attribute 2024-12-25 14:57:22 +00:00
InputEventsTarget.h LibWeb: Start integrating the editing API with user keyboard input 2025-05-17 00:29:19 +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
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/DOM: Serialize pseudo-elements in the correct order 2025-07-03 09:56:56 +01:00
Node.h LibWeb/DOM: Serialize pseudo-elements in the correct order 2025-07-03 09:56:56 +01:00
Node.idl
NodeFilter.cpp
NodeFilter.h
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
NodeOperations.h
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
Position.h
ProcessingInstruction.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
ProcessingInstruction.h
ProcessingInstruction.idl
PseudoElement.cpp LibWeb: Support counter-* properties on pseudo-elements 2025-06-19 12:35:31 +01:00
PseudoElement.h LibWeb/DOM: Move pseudo-element scroll offsets into PseudoElement 2025-06-19 12:35:31 +01:00
QualifiedName.cpp
QualifiedName.h
Range.cpp LibWeb: Skip update_associated_selection() when there's no selection 2025-07-03 22:16:39 +02:00
Range.h LibWeb: Delete unused Range::inverted() 2025-07-03 15:00:49 +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: Make Document::m_shadow_roots an IntrusiveList 2025-04-10 04:01:00 +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
StaticNodeList.h
StaticRange.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
StaticRange.h
StaticRange.idl
StyleElementUtils.cpp LibWeb: Prefer using equals_ignoring_ascii_case 2025-05-21 13:45:02 +01:00
StyleElementUtils.h
Text.cpp LibWeb: Modify range start & end directly where applicable 2025-05-15 11:44:32 +01:00
Text.h LibWeb: Remove unused pointer from DOM::Text to its "owner" element 2024-12-27 12:27:03 +01:00
Text.idl
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