1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/minimal-examples-lowlevel/api-tests
Andy Green 63d2f844db lhp: Lightweight HTML Parser
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.
2022-05-04 08:43:26 +01:00
..
api-test-async-dns cmake: bring tls include requirement out as PUBLIC 2021-10-28 08:12:48 +01:00
api-test-backtrace alloc: compressed backtrace instrumentation support 2022-03-15 10:28:09 +00:00
api-test-cose examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-dhcpc coverity fixes 2022-01-16 10:48:11 +00:00
api-test-fts examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-gencrypto examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-gunzip upng: split out gzip 2022-03-25 08:13:48 +00:00
api-test-jose examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-jpeg lws-jpeg 2022-03-25 08:13:48 +00:00
api-test-jrpc jrpc: add support 2021-10-11 09:10:15 +01:00
api-test-lecp examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-lejp examples: lgtm fixes now on by default 2021-11-29 15:18:15 +00:00
api-test-lhp lhp: Lightweight HTML Parser 2022-05-04 08:43:26 +01:00
api-test-lws_cache cmake: Enable WITH_MINIMAL_EXAMPLES by default 2021-11-11 11:52:46 +00:00
api-test-lws_dsh examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-lws_map gcc4: conceal typedef in public header 2022-03-15 10:28:09 +00:00
api-test-lws_smd examples: lgtm fixes now on by default 2021-11-29 15:18:15 +00:00
api-test-lws_struct-json examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-lws_struct_sqlite examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-lws_tokenize tokenize: enhance to support chunked parsing 2022-04-10 06:56:12 +01:00
api-test-lwsac examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-secure-streams examples: lgtm fixes now on by default 2021-11-29 15:18:15 +00:00
api-test-smtp_client examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
api-test-ssjpeg lws-jpeg 2022-03-25 08:13:48 +00:00
api-test-upng upng: rewrite for stateful stream decode 2022-03-16 12:59:48 +00:00
README.md examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00

These are buildable test apps that run in CI to confirm correct api operation.

name tests
api-test-lwsac LWS Allocated Chunks api
api-test-lws_struct-json Selftests for lws_struct JSON serialization and deserialization
api-test-lws_tokenize Generic secure string tokenizer api
api-test-fts LWS Full-text Search api
api-test-gencrypto LWS Generic Crypto apis
api-test-jose LWS JOSE apis
api-test-smtp_client SMTP client for sending emails