nx_layout_block_horizontal_test.nx
buildroot/runtime/nx_layout_block_horizontal_test.nx
about
nx_layout_block_horizontal_test.nx -- smoke for the Phase-3
horizontal margin/padding axis added to nx_layout_block in-place.
Pairs with nx_layout_block_test (vertical-only) which still passes
because new cascade lookups default to 0 when unspecified.
Fixture (root + 1 child + 1 grandchild):
root:
padding-left: 10px
padding-right: 5px
(no margins, no width, no height)
child:
margin-left: 3px
margin-right: 7px
(no padding, no explicit width)
grandchild:
width: 50px (explicit)
padding-left: 2px
Expected geometry on viewport_w = 800:
root.x = 0 + ml(0) = 0
root.w = avail(800) (no horizontal margins)
root child_avail_w = 800 - pl(10) - pr(5) = 785
root content_origin_x = 0 + 10 = 10
child.x = content_origin_x(10) + ml(3) = 13
child.w = avail(785) - ml(3) - mr(7) = 775
child child_avail_w = 775 - pl(0) - pr(0) = 775
child content_origin_x = 13 + 0 = 13
grand.x = content_origin_x(13) + ml(0) = 13
grand.w = 50 (explicit)
grand content_origin_x = 13 + pl(2) = 15
dependencies 9 imports · 0 importers
imports: nx_syscalls.nxnx_css_tokenize.nxnx_css_parse.nxnx_css_selector_match.nxnx_css_apply.nxnx_css_number_parse.nxnx_css_dimension_to_px.nxnx_layout_box.nxnx_layout_block.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
| 47 | func _put_byte(buf: *u8, i: i64, v: i64) -> i64 called by 1: main |
| 52 | func main() -> i64 |