From f3e14d7f6450551ef413ba3473cf3e016dd4fced Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 3 Nov 2023 14:22:09 -0400 Subject: [PATCH] LibWeb: Use correct variable when handling slottables in node insertion Errantly copied the variable name from the spec. The `node` variable in this scope is what we passed to Node::insert_before; `node_to_insert` is what the spec is actually referring to as `node` here. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index a9a20de805..9c18ebf226 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -456,8 +456,8 @@ void Node::insert_before(JS::NonnullGCPtr node, JS::GCPtr child, boo auto is_named_shadow_host = element.is_shadow_host() && element.shadow_root_internal()->slot_assignment() == Bindings::SlotAssignmentMode::Named; - if (is_named_shadow_host && node->is_slottable()) - assign_a_slot(node->as_slottable()); + if (is_named_shadow_host && node_to_insert->is_slottable()) + assign_a_slot(node_to_insert->as_slottable()); } // 5. If parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run @@ -470,7 +470,7 @@ void Node::insert_before(JS::NonnullGCPtr node, JS::GCPtr child, boo } // 6. Run assign slottables for a tree with node’s root. - assign_slottables_for_a_tree(node->root()); + assign_slottables_for_a_tree(node_to_insert->root()); node_to_insert->invalidate_style();