code wiki / _hdl_build / nx_browser_find_gate.nx
nx_browser_find_gate.nx
buildroot/runtime/_hdl_build/nx_browser_find_gate.nx
about
nx_browser_find_gate.nx -- gate for FIND-IN-PAGE (the Ctrl+F feature every browser has; UX census had
it as an ADMITTED gap -- this flips it, with EVIDENCE). Proves on the real bench page through the real
core: (T1) the term "wizards" is FOUND with the right match count; (T2) the first-match page-y is
returned (scroll-to target) and really is the paragraph's y; (T3) with the find active the render shows
HIGHLIGHT pixels (#FFE066) under the match; (T4) with no find active there are ZERO highlight pixels;
(T5) NEG: an absent term matches 0 and highlights NOTHING (the highlighter cannot false-fire);
(T6) case-insensitive ("WIZARDS" == "wizards"); (T7) EVIDENCE CLIP recorded: page -> find+highlight ->
scrolled-to-match, browser-playable APNG (knowledge/status/usersim_find_clip.png).
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_browser_render.nxnx_apng_write.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const FG_W: i64 = 500 |
| 17 | const FG_H: i64 = 400 |
functions
| 13 | func fg_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func fg_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); 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} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 20 | func fg_frame(page: *Page, sy: i64) -> *u8 |
| 28 | func fg_hl(px: *u8) -> i64 |
| 37 | func fg_rgb(px: *u8, rgb: *u8) -> i64 |
| 43 | func main() -> i64 |