code wiki / (root) / nx_css_apply_test.nx

nx_css_apply_test.nx

buildroot/runtime/nx_css_apply_test.nx

7696 B210 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic css
docsdependenciesstructsconstsfunctions

about

nx_css_apply_test.nx -- smoke for the Phase-2 cascade primitive. Hand-builds CssRule + CssDeclaration + CssElement arrays into a shared source buffer (so byte equality is well-defined), runs the O(R x E) match-and-emit loop, then exercises the property lookup helper. Fixture stylesheet (semantically): body { color: #ff0000; } .head { font-size: 16px; } Fixture elements: el0: <body> (TAG body) el1: <span class="head"> (CLASS head) el2: <span class="other"> (CLASS other -- no match) Expected cascade output: 3 computed entries: (el0, color = #ff0000) (el1, font-size = DIMENSION 16 px) Wait -- el2 contributes zero entries; el0 contributes 1; el1 contributes 1. Total = 2 entries. Let's also verify the lookup helper returns correct values per element.

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_css_tokenize.nx nx_css_parse.nx nx_css_selector_match.nx nx_css_apply.nx nx_css_apply_test.nx

imports: nx_syscalls.nxnx_css_tokenize.nxnx_css_parse.nxnx_css_selector_match.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

main _build_src sys_mmap _put_byte sys_mmap ↻ nx_css_element_init nx_css_apply nx_css_selector_match _css_bytes_equal _css_class_list_contains _css_is_class_separator _css_bytes_equal ↻ nx_css_lookup_property _css_apply_bytes_equal

structs

none

consts

none

functions

31func _put_byte(buf: *u8, i: i64, v: i64) -> i64
called by 1: _build_src
46func _build_src() -> *u8
called by 1: main calls 2: sys_mmap_put_byte
109func main() -> i64