-
Notifications
You must be signed in to change notification settings - Fork 286
cdp: dispatch DOM.setChildNodes event for search results #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/cdp/domains/dom.zig
Outdated
| const parent_node = try bc.node_registry.register(p); | ||
| const node = bc.node_registry.lookup_by_node.get(n) orelse unreachable; | ||
| // Should-we return one DOM.setChildNodes event per parentId | ||
| // containing all its children in the nodes array? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
If it's something we'll need to do often, we could expand the NodeWriter. It already takes a placeholder option, so it could be something like:
.nodes = bc.nodeWriter(parent_node, .{.mode = .child_list})},
|
We have to dispatch the |
Really? I was pretty sure it was just the node's sibling, or, maybe more accurately, the node's parent children. I don't see a leak, both in the CI and locally, it's an const parent_node = bc.node_registry.lookup_by_node.get(p) orelse unreachable;I don't think there's any reason to assume the parent has been seen by the registry before. Always better to use const node = try bc.node_registry.register(parser.documentToNode(doc));After that, you'll get a crash because the session_id isn't set. I would do 2 things here: 1 - var bc = ...
const session_id = bc.session_id orelse return error.SessionIdNotLoaded;2 - Change the cdp/testing.zig // existing if statement
if (opts.html) |html| {
// add
if (bc.session_id == null) bc.session_id = "SID-X";
..
} |
|
The issue is fixed. I added a bool into
Yes it is as far as I can see. .. |
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
No description provided.