libwebsockets
Lightweight C library for HTML5 websockets
lws-html.h
Go to the documentation of this file.
1 /*
2  * libwebsockets - small server side websockets and web server implementation
3  *
4  * Copyright (C) 2010 - 2022 Andy Green <andy@warmcat.com>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22  * IN THE SOFTWARE.
23  *
24  * Extremely Lightweight HTML5 Stream Parser, same approach as lecp but for
25  * html5.
26  */
27 
28 #if !defined(LHP_MAX_ELEMS_NEST)
29 #define LHP_MAX_ELEMS_NEST 32
30 #endif
31 #if !defined(LHP_MAX_DEPTH)
32 #define LHP_MAX_DEPTH 12
33 #endif
34 #if !defined(LHP_STRING_CHUNK)
35 #define LHP_STRING_CHUNK 254
36 #endif
37 
39 
45 
48 
51 
52  LHPCB_ELEMENT_START = 4, /* reported at end of <> */
54 
56 
58 };
59 
60 /*
61  * CSS v2.1 full property set, taken from
62  *
63  * https://www.w3.org/TR/CSS21/propidx.html
64  */
65 
66 typedef enum lcsp_props {
187 
188  LCSP_PROP__COUNT /* always last */
190 
191 /*
192  * Indexes for the well-known property values
193  */
194 
195 typedef enum {
321 
322  LCSP_PROPVAL__COUNT /* always last */
324 
325 struct lhp_ctx;
326 typedef lws_stateful_ret_t (*lhp_callback)(struct lhp_ctx *ctx, char reason);
327 
328 /* html attribute */
329 
330 typedef struct lhp_atr {
332  size_t name_len; /* 0 if it is elem tag */
333  size_t value_len;
334 
335  /* name+NUL then value+NUL follow */
337 
338 /*
339  * In order to lay out the table, we have to incrementally adjust all foregoing
340  * DLOs as newer cells change the situation. So we have to keep track of all
341  * cell DLOs in a stack of tables until it's all done.
342  */
343 
344 typedef struct {
345  lws_dll2_t list; /* ps->table_cols */
346 
347  lws_dll2_owner_t row_dlos; /* lws_dlo_t in column */
348 
349  lws_fx_t height; /* currently computed row height */
351 
352 typedef struct {
353  lws_dll2_t list; /* ps->table_cols */
354 
355  lws_dll2_owner_t col_dlos; /* lws_dlo_t in column */
356 
357  lws_fx_t width; /* currently computed column width */
359 
360 struct lcsp_atr;
361 
362 #define CCPAS_TOP 0
363 #define CCPAS_RIGHT 1
364 #define CCPAS_BOTTOM 2
365 #define CCPAS_LEFT 3
366 
367 typedef struct lhp_pstack {
369  void *user; /* private to the stack level */
371 
372  /* static: x,y: offset from parent, w,h: surface size of this object */
374 
375  /* dynamic cursor inside drt for progressive child placement */
380 
383 
384  lws_dll2_owner_t atr; /* lhp_atr_t */
385 
387 
389  const struct lcsp_atr *css_color;
390 
391  const struct lcsp_atr *css_position;
392  const struct lcsp_atr *css_display;
393  const struct lcsp_atr *css_width;
394  const struct lcsp_atr *css_height;
395 
396  const struct lcsp_atr *css_border_radius[4];
397 
398  const struct lcsp_atr *css_pos[4];
399  const struct lcsp_atr *css_margin[4];
400  const struct lcsp_atr *css_padding[4];
401 
402  uint16_t tr_idx; /* in table */
403  uint16_t td_idx; /* in current tr */
404 
405  uint8_t is_block:1; /* children use space in our drt */
407 
408  /* user layout owns these after initial values set */
409 
412  int oi[4];
413  int positioned[4];
415  uint8_t runon; /* continues same line */
416 
418 
419 typedef enum lcsp_css_units {
421 
422  LCSP_UNIT_NUM, /* u.i */
423 
433 
436 
437  LCSP_UNIT_FREQ_HZ, /* u.i */
438 
439  LCSP_UNIT_RGBA, /* u.rgba */
440 
441  LCSP_UNIT_URL, /* string at end of atr */
442  LCSP_UNIT_STRING, /* string at end of atr */
443  LCSP_UNIT_DATA, /* binary data at end of atr */
444 
446 
447 typedef struct lcsp_atr {
449 
450  int propval; /* lcsp_propvals_t LCSP_PROPVAL_ */
451 
452  size_t value_len; /* for string . url */
454 
455  union {
456  lws_fx_t i;
457  uint32_t rgba; /* for colours */
458  } u;
459 
461 
463 
464  /* .value_len bytes follow (for strings and blobs) */
466 
467 /* css definitions like font-weight: */
468 typedef struct lcsp_defs {
470  lws_dll2_owner_t atrs; /* lcsp_atr_t */
471  lcsp_props_t prop; /* lcsp_props_t, LCSP_PROP_* */
473 
474 typedef struct lcsp_names {
476  size_t name_len;
477 
478  /* name + NUL follow */
480 
481 typedef struct lcsp_stanza { /* css stanza, with names and defs */
483 
484  lws_dll2_owner_t names; /* lcsp_names_t */
485  lws_dll2_owner_t defs; /* lcsp_defs_t */
486 
488 
489 /*
490  * A list of stanza references can easily have to bring in the same stanza
491  * multiple times, eg, <div><span class=x><div> won't work unless the div
492  * stanzas are listed twice at different places in the list. It means we can't
493  * use dll2 directly since the number of references is open-ended.
494  *
495  * lcsp_stanza_ptr provides indirection that allows multiple listings.
496  */
497 
498 typedef struct lcsp_stanza_ptr {
500 
503 
504 typedef struct lcsp_atr_ptr {
506 
509 
510 #define LHP_FLAG_DOCUMENT_END (1 << 0)
511 
512 typedef struct lhp_ctx {
513  lws_dll2_owner_t stack; /* lhp_pstack_t */
514 
515  struct lwsac *cssac; /* css allocations all in an ac */
516  struct lwsac *cascadeac; /* active_stanzas ac */
517  struct lwsac *propatrac; /* prop atr query results ac */
518  lws_dll2_owner_t css; /* lcsp_stanza_t (all in ac) */
519 
521 
524  lcsp_stanza_t *stz; /* current stanza getting properties */
525  lcsp_defs_t *def; /* current property getting values */
526 
527  lws_dll2_owner_t active_stanzas; /* lcsp_stanza_ptr_t allocated
528  * in cascadeac */
529  lws_dll2_owner_t active_atr; /* lcsp_atr_ptr_t allocated in
530  * propatrac */
531 
533 
534  const char *base_url; /* strdup of https://x.com/y.html */
535  sul_cb_t ssevcb; /* callback for ss events */
536  lws_sorted_usec_list_t *ssevsul; /* sul to use to resume rz */
537  sul_cb_t sshtmlevcb; /* callback for more html parse */
538  lws_sorted_usec_list_t *sshtmlevsul; /* sul for more html parse */
539 
540  void *user;
541  void *user1;
542  const char *tag; /* private */
543  size_t tag_len; /* private */
544 
545  int npos;
546  int state; /* private */
547  int state_css_comm; /* private */
548  int nl_temp;
550 
553  int32_t window; /* 0, or ss item flow control limit */
554 
555  union {
556  uint32_t s;
557  struct {
558  uint32_t first:1;
559  uint32_t closing:1;
560  uint32_t void_element:1;
561  uint32_t doctype:1;
562  uint32_t inq:1;
563  uint32_t tag_used:1;
564  uint32_t arg:1;
565  uint32_t default_css:1;
566 #define LHP_CSS_PROPVAL_INT_WHOLE 1
567 #define LHP_CSS_PROPVAL_INT_FRAC 2
568 #define LHP_CSS_PROPVAL_INT_UNIT 3
569  uint32_t integer:2;
570  uint32_t color:2;
571  } f;
572  } u;
573 
574  int prop; /* lcsp_props_t */
575  int propval; /* lcsp_propvals_t */
576  int16_t css_state; /* private */
577  int16_t cssval_state; /* private */
578 
583 
584  /* at end so we can memset members above it in one go */
585 
587 
589 
590 /*
591  * lws_lhp_construct() - Construct an lhp context
592  *
593  * \param ctx: the lhp context to prepare
594  * \param cb: the stream parsing callback
595  * \param user: opaque user pointer available from the lhp context
596  * \param ic: struct with arguments for lhp context
597  *
598  * The lhp context is allocated by the caller (the size is known).
599  * Prepares an lhp context to parse html. Returns 0 for OK, or nonzero if OOM.
600  */
603  const lws_surface_info_t *ic);
604 
605 /*
606  * lws_lhp_destruct() - Destroy an lhp context
607  *
608  * \param ctx: the lhp context to prepare
609  *
610  * Destroys an lhp context. The lhp context is allocated by the caller (the
611  * size is known). But there are suballocations that must be destroyed with
612  * this.
613  */
616 
637 lws_lhp_ss_browse(struct lws_context *cx, lws_display_render_state_t *rs,
638  const char *url, sul_cb_t render);
639 
657 lws_lhp_parse(lhp_ctx_t *ctx, const uint8_t **buf, size_t *len);
658 
673 
692 lws_http_rel_to_url(char *dest, size_t len, const char *base, const char *rel);
693 
696 
697 LWS_VISIBLE LWS_EXTERN const char *
699 
700 LWS_VISIBLE LWS_EXTERN const char *
701 lws_html_get_atr(lhp_pstack_t *ps, const char *aname, size_t aname_len);
702 
705 
708 
709 void
711 
712 #define LWS_LHPREF_WIDTH 0
713 #define LWS_LHPREF_HEIGHT 1
714 #define LWS_LHPREF_NONE 2
715 
unsigned short uint16_t
unsigned int uint32_t
#define LWS_EXTERN
unsigned char uint8_t
lws_stateful_ret_t
#define LWS_VISIBLE
LWS_VISIBLE LWS_EXTERN int lws_lhp_ss_browse(struct lws_context *cx, lws_display_render_state_t *rs, const char *url, sul_cb_t render)
lws_dll2_owner_t atr
Definition: lws-html.h:384
int16_t css_state
Definition: lws-html.h:576
lcsp_css_units
Definition: lws-html.h:419
@ LCSP_UNIT_LENGTH_MM
Definition: lws-html.h:428
@ LCSP_UNIT_LENGTH_PC
Definition: lws-html.h:430
@ LCSP_UNIT_LENGTH_CM
Definition: lws-html.h:427
@ LCSP_UNIT_DATA
Definition: lws-html.h:443
@ LCSP_UNIT_LENGTH_EX
Definition: lws-html.h:425
@ LCSP_UNIT_RGBA
Definition: lws-html.h:439
@ LCSP_UNIT_STRING
Definition: lws-html.h:442
@ LCSP_UNIT_LENGTH_PX
Definition: lws-html.h:431
@ LCSP_UNIT_NONE
Definition: lws-html.h:420
@ LCSP_UNIT_FREQ_HZ
Definition: lws-html.h:437
@ LCSP_UNIT_NUM
Definition: lws-html.h:422
@ LCSP_UNIT_LENGTH_PERCENT
Definition: lws-html.h:432
@ LCSP_UNIT_URL
Definition: lws-html.h:441
@ LCSP_UNIT_ANGLE_ABS_DEG
Definition: lws-html.h:434
@ LCSP_UNIT_ANGLE_REL_DEG
Definition: lws-html.h:435
@ LCSP_UNIT_LENGTH_EM
Definition: lws-html.h:424
@ LCSP_UNIT_LENGTH_PT
Definition: lws-html.h:429
@ LCSP_UNIT_LENGTH_IN
Definition: lws-html.h:426
size_t name_len
Definition: lws-html.h:476
struct lhp_ctx lhp_ctx_t
sul_cb_t ssevcb
Definition: lws-html.h:535
lcsp_stanza_t * stz
Definition: lws-html.h:501
const struct lcsp_atr * css_display
Definition: lws-html.h:392
lws_fx_t curx
Definition: lws-html.h:376
LWS_VISIBLE LWS_EXTERN int lws_http_rel_to_url(char *dest, size_t len, const char *base, const char *rel)
uint16_t td_idx
Definition: lws-html.h:403
const struct lcsp_atr * css_margin[4]
Definition: lws-html.h:399
uint8_t await_css_done
Definition: lws-html.h:582
uint8_t is_table
Definition: lws-html.h:406
lws_dll2_t list
Definition: lws-html.h:345
lws_dlo_t * dlo_set_curx
Definition: lws-html.h:381
uint8_t is_css
Definition: lws-html.h:581
size_t name_len
Definition: lws-html.h:332
struct lcsp_atr lcsp_atr_t
uint8_t finish_css
Definition: lws-html.h:580
lws_dll2_t list
Definition: lws-html.h:368
lws_dll2_t list
Definition: lws-html.h:482
union lcsp_atr::@12 u
lws_fx_t height
Definition: lws-html.h:349
void * user1
Definition: lws-html.h:541
int prop
Definition: lws-html.h:574
LWS_VISIBLE LWS_EXTERN const char * lws_css_pstack_name(lhp_pstack_t *ps)
LWS_VISIBLE LWS_EXTERN int lhp_prop_axis(const lcsp_atr_t *a)
struct lwsac * cssac
Definition: lws-html.h:515
lcsp_props_t prop
Definition: lws-html.h:471
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_csp_px(const lcsp_atr_t *a, lhp_pstack_t *ps)
LWS_VISIBLE LWS_EXTERN int lws_lhp_construct(lhp_ctx_t *ctx, lhp_callback cb, void *user, const lws_surface_info_t *ic)
lcsp_css_units_t unit
Definition: lws-html.h:453
lws_dll2_t list
Definition: lws-html.h:331
const struct lcsp_atr * css_width
Definition: lws-html.h:393
lws_dll2_owner_t active_stanzas
Definition: lws-html.h:527
size_t tag_len
Definition: lws-html.h:543
lws_dll2_owner_t * ids
Definition: lws-html.h:520
union lhp_ctx::@13 u
lws_sorted_usec_list_t * sshtmlevsul
Definition: lws-html.h:538
lws_dll2_owner_t row_dlos
Definition: lws-html.h:347
lcsp_propvals_t
Definition: lws-html.h:195
@ LCSP_PROPVAL_LTR
Definition: lws-html.h:253
@ LCSP_PROPVAL_BLINK
Definition: lws-html.h:206
@ LCSP_PROPVAL_REPEAT_Y
Definition: lws-html.h:281
@ LCSP_PROPVAL_LEFT
Definition: lws-html.h:242
@ LCSP_PROPVAL_LINE_THROUGH
Definition: lws-html.h:244
@ LCSP_PROPVAL_TOP
Definition: lws-html.h:311
@ LCSP_PROPVAL_SMALL_CAPTION
Definition: lws-html.h:290
@ LCSP_PROPVAL_RIGHT
Definition: lws-html.h:282
@ LCSP_PROPVAL_CODE
Definition: lws-html.h:217
@ LCSP_PROPVAL_FIXED
Definition: lws-html.h:227
@ LCSP_PROPVAL_SCROLL
Definition: lws-html.h:284
@ LCSP_PROPVAL_COLLAPSE
Definition: lws-html.h:218
@ LCSP_PROPVAL_SHOW
Definition: lws-html.h:287
@ LCSP_PROPVAL_LOWER
Definition: lws-html.h:247
@ LCSP_PROPVAL_DECIMAL_LEADING_ZERO
Definition: lws-html.h:221
@ LCSP_PROPVAL_OPEN_QUOTE
Definition: lws-html.h:270
@ LCSP_PROPVAL_TABLE_COLUMN_GROUP
Definition: lws-html.h:303
@ LCSP_PROPVAL_HIGH
Definition: lws-html.h:232
@ LCSP_PROPVAL_PRE
Definition: lws-html.h:274
@ LCSP_PROPVAL_ALWAYS
Definition: lws-html.h:198
@ LCSP_PROPVAL_BLOCK
Definition: lws-html.h:207
@ LCSP_PROPVAL_HIDE
Definition: lws-html.h:231
@ LCSP_PROPVAL_INVERT
Definition: lws-html.h:239
@ LCSP_PROPVAL_HELP
Definition: lws-html.h:229
@ LCSP_PROPVAL_UPPER_ROMAN
Definition: lws-html.h:317
@ LCSP_PROPVAL_TEXT
Definition: lws-html.h:310
@ LCSP_PROPVAL_ABSOLUTE
Definition: lws-html.h:197
@ LCSP_PROPVAL_HIGHER
Definition: lws-html.h:233
@ LCSP_PROPVAL_TABLE_CELL
Definition: lws-html.h:301
@ LCSP_PROPVAL_INLINE_TABLE
Definition: lws-html.h:238
@ LCSP_PROPVAL_PRE_LINE
Definition: lws-html.h:275
@ LCSP_PROPVAL_TABLE_CAPTION
Definition: lws-html.h:300
@ LCSP_PROPVAL_MOVE
Definition: lws-html.h:258
@ LCSP_PROPVAL_DIGITS
Definition: lws-html.h:223
@ LCSP_PROPVAL_NOWRAP
Definition: lws-html.h:265
@ LCSP_PROPVAL_TABLE_FOOTER_GROUP
Definition: lws-html.h:304
@ LCSP_PROPVAL_MENU
Definition: lws-html.h:254
@ LCSP_PROPVAL_N_RESIZE
Definition: lws-html.h:266
@ LCSP_PROPVAL_NO_CLOSE_QUOTE
Definition: lws-html.h:260
@ LCSP_PROPVAL_CENTER
Definition: lws-html.h:214
@ LCSP_PROPVAL_LIGHTER
Definition: lws-html.h:243
@ LCSP_PROPVAL_BOTTOM
Definition: lws-html.h:211
@ LCSP_PROPVAL_EMBED
Definition: lws-html.h:225
@ LCSP_PROPVAL_CAPTION
Definition: lws-html.h:213
@ LCSP_PROPVAL_WAIT
Definition: lws-html.h:319
@ LCSP_PROPVAL_ARMENIAN
Definition: lws-html.h:199
@ LCSP_PROPVAL_TRANSPARENT
Definition: lws-html.h:312
@ LCSP_PROPVAL_INHERIT
Definition: lws-html.h:235
@ LCSP_PROPVAL_BELOW
Definition: lws-html.h:204
@ LCSP_PROPVAL_NW_RESIZE
Definition: lws-html.h:267
@ LCSP_PROPVAL_TABLE_ROW_GROUP
Definition: lws-html.h:307
@ LCSP_PROPVAL_RELATIVE
Definition: lws-html.h:278
@ LCSP_PROPVAL_SMALL_CAPS
Definition: lws-html.h:289
@ LCSP_PROPVAL_UPPER_ALPHA
Definition: lws-html.h:314
@ LCSP_PROPVAL_DECIMAL
Definition: lws-html.h:222
@ LCSP_PROPVAL_PRE_WRAP
Definition: lws-html.h:276
@ LCSP_PROPVAL_LOWER_ROMAN
Definition: lws-html.h:252
@ LCSP_PROPVAL_NE_RESIZE
Definition: lws-html.h:259
@ LCSP_PROPVAL_TABLE_HEADER_GROUP
Definition: lws-html.h:305
@ LCSP_PROPVAL_SUB
Definition: lws-html.h:296
@ LCSP_PROPVAL_SUPER
Definition: lws-html.h:297
@ LCSP_PROPVAL_CIRCLE
Definition: lws-html.h:215
@ LCSP_PROPVAL_LOWER_GREEK
Definition: lws-html.h:250
@ LCSP_PROPVAL__COUNT
Definition: lws-html.h:322
@ LCSP_PROPVAL_CAPITALIZE
Definition: lws-html.h:212
@ LCSP_PROPVAL_CONTINUOUS
Definition: lws-html.h:219
@ LCSP_PROPVAL_OBLIQUE
Definition: lws-html.h:268
@ LCSP_PROPVAL_NO_REPEAT
Definition: lws-html.h:263
@ LCSP_PROPVAL_BOTH
Definition: lws-html.h:210
@ LCSP_PROPVAL_INLINE_BLOCK
Definition: lws-html.h:237
@ LCSP_PROPVAL_MIDDLE
Definition: lws-html.h:256
@ LCSP_PROPVAL_TEXT_BOTTOM
Definition: lws-html.h:308
@ LCSP_PROPVAL_REPEAT_X
Definition: lws-html.h:280
@ LCSP_PROPVAL_SW_RESIZE
Definition: lws-html.h:298
@ LCSP_PROPVAL_UNDERLINE
Definition: lws-html.h:313
@ LCSP_PROPVAL_TABLE_ROW
Definition: lws-html.h:306
@ LCSP_PROPVAL_GEORGIAN
Definition: lws-html.h:228
@ LCSP_PROPVAL_OUTSIDE
Definition: lws-html.h:271
@ LCSP_PROPVAL_LOWER_LATIN
Definition: lws-html.h:251
@ LCSP_PROPVAL_HIDDEN
Definition: lws-html.h:230
@ LCSP_PROPVAL_BASELINE
Definition: lws-html.h:202
@ LCSP_PROPVAL_LOW
Definition: lws-html.h:246
@ LCSP_PROPVAL_BEHIND
Definition: lws-html.h:203
@ LCSP_PROPVAL_OVERLINE
Definition: lws-html.h:272
@ LCSP_PROPVAL_UPPER_LATIN
Definition: lws-html.h:316
@ LCSP_PROPVAL_POINTER
Definition: lws-html.h:273
@ LCSP_PROPVAL_SPELL_OUT
Definition: lws-html.h:291
@ LCSP_PROPVAL_NONE
Definition: lws-html.h:261
@ LCSP_PROPVAL_LOWER_ALPHA
Definition: lws-html.h:248
@ LCSP_PROPVAL_STATIC
Definition: lws-html.h:294
@ LCSP_PROPVAL_LOWERCASE
Definition: lws-html.h:249
@ LCSP_PROPVAL_UPPERCASE
Definition: lws-html.h:315
@ LCSP_PROPVAL_PROGRESS
Definition: lws-html.h:277
@ LCSP_PROPVAL_JUSTIFY
Definition: lws-html.h:241
@ LCSP_PROPVAL_TABLE
Definition: lws-html.h:299
@ LCSP_PROPVAL_W_RESIZE
Definition: lws-html.h:320
@ LCSP_PROPVAL_STATUS_BAR
Definition: lws-html.h:295
@ LCSP_PROPVAL_NO_OPEN_QUOTE
Definition: lws-html.h:262
@ LCSP_PROPVAL_DISC
Definition: lws-html.h:224
@ LCSP_PROPVAL_ITALIC
Definition: lws-html.h:240
@ LCSP_PROPVAL_INLINE
Definition: lws-html.h:236
@ LCSP_PROPVAL_VISIBLE
Definition: lws-html.h:318
@ LCSP_PROPVAL_SE_RESIZE
Definition: lws-html.h:286
@ LCSP_PROPVAL_ONCE
Definition: lws-html.h:269
@ LCSP_PROPVAL_RTL
Definition: lws-html.h:283
@ LCSP_PROPVAL_REPEAT
Definition: lws-html.h:279
@ LCSP_PROPVAL_SEPARATE
Definition: lws-html.h:285
@ LCSP_PROPVAL_TABLE_COLUMN
Definition: lws-html.h:302
@ LCSP_PROPVAL_S_RESIZE
Definition: lws-html.h:293
@ LCSP_PROPVAL_MIX
Definition: lws-html.h:257
@ LCSP_PROPVAL_BIDI_OVERRIDE
Definition: lws-html.h:205
@ LCSP_PROPVAL_SILENT
Definition: lws-html.h:288
@ LCSP_PROPVAL_MESSAGE_BOX
Definition: lws-html.h:255
@ LCSP_PROPVAL_AUTO
Definition: lws-html.h:200
@ LCSP_PROPVAL_LIST_ITEM
Definition: lws-html.h:245
@ LCSP_PROPVAL_TEXT_TOP
Definition: lws-html.h:309
@ LCSP_PROPVAL_ABOVE
Definition: lws-html.h:196
@ LCSP_PROPVAL_E_RESIZE
Definition: lws-html.h:226
@ LCSP_PROPVAL_BOLD
Definition: lws-html.h:208
@ LCSP_PROPVAL_CROSSHAIR
Definition: lws-html.h:220
@ LCSP_PROPVAL_AVOID
Definition: lws-html.h:201
@ LCSP_PROPVAL_CLOSE_QUOTE
Definition: lws-html.h:216
@ LCSP_PROPVAL_NORMAL
Definition: lws-html.h:264
@ LCSP_PROPVAL_SQUARE
Definition: lws-html.h:292
@ LCSP_PROPVAL_ICON
Definition: lws-html.h:234
@ LCSP_PROPVAL_BOLDER
Definition: lws-html.h:209
lws_fx_t width
Definition: lws-html.h:357
struct lwsac * cascadeac
Definition: lws-html.h:516
lws_dll2_t list
Definition: lws-html.h:475
int state
Definition: lws-html.h:546
int32_t window
Definition: lws-html.h:553
#define LHP_STRING_CHUNK
Definition: lws-html.h:35
lws_fx_t tf
Definition: lws-html.h:522
int rel_layout_cursor[4]
Definition: lws-html.h:414
lws_dlo_t * dlo_set_cury
Definition: lws-html.h:382
int propval
Definition: lws-html.h:450
LWS_VISIBLE LWS_EXTERN const char * lws_html_get_atr(lhp_pstack_t *ps, const char *aname, size_t aname_len)
lws_dll2_owner_t stack
Definition: lws-html.h:513
LWS_VISIBLE LWS_EXTERN lhp_pstack_t * lws_css_get_parent_block(lhp_ctx_t *ctx, lhp_pstack_t *ps)
struct lhp_atr lhp_atr_t
LWS_VISIBLE LWS_EXTERN const lcsp_atr_t * lws_css_cascade_get_prop_atr(lhp_ctx_t *ctx, lcsp_props_t prop)
sul_cb_t sshtmlevcb
Definition: lws-html.h:537
int nl_temp
Definition: lws-html.h:548
void * user
Definition: lws-html.h:369
lws_surface_info_t ic
Definition: lws-html.h:532
const char * tag
Definition: lws-html.h:542
lws_sorted_usec_list_t * ssevsul
Definition: lws-html.h:536
int16_t cssval_state
Definition: lws-html.h:577
uint8_t is_block
Definition: lws-html.h:405
const struct lcsp_atr * css_padding[4]
Definition: lws-html.h:400
uint32_t temp
Definition: lws-html.h:552
lws_fx_t r
Definition: lws-html.h:460
uint16_t tr_idx
Definition: lws-html.h:402
lws_stateful_ret_t(* lhp_callback)(struct lhp_ctx *ctx, char reason)
Definition: lws-html.h:326
uint8_t op
Definition: lws-html.h:462
lws_dll2_t list
Definition: lws-html.h:469
struct lwsac * propatrac
Definition: lws-html.h:517
uint8_t in_body
Definition: lws-html.h:579
const lws_display_font_t * font
Definition: lws-html.h:411
struct lcsp_stanza lcsp_stanza_t
int temp_count
Definition: lws-html.h:549
lcsp_props
Definition: lws-html.h:66
@ LCSP_PROP_OVERFLOW
Definition: lws-html.h:146
@ LCSP_PROP_POSITION
Definition: lws-html.h:161
@ LCSP_PROP_Z_INDEX
Definition: lws-html.h:186
@ LCSP_PROP_TEXT_ALIGN
Definition: lws-html.h:172
@ LCSP_PROP_LETTER_SPACING
Definition: lws-html.h:126
@ LCSP_PROP_HEIGHT
Definition: lws-html.h:124
@ LCSP_PROP_BACKGROUND_REPEAT
Definition: lws-html.h:72
@ LCSP_PROP_MARGIN_BOTTOM
Definition: lws-html.h:135
@ LCSP_PROP_TOP
Definition: lws-html.h:176
@ LCSP_PROP_BACKGROUND_IMAGE
Definition: lws-html.h:70
@ LCSP_PROP_BACKGROUND_POSITION
Definition: lws-html.h:71
@ LCSP_PROP_BORDER_RIGHT_WIDTH
Definition: lws-html.h:91
@ LCSP_PROP_FONT_WEIGHT
Definition: lws-html.h:122
@ LCSP_PROP_FONT_VARAIANT
Definition: lws-html.h:121
@ LCSP_PROP_PAUSE
Definition: lws-html.h:157
@ LCSP_PROP_BORDER_TOP_STYLE
Definition: lws-html.h:86
@ LCSP_PROP_EMPTY_CELLS
Definition: lws-html.h:116
@ LCSP_PROP_BORDER_RIGHT
Definition: lws-html.h:79
@ LCSP_PROP_SPEAK_HEADER
Definition: lws-html.h:165
@ LCSP_PROP_BORDER_COLLAPSE
Definition: lws-html.h:74
@ LCSP_PROP_BACKGROUND_COLOR
Definition: lws-html.h:69
@ LCSP_PROP_WHITE_SPACE
Definition: lws-html.h:182
@ LCSP_PROP_SPEAK
Definition: lws-html.h:168
@ LCSP_PROP_BACKGROUND_ATTACHMENT
Definition: lws-html.h:68
@ LCSP_PROP_VERTICAL_ALIGN
Definition: lws-html.h:178
@ LCSP_PROP_SPEAK_NUMERAL
Definition: lws-html.h:166
@ LCSP_PROP_LIST_STYLE_POSITION
Definition: lws-html.h:129
@ LCSP_PROP_MARGIN_TOP
Definition: lws-html.h:134
@ LCSP_PROP_BORDER_RIGHT_STYLE
Definition: lws-html.h:87
@ LCSP_PROP_MIN_WIDTH
Definition: lws-html.h:140
@ LCSP_PROP_BORDER_BOTTOM_LEFT_RADIUS
Definition: lws-html.h:97
@ LCSP_PROP_BORDER_SPACING
Definition: lws-html.h:76
@ LCSP_PROP_TEXT_DECORATION
Definition: lws-html.h:173
@ LCSP_PROP_VISIBILITY
Definition: lws-html.h:179
@ LCSP_PROP_PADDING_BOTTOM
Definition: lws-html.h:149
@ LCSP_PROP_CURSOR
Definition: lws-html.h:112
@ LCSP_PROP_DISPLAY
Definition: lws-html.h:114
@ LCSP_PROP_COLOR
Definition: lws-html.h:105
@ LCSP_PROP_UNICODE_BIDI
Definition: lws-html.h:177
@ LCSP_PROP_MAX_HEIGHT
Definition: lws-html.h:137
@ LCSP_PROP_BORDER_COLOR
Definition: lws-html.h:75
@ LCSP_PROP_COUNTER_INCREMENT
Definition: lws-html.h:107
@ LCSP_PROP_CONTENT
Definition: lws-html.h:106
@ LCSP_PROP_OUTLINE_COLOR
Definition: lws-html.h:142
@ LCSP_PROP_BOTTOM
Definition: lws-html.h:101
@ LCSP_PROP_SPEAK_PUNCTUATION
Definition: lws-html.h:167
@ LCSP_PROP_BORDER_TOP_COLOR
Definition: lws-html.h:82
@ LCSP_PROP_PADDING_TOP
Definition: lws-html.h:147
@ LCSP_PROP_BORDER_WIDTH
Definition: lws-html.h:94
@ LCSP_PROP_BORDER_TOP_LEFT_RADIUS
Definition: lws-html.h:95
@ LCSP_PROP_BORDER_BOTTOM_WIDTH
Definition: lws-html.h:92
@ LCSP_PROP_VOLUME
Definition: lws-html.h:181
@ LCSP_PROP_CUE_AFTER
Definition: lws-html.h:109
@ LCSP_PROP_BORDER_LEFT_STYLE
Definition: lws-html.h:89
@ LCSP_PROP_BORDER_STYLE
Definition: lws-html.h:77
@ LCSP_PROP_BORDER_LEFT_COLOR
Definition: lws-html.h:85
@ LCSP_PROP_BORDER_RADIUS
Definition: lws-html.h:99
@ LCSP_PROP_TEXT_INDENT
Definition: lws-html.h:174
@ LCSP_PROP_OUTLINE_STYLE
Definition: lws-html.h:143
@ LCSP_PROP_FONT
Definition: lws-html.h:123
@ LCSP_PROP_PADDING
Definition: lws-html.h:151
@ LCSP_PROP_PAUSE_AFTER
Definition: lws-html.h:155
@ LCSP_PROP_FONT_FAMILY
Definition: lws-html.h:118
@ LCSP_PROP_TEXT_TRANSFORM
Definition: lws-html.h:175
@ LCSP_PROP_PLAY_DURING
Definition: lws-html.h:160
@ LCSP_PROP_MAX_WIDTH
Definition: lws-html.h:138
@ LCSP_PROP_QUOTES
Definition: lws-html.h:162
@ LCSP_PROP_BORDER_LEFT_WIDTH
Definition: lws-html.h:93
@ LCSP_PROP_FONT_STYLE
Definition: lws-html.h:120
@ LCSP_PROP_LIST_STYLE
Definition: lws-html.h:131
@ LCSP_PROP_OUTLINE_WIDTH
Definition: lws-html.h:144
@ LCSP_PROP_PITCH
Definition: lws-html.h:159
@ LCSP_PROP_CUE
Definition: lws-html.h:111
@ LCSP_PROP_MARGIN_RIGHT
Definition: lws-html.h:132
@ LCSP_PROP_MARGIN_LEFT
Definition: lws-html.h:133
@ LCSP_PROP_BORDER_BOTTOM
Definition: lws-html.h:80
@ LCSP_PROP_WIDOWS
Definition: lws-html.h:183
@ LCSP_PROP_PAGE_BREAK_BEFORE
Definition: lws-html.h:153
@ LCSP_PROP_RIGHT
Definition: lws-html.h:164
@ LCSP_PROP_BORDER_BOTTOM_COLOR
Definition: lws-html.h:84
@ LCSP_PROP_PAGE_BREAK_INSIDE
Definition: lws-html.h:154
@ LCSP_PROP_MARGIN
Definition: lws-html.h:136
@ LCSP_PROP_BORDER_RIGHT_COLOR
Definition: lws-html.h:83
@ LCSP_PROP_DIRECTION
Definition: lws-html.h:113
@ LCSP_PROP_CUE_BEFORE
Definition: lws-html.h:110
@ LCSP_PROP_CLIP
Definition: lws-html.h:104
@ LCSP_PROP_FONT_SIZE
Definition: lws-html.h:119
@ LCSP_PROP_ELEVATION
Definition: lws-html.h:115
@ LCSP_PROP_WIDTH
Definition: lws-html.h:184
@ LCSP_PROP_CAPTION_SIDE
Definition: lws-html.h:102
@ LCSP_PROP_BORDER_TOP_WIDTH
Definition: lws-html.h:90
@ LCSP_PROP_LEFT
Definition: lws-html.h:125
@ LCSP_PROP_LINE_HEIGHT
Definition: lws-html.h:127
@ LCSP_PROP_STRESS
Definition: lws-html.h:170
@ LCSP_PROP_PADDING_LEFT
Definition: lws-html.h:150
@ LCSP_PROP_CLEAR
Definition: lws-html.h:103
@ LCSP_PROP_PADDING_RIGHT
Definition: lws-html.h:148
@ LCSP_PROP_PITCH_RANGE
Definition: lws-html.h:158
@ LCSP_PROP_WORD_SPACING
Definition: lws-html.h:185
@ LCSP_PROP_FLOAT
Definition: lws-html.h:117
@ LCSP_PROP__COUNT
Definition: lws-html.h:188
@ LCSP_PROP_BORDER
Definition: lws-html.h:100
@ LCSP_PROP_ORPHANS
Definition: lws-html.h:141
@ LCSP_PROP_AZIMUTH
Definition: lws-html.h:67
@ LCSP_PROP_BORDER_LEFT
Definition: lws-html.h:81
@ LCSP_PROP_COUNTER_RESET
Definition: lws-html.h:108
@ LCSP_PROP_MIN_HEIGHT
Definition: lws-html.h:139
@ LCSP_PROP_LIST_STYLE_TYPE
Definition: lws-html.h:130
@ LCSP_PROP_SPEECH_RATE
Definition: lws-html.h:169
@ LCSP_PROP_RICHNESS
Definition: lws-html.h:163
@ LCSP_PROP_BORDER_BOTTOM_STYLE
Definition: lws-html.h:88
@ LCSP_PROP_PAUSE_BEFORE
Definition: lws-html.h:156
@ LCSP_PROP_OUTLINE
Definition: lws-html.h:145
@ LCSP_PROP_TABLE_LAYOUT
Definition: lws-html.h:171
@ LCSP_PROP_BACKGROUND
Definition: lws-html.h:73
@ LCSP_PROP_BORDER_TOP_RIGHT_RADIUS
Definition: lws-html.h:96
@ LCSP_PROP_PAGE_BREAK_AFTER
Definition: lws-html.h:152
@ LCSP_PROP_BORDER_BOTTOM_RIGHT_RADIUS
Definition: lws-html.h:98
@ LCSP_PROP_BORDER_TOP
Definition: lws-html.h:78
@ LCSP_PROP_LIST_STYLE_IMAGE
Definition: lws-html.h:128
@ LCSP_PROP_VOICE_FAMILY
Definition: lws-html.h:180
lws_dll2_t list
Definition: lws-html.h:353
int positioned[4]
Definition: lws-html.h:413
LWS_VISIBLE LWS_EXTERN void lws_lhp_tag_dlo_id(lhp_ctx_t *ctx, lhp_pstack_t *ps, lws_dlo_t *dlo)
struct lhp_pstack lhp_pstack_t
const struct lcsp_atr * css_position
Definition: lws-html.h:391
lcsp_defs_t * def
Definition: lws-html.h:525
lws_dll2_owner_t names
Definition: lws-html.h:484
lws_dlo_t * dlo
Definition: lws-html.h:410
lhp_callbacks
Definition: lws-html.h:38
@ LHPCB_COMPLETE
Definition: lws-html.h:49
@ LHPCB_ERR_ELEM_DEPTH
Definition: lws-html.h:43
@ LHPCB_ELEMENT_START
Definition: lws-html.h:52
@ LHPCB_ERR_ATTRIB_SYNTAX
Definition: lws-html.h:40
@ LHPCB_ERR_OOM
Definition: lws-html.h:42
@ LHPCB_CONTENT
Definition: lws-html.h:55
@ LHPCB_DESTRUCTED
Definition: lws-html.h:47
@ LHPCB_COMMENT
Definition: lws-html.h:57
@ LHPCB_CONSTRUCTED
Definition: lws-html.h:46
@ LHPCB_FAILED
Definition: lws-html.h:50
@ LHPCB_ELEMENT_END
Definition: lws-html.h:53
@ LHPCB_ERR_ATTRIB_LEN
Definition: lws-html.h:41
@ LHPCB_CONTINUE
Definition: lws-html.h:44
lws_dll2_owner_t css
Definition: lws-html.h:518
size_t value_len
Definition: lws-html.h:452
lws_dll2_owner_t col_dlos
Definition: lws-html.h:355
lws_fx_t widest
Definition: lws-html.h:378
int state_css_comm
Definition: lws-html.h:547
enum lcsp_css_units lcsp_css_units_t
int npos
Definition: lws-html.h:545
size_t value_len
Definition: lws-html.h:333
const lws_display_font_t * f
Definition: lws-html.h:386
lws_fx_t cury
Definition: lws-html.h:377
LWS_VISIBLE LWS_EXTERN void lws_lhp_destruct(lhp_ctx_t *ctx)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_lhp_parse(lhp_ctx_t *ctx, const uint8_t **buf, size_t *len)
uint32_t flags
Definition: lws-html.h:551
lws_dll2_owner_t defs
Definition: lws-html.h:485
const struct lcsp_atr * css_height
Definition: lws-html.h:394
lcsp_css_units_t unit
Definition: lws-html.h:523
uint8_t runon
Definition: lws-html.h:415
lhp_callback cb
Definition: lws-html.h:370
int propval
Definition: lws-html.h:575
lws_dll2_t list
Definition: lws-html.h:448
const struct lcsp_atr * css_background_color
Definition: lws-html.h:388
const char * base_url
Definition: lws-html.h:534
const struct lcsp_atr * css_color
Definition: lws-html.h:389
struct lcsp_defs lcsp_defs_t
struct lcsp_atr_ptr lcsp_atr_ptr_t
enum lcsp_props lcsp_props_t
void lhp_set_dlo_padding_margin(lhp_pstack_t *ps, lws_dlo_t *dlo)
lws_fx_t deepest
Definition: lws-html.h:379
lws_dll2_t list
Definition: lws-html.h:505
lws_dll2_owner_t active_atr
Definition: lws-html.h:529
lws_box_t drt
Definition: lws-html.h:373
const struct lcsp_atr * css_pos[4]
Definition: lws-html.h:398
struct lcsp_names lcsp_names_t
lcsp_atr_t * atr
Definition: lws-html.h:507
struct lcsp_stanza_ptr lcsp_stanza_ptr_t
lws_dll2_t list
Definition: lws-html.h:499
char buf[LHP_STRING_CHUNK+1]
Definition: lws-html.h:586
lws_dll2_owner_t atrs
Definition: lws-html.h:470
const struct lcsp_atr * css_border_radius[4]
Definition: lws-html.h:396
void * user
Definition: lws-html.h:540
lcsp_stanza_t * stz
Definition: lws-html.h:524
int oi[4]
Definition: lws-html.h:412
void(* sul_cb_t)(struct lws_sorted_usec_list *sul)