mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
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.
This commit is contained in:
parent
58e2fe895c
commit
f3e14d7f64
Notes:
sideshowbarker
2024-07-16 22:24:48 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/f3e14d7f64 Pull-request: https://github.com/SerenityOS/serenity/pull/21764 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 3 deletions
|
@ -456,8 +456,8 @@ void Node::insert_before(JS::NonnullGCPtr<Node> node, JS::GCPtr<Node> 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> node, JS::GCPtr<Node> 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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue