1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
libwebsockets/cmake
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
..
FindGit.cmake add FindGit.cmake 2013-02-18 18:34:10 +08:00
FindMiniz.cmake cmake: miniz: add as option 2019-07-03 19:46:23 +01:00
FindOpenSSLbins.cmake cmake: fix FindOpenSSLbins error when no OpenSSL executable found 2022-03-25 08:18:30 +00:00
libwebsockets-config-version.cmake.in cmakelist: Augean Stables refactor 2020-05-27 08:40:12 +01:00
libwebsockets-config.cmake.in cmake: remove duplicate LwsCheckRequirements 2022-03-15 10:28:09 +00:00
lws_config.h.in lhp: Lightweight HTML Parser 2022-05-04 08:43:26 +01:00
lws_config_private.h.in plat: baremetal and rpi pico support 2021-10-08 09:48:41 +01:00
LwsCheckRequirements.cmake qnx: toolchain file and adaptations 2021-12-15 13:28:23 +00:00
pico_sdk_import.cmake plat: baremetal and rpi pico support 2021-10-08 09:48:41 +01:00
UseRPMTools.cmake rpm: do parallel compilation during rpm builds 2018-05-26 09:20:20 +08:00