code wiki / (root) / nx_dom_query.nx

nx_dom_query.nx

buildroot/runtime/nx_dom_query.nx

15223 B405 linesdepth 2pulls 3 transitivereach 250 importersview sourcekind librarytopic dom
docsdependenciesstructsconstsfunctions

about

nx_dom_query.nx -- bits-up DOM query primitives for the Nishi test harness arc. Subset of full nishi-browser (see NISHI_BROWSER_ROADMAP.md); scoped specifically to what the .mjs Playwright harnesses need so they can be retired per [[feedback-test-harness-is-the-last-non-bits-up-surface]]. Built on top of nx_html_tokenizer.nx (HtmlCursor + nx_html_next_token). Four MVP queries the test harness needs: nx_dom_find_class -- first START_TAG whose class attr contains a word nx_dom_find_attr_eq -- first START_TAG with attr="value" (exact) nx_dom_count_tag -- count START_TAGs with given tag name nx_dom_count_class -- count START_TAGs whose class attr contains word All scan the HTML byte buffer directly via the existing tokenizer. No allocations beyond the caller's buffer; offsets returned into the source.

dependencies 2 imports · 33 importers

nx_syscalls.nx nx_html_tokenizer.nx nx_dom_query.nx nx_align_gate.nx nx_browse.nx nx_browser.nx nx_browser_forms.nx nx_browser_render.nx nx_cdata_probe.nx nx_chk_bits_up_e2e.nx nx_css_boxmap_test.nx nx_css_cascade_test.nx nx_css_extract_test.nx

diagram shows first 10 each side; +0 more imports, +23 more importers in the complete lists below.

imports: nx_syscalls.nxnx_html_tokenizer.nx

imported by: nx_align_gate.nxnx_browse.nxnx_browser.nxnx_browser_forms.nxnx_browser_render.nxnx_cdata_probe.nxnx_chk_bits_up_e2e.nxnx_css_boxmap_test.nxnx_css_cascade_test.nxnx_css_extract_test.nxnx_dom_click.nxnx_dom_query_test.nxnx_flexgrow_gate.nxnx_flexgrow_probe.nxnx_float_gate.nxnx_float_test.nxnx_grid_gate.nxnx_grid_test.nxnx_grid_track_gate.nxnx_html_extract_imgs.nxnx_html_extract_links.nxnx_js_eval.nxnx_justify_gate.nxnx_layout_debug.nxnx_negmargin_gate.nxnx_real_page_gate.nxnx_render_html.nxnx_render_wiki_styled_window.nxnx_table_cell_gate.nxnx_test_driver_e2e.nxnx_test_harness.nxnx_ttt_bits_up_e2e.nxnx_wiki_boxdump.nx

structs

20struct NxDomQueryResult

consts

none

functions

30func _dq_strlen(s: *u8) -> i64
36func _dq_byte_eq(a: *u8, ao: i64, b: *u8, bo: i64, n: i64) -> i64
47func _dq_find_substr(hay: *u8, hay_off: i64, hay_len: i64,
calls 1: _dq_byte_eq
61func _dq_lc(b: i64) -> i64
called by 1: _dq_byte_eq_ci
68func _dq_byte_eq_ci(a: *u8, ao: i64, b: *u8, bo: i64, n: i64) -> i64
79func _dq_find_substr_ci(hay: *u8, hay_off: i64, hay_len: i64,
called by 1: nx_dom_find_attr calls 1: _dq_byte_eq_ci
94func _dq_is_word_boundary(b: i64) -> i64
107func _dq_is_elem(kind: i64) -> i64
120func nx_dom_find_attr(src: *u8, tag_off: i64, tag_len: i64,
209func nx_dom_class_contains(src: *u8, val_off: i64, val_len: i64,
246func nx_dom_find_class(html: *u8, html_len: i64,
286func nx_dom_find_attr_eq(html: *u8, html_len: i64,
327func nx_dom_count_tag(html: *u8, html_len: i64, tag_name: *u8) -> i64
349func nx_dom_find_tag(html: *u8, html_len: i64, tag_name: *u8) -> *NxDomQueryResult
382func nx_dom_count_class(html: *u8, html_len: i64, class_name: *u8) -> i64