code wiki / _hdl_build / nx_rawtext_layout_gate.nx

nx_rawtext_layout_gate.nx

buildroot/runtime/_hdl_build/nx_rawtext_layout_gate.nx

3994 B67 linesdepth 9pulls 29 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_rawtext_layout_gate.nx -- PROOF (re-runnable) of the google-blank root fix: a bare `<` inside a <script>/<style> body (e.g. JS `a<b`, `if (x<y)`) must NOT eat the closing tag and suppress the rest of the page. Before the fix, layout_from_dom relied on a `suppress` counter and let the tokenizer parse `<b` as a start tag whose attribute-skip consumed `</script>` -> script never closed -> all following visible text dropped (google.com rendered blank while laying out 3378px). Fix = layout_from_dom now consumes raw-text bodies via the HTML5 scanner, like the 3 other tokenizer consumers already did. Each test lays out an inline fixture through the REAL br_layout and asserts the post-script text renders. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_browser_render.nx nx_rawtext_layout_gate.nx

imports: nx_syscalls.nxnx_browser_render.nx

imported by: nobody (leaf or entry point)

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

main rt_w sys_write rt_case rt_w ↻ rt_renders sys_mmap rt_slen br_layout br_slen sys_mmap ↻ rh_extract_styles sys_mmap ↻ nx_html_cursor_init nx_html_next_token _scan_name _is_void_element nx_html_is_raw_text_tag _lc nx_html_consume_raw_text _lc ↻ _is_ws _lfd_name_eq _lfd_lc _rh_copy_css rh_filter_media sys_mmap ↻ rh_find rh_media_matches rh_find ↻ rh_num_after cx_expand sys_mmap ↻ cx_collect cx_emit_span clamp_resolve cx_ch clamp_eval cl_emit_int nx_layout_tree_init

structs

none

consts

none

functions

12func rt_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: rt_casemain calls 1: sys_write
13func rt_n(v: i64) -> i64 { let t: *u8=sys_mmap(24); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(24); var j: i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
14func rt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: rt_hasrt_renders
15func rt_box(t: *LayoutTree, i: i64) -> *LayoutBox
called by 1: rt_renders
18func rt_has(src: *u8, off: i64, len: i64, m: *u8) -> i64
called by 1: rt_renders calls 1: rt_slen
32func rt_renders(html: *u8, marker: *u8) -> i64
49func rt_case(html: *u8, marker: *u8, label: *u8) -> i64
called by 1: main calls 2: rt_wrt_renders
56func main() -> i64