code wiki / _hdl_build / nx_css_boxmap_test.nx

nx_css_boxmap_test.nx

buildroot/runtime/_hdl_build/nx_css_boxmap_test.nx

7972 B154 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic css
docsdependenciesstructsconstsfunctions

about

nx_css_boxmap_test.nx -- styling rung 3: map the cascade onto LAYOUT BOXES. nx_layout_block looks up computed style by box-index (cd.element_idx == box_idx), and the tree has a synthetic root + text + anonymous boxes, so we build a CssElement[] indexed BY BOX: each element box (BLOCK/INLINE, not the root, not text/anon) gets the next document-order extracted element's tag/id/class; text/anon blank. Then nx_css_apply -> computed decls keyed by box_idx -> layout/paint lookups hit. Gate proves the h1 BOX receives font-size:32px (alignment correct). expect_exit: 0.

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_html_tokenizer.nx nx_dom_query.nx nx_css_selector_match.nx nx_css_tokenize.nx nx_css_parse.nx nx_css_apply.nx nx_layout_box.nx nx_layout_default_display.nx nx_layout_from_dom.nx nx_css_boxmap_test.nx

imports: nx_syscalls.nxnx_html_tokenizer.nxnx_dom_query.nxnx_css_selector_match.nxnx_css_tokenize.nxnx_css_parse.nxnx_css_apply.nxnx_layout_box.nxnx_layout_default_display.nxnx_layout_from_dom.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main bm_slen sys_mmap bm_extract sys_mmap ↻ nx_html_cursor_init nx_html_next_token _scan_name _is_name _is_void_element _lc nx_dom_find_attr _dq_strlen _dq_find_substr_ci _dq_byte_eq_ci _dq_lc nx_layout_tree_init nx_layout_from_dom_stack_i nx_layout_from_dom nx_layout_box_append _layout_box_at _lfd_push sys_mmap ↻ nx_html_cursor_init ↻ nx_html_next_token ↻ _lfd_is_chrome_start _lfd_chrome_tag _lfd_has_role_nav _lfd_name_eq _lfd_lc _lfd_has_chrome_class _lfd_src_has_sub _lfd_inline_hidden _lfd_src_has_sub ↻ nx_layout_default_display _disp_eq1 _disp_lc _disp_is_h_family _disp_lc ↻ _disp_eq2

structs

none

consts

none

functions

18func bm_slen(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} return k }
19func bm_puts(s: *u8) -> i64 { sys_write(1, s, bm_slen(s)); return 0 }
called by 1: main calls 2: sys_writebm_slen
20func bm_pn(v: i64) -> i64 { let b: *u8=sys_mmap(20); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m}; let t: *u8=sys_mmap(20); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=48+(m%10);m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
21func bm_region_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64
called by 1: main calls 1: bm_slen
29func bm_extract(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64
53func bm_is_elem_kind(k: i64) -> i64
called by 1: main
60func main() -> i64