mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibWeb: Implement "NodeIterator pre-removing steps"
These steps run when a node is about to be removed from its parent, and adjust the position of any live NodeIterators so that they don't point at a now-removed node. Note that while this commit implements what's in the DOM specification, the specification doesn't fully match what other browsers do. Spec bug: https://github.com/whatwg/dom/issues/907
This commit is contained in:
parent
acbdb95b0a
commit
9c6999ecf2
5 changed files with 91 additions and 2 deletions
|
@ -387,7 +387,10 @@ void Node::remove(bool suppress_observers)
|
|||
// FIXME: For each live range whose start node is parent and start offset is greater than index, decrease its start offset by 1.
|
||||
// FIXME: For each live range whose end node is parent and end offset is greater than index, decrease its end offset by 1.
|
||||
|
||||
// FIXME: For each NodeIterator object iterator whose root’s node document is node’s node document, run the NodeIterator pre-removing steps given node and iterator.
|
||||
// For each NodeIterator object iterator whose root’s node document is node’s node document, run the NodeIterator pre-removing steps given node and iterator.
|
||||
document().for_each_node_iterator([&](NodeIterator& node_iterator) {
|
||||
node_iterator.run_pre_removing_steps(*this);
|
||||
});
|
||||
|
||||
// FIXME: Let oldPreviousSibling be node’s previous sibling. (Currently unused so not included)
|
||||
// FIXME: Let oldNextSibling be node’s next sibling. (Currently unused so not included)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue