-
Notifications
You must be signed in to change notification settings - Fork 288
scrollIntoViewIfNeeded, getContentQuads, innerWidth/Heigh #638
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
60c2198 to
85f83e8
Compare
85f83e8 to
4cb14cd
Compare
| } | ||
|
|
||
| pub fn _scrollIntoViewIfNeeded(_: *parser.Element, center_if_needed: ?bool) void { | ||
| _ = center_if_needed; |
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.
We could register the element in the renderer..
| fn getNode(arena: Allocator, browser_context: anytype, node_id: ?Node.Id, backend_node_id: ?Node.Id, object_id: ?[]const u8) !*Node { | ||
| const input_node_id = node_id orelse backend_node_id; | ||
| if (input_node_id) |input_node_id_| { | ||
| return browser_context.node_registry.lookup_by_id.get(input_node_id_) orelse return error.NodeNotFound; |
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.
Would a getById function on registry be useful?
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.
To reduce: .lookup_ _. I personally am not a fan of convenience functions.
| const parser_node = try bc.inspector.getNodePtr(cmd.arena, params.objectId.?); | ||
| const node = try bc.node_registry.register(@ptrCast(parser_node)); | ||
| return cmd.sendResult(.{ .node = bc.nodeWriter(node, .{}) }, .{}); | ||
| const parser_node = try browser_context.inspector.getNodePtr(arena, object_id_); |
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.
I don't really know what getNodePtr is doing. It's ok that its memory (from the arena) will be gone after this function returns?
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.
Only the object_group may be returned on the allocator, which is not used. (Arena is also used for temporary error strings, but not returned (returned as error enum))
93f51de to
f74647c
Compare
element.scrollIntoViewIfNeededDOM.scrollIntoViewIfNeededDOM.getContentQuadsinnerHeightinnerWidth