code wiki / _hdl_build / nx_css_cascade_test.nx
nx_css_cascade_test.nx
buildroot/runtime/_hdl_build/nx_css_cascade_test.nx
about
nx_css_cascade_test.nx -- styling rung 2: HTML + a UA stylesheet -> per-element COMPUTED styles.
The cascade (nx_css_apply / nx_css_selector_match) requires rules + elements to share ONE src buffer,
so we build a combined [HTML][CSS] buffer: element tag offsets land in the HTML part, rule selector
offsets in the CSS part, one shared src -> selector "h1" byte-matches tag "h1". Composes the rung-1
extractor + nx_css_tokenize/parse + nx_css_apply. expect_exit: 0.
dependencies 7 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.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
| 14 | func cc_slen(s: *u8) -> i64 { var k: i64 = 0; while s[k] != (0 as u8) { k = k + 1 } return k } |
| 15 | func cc_puts(s: *u8) -> i64 { sys_write(1, s, cc_slen(s)); return 0 } |
| 16 | func cc_pn(v: i64) -> i64 { let b: *u8=sys_mmap(20); var m: i64=v; 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 } |
| 19 | func cc_extract(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64 |
| 49 | func cc_region_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64 |
| 57 | func main() -> i64 |