Skip to content

Commit 4f4e94d

Browse files
AtkinsSJgmta
authored andcommitted
LibWeb/DOM: Update spec steps for Node::remove()
No behaviour changes.
1 parent 6a4ab26 commit 4f4e94d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Libraries/LibWeb/DOM/Node.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,13 +1004,13 @@ void Node::remove(bool suppress_observers)
10041004
}
10051005
}
10061006

1007-
// 14. For each shadow-including descendant descendant of node, in shadow-including tree order, then:
1007+
// 14. For each shadow-including descendant descendant of node, in shadow-including tree order:
10081008
for_each_shadow_including_descendant([&](Node& descendant) {
1009-
// 1. Run the removing steps with descendant
1009+
// 1. Run the removing steps with descendant and null.
10101010
descendant.removed_from(nullptr, parent_root);
10111011

1012-
// 2. If descendant is custom and isParentConnected is true, then enqueue a custom element callback reaction with descendant,
1013-
// callback name "disconnectedCallback", and an empty argument list.
1012+
// 2. If descendant is custom and isParentConnected is true, then enqueue a custom element callback reaction
1013+
// with descendant, callback name "disconnectedCallback", and « ».
10141014
if (auto* element = as_if<DOM::Element>(descendant)) {
10151015
if (element->is_custom() && is_parent_connected) {
10161016
GC::RootVector<JS::Value> empty_arguments { vm().heap() };
@@ -1021,9 +1021,10 @@ void Node::remove(bool suppress_observers)
10211021
return TraversalDecision::Continue;
10221022
});
10231023

1024-
// 15. For each inclusive ancestor inclusiveAncestor of parent, and then for each registered of inclusiveAncestor’s registered observer list,
1025-
// if registered’s options["subtree"] is true, then append a new transient registered observer
1026-
// whose observer is registered’s observer, options is registered’s options, and source is registered to node’s registered observer list.
1024+
// 15. For each inclusive ancestor inclusiveAncestor of parent, and then for each registered of inclusiveAncestor’s
1025+
// registered observer list, if registered’s options["subtree"] is true, then append a new transient registered
1026+
// observer whose observer is registered’s observer, options is registered’s options, and source is registered
1027+
// to node’s registered observer list.
10271028
for (auto* inclusive_ancestor = parent; inclusive_ancestor; inclusive_ancestor = inclusive_ancestor->parent()) {
10281029
if (!inclusive_ancestor->m_registered_observer_list)
10291030
continue;
@@ -1035,7 +1036,8 @@ void Node::remove(bool suppress_observers)
10351036
}
10361037
}
10371038

1038-
// 16. If suppress observers flag is unset, then queue a tree mutation record for parent with « », « node », oldPreviousSibling, and oldNextSibling.
1039+
// 16. If suppressObservers is false, then queue a tree mutation record for parent with « », « node »,
1040+
// oldPreviousSibling, and oldNextSibling.
10391041
if (!suppress_observers) {
10401042
parent->queue_tree_mutation_record({}, { *this }, old_previous_sibling.ptr(), old_next_sibling.ptr());
10411043
}

0 commit comments

Comments
 (0)