code wiki / _hdl_build / nx_css_boxmap_test.nx
nx_css_boxmap_test.nx
buildroot/runtime/_hdl_build/nx_css_boxmap_test.nx
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
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
structs
| none |
consts
| none |
functions
| 18 | func bm_slen(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} return k } |
| 19 | func bm_puts(s: *u8) -> i64 { sys_write(1, s, bm_slen(s)); return 0 } |
| 20 | func 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 } |
| 21 | func bm_region_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64 |
| 29 | func bm_extract(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64 |
| 53 | func bm_is_elem_kind(k: i64) -> i64 called by 1: main |
| 60 | func main() -> i64 |