nx_layout_default_display.nx
buildroot/runtime/nx_layout_default_display.nx
about
nx_layout_default_display.nx -- map an HTML element tag name to
its CSS default display kind (BLOCK / INLINE / INLINE_BLOCK).
Phase 3 third primitive of NISHI_BROWSER_ROADMAP.
Per W3C HTML spec ยง 15 (default rendering / user-agent stylesheet)
and CSS Display Module Level 3, every HTML element has a default
`display` value the user-agent stylesheet sets. This primitive
returns that value for the subset of tags andelinwest.com + the
IDE require.
The eventual nx_layout_from_dom primitive (queued) walks a parsed
DOM tree and calls this to assign LayoutBox.kind. Author-supplied
CSS can override via the cascade (Phase 2's nx_css_apply, then a
Phase 3b `display` property resolver).
Subset (most common HTML5 elements):
BLOCK: html body div p h1 h2 h3 h4 h5 h6 header footer main
section article nav aside ul ol li dl dt dd table thead
tbody tfoot tr blockquote pre figure figcaption form
fieldset hr address
INLINE_BLOCK: img button input textarea select
INLINE: span a em strong b i u code small mark sub sup label
(and any tag not in the above two lists)
TEXT: handled separately by caller from text-node detection
What it does NOT handle yet (Phase 3b improvements):
- SVG / MathML namespace switches
- <table> internal display values (table / table-row / table-cell)
- <script> / <style> / <head> / <title> default-hidden treatment
(these have `display: none` semantically; caller filters)
- HTML5 custom elements (no default; caller's UA stylesheet)
- Case-insensitive tag matching for HTML quirks mode (HTML5
parser lowercases tags; until nx_html_tokenizer normalizes,
callers pre-lowercase if needed)
Per cardinal feedback-honest-perf-verdict-no-aspirational-claims:
every tag IS exhaustively listed in this header.
genealogy_id: w3c_html5_user_agent_stylesheet_default_rendering +
w3c_css_display_module_level_3
dependencies 2 imports · 26 importers
diagram shows first 10 each side; +0 more imports, +16 more importers in the complete lists below.
imports: nx_syscalls.nxnx_layout_box.nx
imported by: nx_align_gate.nxnx_browser.nxnx_browser_demo_html.nxnx_browser_demo_html_nishi.nxnx_browser_demo_styled.nxnx_browser_render.nxnx_cdata_probe.nxnx_css_boxmap_test.nxnx_flexgrow_gate.nxnx_flexgrow_probe.nxnx_float_gate.nxnx_float_test.nxnx_grid_gate.nxnx_grid_test.nxnx_grid_track_gate.nxnx_justify_gate.nxnx_layout_debug.nxnx_layout_default_display_test.nxnx_layout_from_dom.nxnx_layout_from_dom_test.nxnx_negmargin_gate.nxnx_real_page_gate.nxnx_render_html.nxnx_render_wiki_styled_window.nxnx_table_cell_gate.nxnx_wiki_boxdump.nx
structs
| none |
consts
| none |
functions
| 57 | func _disp_lc(c: i64) -> i64 |
| 69 | func _disp_eq2(src: *u8, off: i64, len: i64, |
| 79 | func _disp_eq3(src: *u8, off: i64, len: i64, |
| 91 | func _disp_eq4(src: *u8, off: i64, len: i64, |
| 105 | func _disp_eq5(src: *u8, off: i64, len: i64, |
| 121 | func _disp_eq6(src: *u8, off: i64, len: i64, |
| 139 | func _disp_eq7(src: *u8, off: i64, len: i64, |
| 161 | func _disp_eq1(src: *u8, off: i64, len: i64, m: i64) -> i64 |
| 169 | func _disp_is_h_family(src: *u8, off: i64, len: i64) -> i64 |
| 184 | func nx_layout_default_display(src: *u8, tag_off: i64, tag_len: i64) -> i64 called by 2: mainnx_layout_from_dom calls 8: _disp_eq1_disp_is_h_family_disp_eq2_disp_eq3_disp_eq4_disp_eq5+2 |