We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f884627 commit 2402443Copy full SHA for 2402443
src/cdp/domains/dom.zig
@@ -113,9 +113,14 @@ fn dispatchSetChildNodes(cmd: anytype, nodes: []*parser.Node) !void {
113
if (plen == 0) return;
114
115
var i: usize = plen;
116
+ // We're going to iterate in reverse order from how we added them.
117
+ // This ensures that we're emitting the tree of nodes top-down.
118
while (i > 0) {
119
i -= 1;
120
const node = parents.items[i];
121
+ // Although our above loop won't add an already-sent node to `parents`
122
+ // this can still be true because two nodes can share the same parent node
123
+ // so we might have just sent the node a previous iteration of this loop
124
if (node.set_child_nodes_event) continue;
125
126
node.set_child_nodes_event = true;
0 commit comments