WebContent: Add more IPC endpoints for getting Elements

This patch adds `get_document_element()` and `query_selector_all()`
which return Node's IDs.

    `get_document_element` returns the ID of the document element

    `query_selector_all` returns the IDs of all elements matching the
    selector starting at the Node associated with the start_node_id
This commit is contained in:
Tobias Christiansen 2022-10-18 12:40:14 +02:00 committed by Linus Groh
commit 281991057c
Notes: sideshowbarker 2024-07-17 05:22:30 +09:00
3 changed files with 41 additions and 0 deletions

View file

@ -37,6 +37,9 @@ endpoint WebContentServer
js_console_input(String js_source) =|
js_console_request_messages(i32 start_index) =|
get_document_element() => (Optional<i32> node_id)
query_selector_all(i32 start_node_id, String selector) => (Optional<Vector<i32>> elements_ids)
run_javascript(String js_source) =|
dump_layout_tree() => (String dump)