ladybird/Userland/Libraries/LibWeb/DOM
Andreas Kling fd7a059e09 LibWeb: Make NodeIterator behave like other browser engines
If invoking a NodeFilter ends up deleting a node from the DOM, it's not
enough to only adjust the NodeIterator reference nodes in the
pre-removing steps. We must also adjust the current traversal pointer.

This is not in the spec, but it's how other engines behave, so let's do
the same.

I've encapsulated the Node + before-or-after-flag in a struct called
NodePointer so that we can use the same pre-removing steps for both the
traversal pointer and for the NodeIterator's reference node.

Note that when invoking the NodeFilter, we have to remember the node we
passed to the filter function, so that we can return it if accepted by
the filter.

This gets us another point on Acid3. :^)
2022-03-23 00:22:36 +01:00
..
AbortController.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
AbortController.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
AbortController.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
AbortSignal.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
AbortSignal.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
AbortSignal.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
AbstractRange.h LibWeb: Abstract Range's members into AbstractRange 2022-02-26 12:53:32 +01:00
AbstractRange.idl LibWeb: Abstract Range's members into AbstractRange 2022-02-26 12:53:32 +01:00
Attribute.cpp
Attribute.h LibWeb: Make Range.setStart and Range.setEnd spec compliant 2022-02-26 12:53:32 +01:00
Attribute.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
CharacterData.cpp LibWeb: Update live DOM ranges on Text and CharacterData mutations 2022-03-21 20:06:59 +01:00
CharacterData.h LibWeb: Add CharacterData.replaceData(offset, count, data) 2022-03-21 18:05:20 +01:00
CharacterData.idl LibWeb: Add CharacterData.replaceData(offset, count, data) 2022-03-21 18:05:20 +01:00
ChildNode.h LibWeb: Convert ChildNode to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Comment.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Comment.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Comment.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
CustomEvent.cpp
CustomEvent.h
CustomEvent.idl
Document.cpp LibWeb: Convert Document to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Document.h LibWeb: Don't allow setting Range start/end to document being destroyed 2022-03-21 20:37:49 +01:00
Document.idl LibWeb: Add support for DOM's TreeWalker 2022-03-09 16:43:55 +01:00
DocumentFragment.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
DocumentFragment.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
DocumentFragment.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
DocumentLoadEventDelayer.cpp
DocumentLoadEventDelayer.h
DocumentType.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
DocumentType.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
DocumentType.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
DOMEventListener.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
DOMEventListener.h LibWeb: Use public inheritance for the RefCounted base class 2022-02-17 11:16:18 +01:00
DOMException.h
DOMException.idl
DOMImplementation.cpp LibWeb: Convert DOMImplementation to use TRY for error propagation 2022-03-22 18:05:25 +00:00
DOMImplementation.h LibWeb: Support DOMImplementation.createDocument() doctype parameter 2022-03-02 09:18:19 +01:00
DOMImplementation.idl LibWeb: Support DOMImplementation.createDocument() doctype parameter 2022-03-02 09:18:19 +01:00
DOMTokenList.cpp LibWeb: Convert DOMTokenList to use TRY for error propagation 2022-03-22 18:05:25 +00:00
DOMTokenList.h
DOMTokenList.idl
Element.cpp LibWeb: Convert Element to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Element.h LibWeb: Clear element.style when the "style" attribute is removed 2022-03-20 16:31:40 +01:00
Element.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
ElementFactory.cpp LibWeb: Add a barebones SVGTextContentElement with getNumberOfChars() 2022-03-20 13:36:45 +01:00
ElementFactory.h LibWeb: Support (and validate) prefixes in Document.createElementNS() 2022-03-02 10:55:16 +01:00
Event.cpp
Event.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Event.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
EventDispatcher.cpp LibWeb: Refactor all LabelableNode subclasses + input event handling :^) 2022-03-16 00:38:31 +01:00
EventDispatcher.h LibWeb: Separate "event listener" from "EventListener" 2022-02-16 22:21:45 +01:00
EventTarget.cpp LibWeb: Fix crash when removing event listeners 2022-03-22 02:35:07 +01:00
EventTarget.h LibWeb: Refactor all LabelableNode subclasses + input event handling :^) 2022-03-16 00:38:31 +01:00
EventTarget.idl LibWeb: Add support for the options variant of {add,remove}EventListener 2022-02-20 02:03:24 +01:00
ExceptionOr.h LibWeb: Make DOM::ExceptionOr compatible with the TRY macro 2022-03-22 12:09:27 +00:00
HTMLCollection.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
HTMLCollection.h LibWeb: Expose HTMLCollection's root element to its subclasses 2022-03-22 02:08:15 +01:00
HTMLCollection.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
IDLEventListener.h LibWeb: Add support for the options variant of {add,remove}EventListener 2022-02-20 02:03:24 +01:00
LiveNodeList.cpp
LiveNodeList.h
NamedNodeMap.cpp
NamedNodeMap.h
NamedNodeMap.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
Node.cpp LibWeb: Convert Node to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Node.h LibWeb: Add some fast_is<T> helpers for hot classes on GitHub :^) 2022-03-13 18:09:43 +01:00
Node.idl LibWeb: Implement Node.nodeValue DOM attribute 2022-02-21 16:31:45 +01:00
NodeFilter.h LibWeb: Add basic support for DOM's NodeIterator and NodeFilter 2022-03-09 16:43:00 +01:00
NodeFilter.idl LibWeb: Add basic support for DOM's NodeIterator and NodeFilter 2022-03-09 16:43:00 +01:00
NodeIterator.cpp LibWeb: Make NodeIterator behave like other browser engines 2022-03-23 00:22:36 +01:00
NodeIterator.h LibWeb: Make NodeIterator behave like other browser engines 2022-03-23 00:22:36 +01:00
NodeIterator.idl LibWeb: Add basic support for DOM's NodeIterator and NodeFilter 2022-03-09 16:43:00 +01:00
NodeList.h
NodeList.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
NodeOperations.cpp LibWeb: Convert NodeOperations to use TRY for error propagation 2022-03-22 18:05:25 +00:00
NodeOperations.h
NonDocumentTypeChildNode.h LibWeb: Implement EventHandler::focus_previous_element() 2022-02-08 22:15:10 +00:00
NonElementParentNode.h
ParentNode.cpp LibWeb: Convert ParentNode to use TRY for error propagation 2022-03-22 18:05:25 +00:00
ParentNode.h LibWeb: Add fast_is<ParentNode>() 2022-03-15 19:48:19 +01:00
Position.cpp
Position.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
ProcessingInstruction.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
ProcessingInstruction.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
ProcessingInstruction.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
QualifiedName.cpp LibWeb: Share QualifiedName data between identical instances 2022-02-19 14:45:59 +01:00
QualifiedName.h LibWeb: Share QualifiedName data between identical instances 2022-02-19 14:45:59 +01:00
Range.cpp LibWeb: Implement Range.deleteContents() 2022-03-22 20:17:52 +01:00
Range.h LibWeb: Implement Range.deleteContents() 2022-03-22 20:17:52 +01:00
Range.idl LibWeb: Implement Range.deleteContents() 2022-03-22 20:17:52 +01:00
ShadowRoot.cpp LibWeb: Convert ShadowRoot to use TRY for error propagation 2022-03-22 18:05:25 +00:00
ShadowRoot.h LibWeb: Add some fast_is<T> helpers for hot classes on GitHub :^) 2022-03-13 18:09:43 +01:00
ShadowRoot.idl LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
StaticNodeList.cpp
StaticNodeList.h
StaticRange.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
StaticRange.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
StaticRange.idl LibWeb: Implement StaticRange 2022-02-26 12:53:32 +01:00
Text.cpp LibWeb: Convert Text to use TRY for error propagation 2022-03-22 18:05:25 +00:00
Text.h LibWeb: Implement Text.splitText(offset) 2022-03-21 19:14:50 +01:00
Text.idl LibWeb: Implement Text.splitText(offset) 2022-03-21 19:14:50 +01:00
TreeWalker.cpp LibWeb: Minor cleanups in NodeIterator and TreeWalker 2022-03-23 00:19:57 +01:00
TreeWalker.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TreeWalker.idl LibWeb: Add support for DOM's TreeWalker 2022-03-09 16:43:55 +01:00