mirror of
https://libwebsockets.org/repo/libwebsockets
synced 2024-12-03 13:41:36 +00:00
63d2f844db
Introduce a very lightweight html5 + css2.1+ stateful stream parser, along the same lines as the lws json and cbor ones. This is interesting primarily because of just how low-resource it is for modest css + html, it uses an lwsac to hold the entirity of the css in memory at once but the html is parsed in chunks without any need to keep previous chunks around (chunks may be as small as 1 byte). A user callback receives element entry and exit callbacks with payload and all attributes parsed out, CSS related to the active element stack is parsed to provide a list of active css attributes, which takes heap for the duration of the parsing. In effect this provides rich information about the html and css state to the callback, which has the job of producing the layout in a user-defined way. As such, there is no DOM in memory at one time, there is only a stack of active elements like <html><body><div>xxx with their associated attributes (like class). So as it is, it does not support DOM modification such as JS changing elements after parsing, although elements with interesting IDs could be kept around by the callback. There is a corresponding tiny and relatively flat heap usage regardless of html size. Default CSS is specified as recommended in the CSS 2.1 standard. Inline <style></style> elements are supported, but not pre-html5 style= in element attributes, since these are incompatible with strict CSP. What the attributes should mean on your system, eg, font-size, font-family etc is left for the user callback to decide, along with how to lay out the items using the CSS attributes, and render them. Fixed point 32.32 constants are used (fraction expressed at parts in 100M) instead of floating point. If you have presentation needs, even on a constrained display on a constrained microcontroller, this makes it feasible to use standardized markup and styling instead of roll your own. |
||
---|---|---|
.. | ||
abstract-overview.svg | ||
accept-flow-1.svg | ||
accept-flow-2.svg | ||
accept-flow-3.svg | ||
backtrace.png | ||
fault-injection.png | ||
http-proxy-overview.svg | ||
jit-trust-logo.png | ||
jit-trust-overview.png | ||
jit-trust-paths.png | ||
jit-trust-single-trust.png | ||
jit-trust-system-trust.png | ||
lhp-104-212-red.jpg | ||
lhp-400-300-red.jpg | ||
lhp-acep7.jpg | ||
lhp-epd-flex-104.jpg | ||
lhp-example-g4.jpg | ||
lhp-overview.png | ||
lhp-rgb-example.png | ||
lhp-ss-unification.png | ||
lifecycle-context.png | ||
lifecycle-server-wsi.png | ||
lifecycle-wsi.png | ||
lws_cache-1.png | ||
lws_cache-2.png | ||
lws_dll.svg | ||
lws_metrics-decimation.png | ||
lws_metrics-policy.png | ||
lws_ota.png | ||
lws_sequencer.svg | ||
lws_struct-overview.svg | ||
lws_system_states.png | ||
lws-crypto-overview.svg | ||
lws-detailed-latency-example.png | ||
lws-fts.svg | ||
lws-overview.png | ||
lws-relpol-1.svg | ||
lws-relpol-2.svg | ||
lws-relpol-3.svg | ||
lws-relpol-4.svg | ||
lws-relpol-5.svg | ||
lws-smp-example.png | ||
lws-smp-ov.png | ||
lws-sspc-1.png | ||
lws-sspc-2.png | ||
lwsac.svg | ||
lwsgt-overview.png | ||
rpi-uart-1.png | ||
rpi-uart.png | ||
smd-message.png | ||
smd-proxy.png | ||
smd-single-process.png | ||
ss-api1.png | ||
ss-api2.png | ||
ss-api3.png | ||
ss-explain.png | ||
ss-operation-modes.png | ||
ss-state-flow-server.png | ||
ss-state-flow.png | ||
threadpool-states.svg | ||
threadpool.svg | ||
work.png | ||
wss2.png |