Loading
Generated from crates/niso-core/include/loading.h when the site was built at 7aa23e2.
This is the loading section of niso_runtime.h, owned by niso-core and kept in crates/niso-core/include/loading.h. The build composes it with the other sections in the order crates/niso-compose/sections.txt gives.
Functions: niso_dom_set_url, niso_dom_load_html, niso_dom_load_resource, niso_dom_load_script, niso_dom_collect, niso_dom_live_nodes
Sets the document’s URL, starting a new session history.
int32_t niso_dom_set_url(niso_dom* dom, const char* url, size_t len);Replaces the document’s contents with the HTML document at url, parsed from html. Stylesheets load through the loader; scripts go to the script hook.
int32_t niso_dom_load_html(niso_dom* dom, const char* html, size_t len, const char* url, size_t url_len);The loader’s bytes for url, valid until the next call into the DOM.
int32_t niso_dom_load_resource(niso_dom* dom, const char* url, size_t len, niso_bytes* out);A script’s bytes, as niso_dom_load_resource gets them but with fetch’s options (niso_fetch_options, below): the request’s client is the page, or a module worker’s creator until its script has run, and *type is the response’s type as niso_net_take numbers it, opaque for a script whose errors are muted.
typedef struct niso_fetch_options niso_fetch_options;int32_t niso_dom_load_script(niso_dom* dom, const char* url, size_t len, const niso_fetch_options* options, niso_bytes* out, uint8_t* type);void niso_dom_collect(niso_dom* dom);size_t niso_dom_live_nodes(niso_dom* dom);