php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
document.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
7#include "lexbor/core/str.h"
8
12#include "lexbor/html/node.h"
13#include "lexbor/html/parser.h"
14#include "lexbor/html/style.h"
15
16#include "lexbor/tag/tag.h"
17
20
21#define LXB_HTML_TAG_RES_DATA
22#define LXB_HTML_TAG_RES_SHS_DATA
23#include "lexbor/html/tag_res.h"
24
25
26static const lexbor_hash_search_t lxb_html_document_css_customs_se = {
29};
30
31static const lexbor_hash_insert_t lxb_html_document_css_customs_in = {
32 .copy = lexbor_hash_copy,
35};
36
37
38typedef struct {
40 uintptr_t id;
41}
43
44typedef struct {
46 bool all;
47}
49
55
56
58lxb_html_document_css_customs_insert(lxb_html_document_t *document,
59 const lxb_char_t *key, size_t length);
60
61#if 0
62static lxb_status_t
63lxb_html_document_style_remove_by_rule_cb(lxb_dom_node_t *node,
65 void *ctx);
66
67static lxb_status_t
68lxb_html_document_style_remove_avl_cb(lexbor_avl_t *avl,
69 lexbor_avl_node_t **root,
70 lexbor_avl_node_t *node, void *ctx);
71
72static lxb_status_t
73lxb_html_document_style_cb(lxb_dom_node_t *node,
74 lxb_css_selector_specificity_t spec, void *ctx);
75
76static lxb_status_t
77lxb_html_document_done(lxb_html_document_t *document);
78#endif
79
80
83 lxb_html_document_t *document);
84
87
88static lexbor_action_t
89lxb_html_document_title_walker(lxb_dom_node_t *node, void *ctx);
90
91#if 0
92static lxb_status_t
93lxb_html_document_event_insert(lxb_dom_node_t *node);
94
95static lxb_status_t
96lxb_html_document_event_insert_attribute(lxb_dom_node_t *node);
97
98static lxb_status_t
99lxb_html_document_event_remove(lxb_dom_node_t *node);
100
101static lxb_status_t
102lxb_html_document_style_remove_cb(lexbor_avl_t *avl, lexbor_avl_node_t **root,
103 lexbor_avl_node_t *node, void *ctx);
104
105static lxb_status_t
106lxb_html_document_event_remove_attribute(lxb_dom_node_t *node);
107
108static lxb_status_t
109lxb_html_document_style_remove_my_cb(lexbor_avl_t *avl, lexbor_avl_node_t **root,
110 lexbor_avl_node_t *node, void *ctx);
111
112static lxb_status_t
113lxb_html_document_event_destroy(lxb_dom_node_t *node);
114
115static lxb_status_t
116lxb_html_document_event_set_value(lxb_dom_node_t *node,
117 const lxb_char_t *value, size_t length);
118#endif
119
120
123{
128
129 if (document != NULL) {
131 sizeof(lxb_html_document_t));
132 }
133 else {
134 doc = lexbor_calloc(1, sizeof(lxb_html_document_t));
135 }
136
137 if (doc == NULL) {
138 return NULL;
139 }
140
142
144 icreator, lxb_html_interface_clone,
147 if (status != LXB_STATUS_OK) {
149 return NULL;
150 }
151
152 hdoc = lxb_html_interface_document(doc);
153
154 if (document == NULL) {
155 hdoc->css_init = false;
156 }
157 else {
158 hdoc->css = document->css;
159 hdoc->css_init = document->css_init;
160 }
161
162 return hdoc;
163}
164
167{
169
170 if (document == NULL) {
171 return NULL;
172 }
173
174 doc = lxb_dom_interface_document(document);
175
176 if (doc->node.owner_document == doc) {
178#if 0
180#endif
181 }
182
184
185 return NULL;
186}
187
193
194void
196{
197 document->body = NULL;
198 document->head = NULL;
199 document->iframe_srcdoc = NULL;
201
202#if 0
204#endif
205
207}
208
209#if 0
212{
214 lxb_html_document_css_t *css = &document->css;
215
216 if (document->css_init) {
217 return LXB_HTML_STATUS_OK;
218 }
219
221 status = lxb_css_memory_init(css->memory, 1024);
222 if (status != LXB_STATUS_OK) {
223 goto failed;
224 }
225
228 if (status != LXB_STATUS_OK) {
229 goto failed;
230 }
231
234 if (status != LXB_STATUS_OK) {
235 goto failed;
236 }
237
240
241 css->selectors = lxb_selectors_create();
242 status = lxb_selectors_init(css->selectors);
243 if (status != LXB_STATUS_OK) {
244 goto failed;
245 }
246
247 css->styles = lexbor_avl_create();
248 status = lexbor_avl_init(css->styles, 2048, sizeof(lxb_html_style_node_t));
249 if (status != LXB_STATUS_OK) {
250 goto failed;
251 }
252
255 if (status != LXB_STATUS_OK) {
256 goto failed;
257 }
258
260 status = lexbor_dobject_init(css->weak, 2048,
261 sizeof(lxb_html_style_weak_t));
262 if (status != LXB_STATUS_OK) {
263 goto failed;
264 }
265
267 if (status != LXB_STATUS_OK) {
268 goto failed;
269 }
270
271 document->css_init = true;
272
273 document->dom_document.ev_insert = lxb_html_document_event_insert;
274 document->dom_document.ev_remove = lxb_html_document_event_remove;
275 document->dom_document.ev_destroy = lxb_html_document_event_destroy;
276 document->dom_document.ev_set_value = lxb_html_document_event_set_value;
277
278 document->done = lxb_html_document_done;
279
280 return LXB_STATUS_OK;
281
282failed:
283
285
286 return status;
287}
288
289void
291{
292 lxb_html_document_css_t *css = &document->css;
293
294 if (!document->css_init
295 || lxb_dom_interface_node(document)->owner_document
296 != lxb_dom_interface_document(document))
297 {
298 return;
299 }
300
301 css->memory = lxb_css_memory_destroy(css->memory, true);
303 css->parser = lxb_css_parser_destroy(css->parser, true);
304 css->selectors = lxb_selectors_destroy(css->selectors, true);
305 css->styles = lexbor_avl_destroy(css->styles, true);
307 css->weak = lexbor_dobject_destroy(css->weak, true);
308
309 document->dom_document.ev_insert = NULL;
310 document->dom_document.ev_remove = NULL;
311 document->dom_document.ev_destroy = NULL;
312 document->dom_document.ev_set_value = NULL;
313
314 document->done = NULL;
315
317}
318
319void
321{
323
324 if (lxb_dom_interface_node(document)->owner_document
325 == lxb_dom_interface_document(document))
326 {
327 if (!document->css_init) {
328 return;
329 }
330
331 css = &document->css;
332
336 lxb_selectors_clean(css->selectors);
340 }
341}
342#endif
343
344void
346 lxb_css_parser_t *parser)
347{
348 document->css.parser = parser;
349}
350
351void
353 lxb_css_memory_t *memory)
354{
355 document->css.memory = memory;
356}
357
369
370void
375
376uintptr_t
378 const lxb_char_t *key, size_t length)
379{
381
382 entry = lexbor_hash_search(document->css.customs,
383 &lxb_html_document_css_customs_se, key, length);
384
385 return (entry != NULL) ? entry->id : 0;
386}
387
389lxb_html_document_css_customs_insert(lxb_html_document_t *document,
390 const lxb_char_t *key, size_t length)
391{
393
394 if (UINTPTR_MAX - document->css.customs_id == 0) {
395 return NULL;
396 }
397
398 entry = lexbor_hash_insert(document->css.customs,
399 &lxb_html_document_css_customs_in, key, length);
400 if (entry == NULL) {
401 return NULL;
402 }
403
404 entry->id = document->css.customs_id++;
405
406 return entry;
407}
408
409uintptr_t
411 const lxb_char_t *key, size_t length)
412{
414
415 entry = lexbor_hash_search(document->css.customs,
416 &lxb_html_document_css_customs_se, key, length);
417 if (entry != NULL) {
418 return entry->id;
419 }
420
421 entry = lxb_html_document_css_customs_insert(document, key, length);
422 if (entry == NULL) {
423 return 0;
424 }
425
426 return entry->id;
427}
428
432{
434
435 status = lexbor_array_push(document->css.stylesheets, sst);
436 if (status != LXB_STATUS_OK) {
437 return status;
438 }
439
440 return lxb_html_document_stylesheet_apply(document, sst);
441}
442
446{
448 lxb_css_rule_t *rule;
450
451 rule = sst->root;
452
453 if (rule->type != LXB_CSS_RULE_LIST) {
455 }
456
457 list = lxb_css_rule_list(rule);
458 rule = list->first;
459
460 while (rule != NULL) {
461 switch (rule->type) {
464 lxb_css_rule_style(rule));
465 break;
466
467 default:
468 break;
469 }
470
471 if (status != LXB_STATUS_OK) {
472 /* FIXME: what to do with an error? */
473 }
474
475 rule = rule->next;
476 }
477
478 return LXB_STATUS_OK;
479}
480
484{
485 if (sst == NULL) {
486 return LXB_STATUS_OK;
487 }
488
489 return lexbor_array_push(document->css.stylesheets, sst);
490}
491
495{
496 size_t i, length;
498 lxb_css_rule_t *rule;
500 lxb_css_stylesheet_t *sst_in;
501
502 rule = sst->root;
503
504 if (rule->type != LXB_CSS_RULE_LIST) {
506 }
507
508 list = lxb_css_rule_list(rule);
509 rule = list->first;
510
511 while (rule != NULL) {
512 switch (rule->type) {
515 lxb_css_rule_style(rule));
516 break;
517
518 default:
519 break;
520 }
521
522 if (status != LXB_STATUS_OK) {
523 /* FIXME: what to do with an error? */
524 }
525
526 rule = rule->next;
527 }
528
529 length = lexbor_array_length(document->css.stylesheets);
530
531 for (i = 0; i < length; i++) {
532 sst_in = lexbor_array_get(document->css.stylesheets, i);
533
534 if (sst_in == sst) {
535 lexbor_array_delete(document->css.stylesheets, i, 1);
536 length = lexbor_array_length(document->css.stylesheets);
537 }
538 }
539
540 return LXB_STATUS_OK;
541}
542
545{
547 lxb_css_rule_t *rule;
548 lexbor_array_t *ssts;
551 lxb_html_document_t *document;
552
553 document = lxb_html_element_document(element);
554 ssts = document->css.stylesheets;
555
556 for (size_t i = 0; i < lexbor_array_length(ssts); i++) {
557 sst = lexbor_array_get(ssts, i);
558
559 list = lxb_css_rule_list(sst->root);
560 rule = list->first;
561
562 while (rule != NULL) {
563 switch (rule->type) {
566 element, lxb_css_rule_style(rule));
567 break;
568
569 default:
570 break;
571 }
572
573 if (status != LXB_STATUS_OK) {
574 /* FIXME: what to do with an error? */
575 }
576
577 rule = rule->next;
578 }
579 }
580
581 return LXB_STATUS_OK;
582}
583
584void
586 bool destroy_memory)
587{
588#if 0
589 size_t length;
591 lxb_html_document_css_t *css = &document->css;
592
593 length = lexbor_array_length(css->stylesheets);
594
595 for (size_t i = 0; i < length; i++) {
596 sst = lexbor_array_pop(css->stylesheets);
597
598 (void) lxb_css_stylesheet_destroy(sst, destroy_memory);
599 }
600#endif
601}
602
606{
607#if 0
608 lxb_html_document_css_t *css = &document->css;
609
610 return lxb_selectors_find(css->selectors, lxb_dom_interface_node(document),
611 style->selector, lxb_html_document_style_cb, style);
612#endif
613 return LXB_STATUS_OK;
614}
615
619{
620#if 0
621 lxb_html_document_css_t *css = &document->css;
622
623 return lxb_selectors_find(css->selectors, lxb_dom_interface_node(document),
624 style->selector,
625 lxb_html_document_style_remove_by_rule_cb, style);
626#endif
627 return LXB_STATUS_OK;
628}
629
630#if 0
631static lxb_status_t
632lxb_html_document_style_remove_by_rule_cb(lxb_dom_node_t *node,
634 void *ctx)
635{
638 lxb_css_rule_style_t *style = ctx;
640
641 /* FIXME: we don't have support for anything other than HTML. */
642
643 if (node->ns != LXB_NS_HTML) {
644 return LXB_STATUS_OK;
645 }
646
648
649 if (el->style == NULL) {
650 return LXB_STATUS_OK;
651 }
652
654
655 context.doc = doc;
656 context.list = style->declarations;
657
658 return lexbor_avl_foreach(doc->css.styles, &el->style,
659 lxb_html_document_style_remove_avl_cb, &context);
660}
661
662static lxb_status_t
663lxb_html_document_style_remove_avl_cb(lexbor_avl_t *avl,
664 lexbor_avl_node_t **root,
665 lexbor_avl_node_t *node, void *ctx)
666{
669
670 if (context->list == NULL) {
671 return LXB_STATUS_OK;
672 }
673
675 style, context->list);
676 return LXB_STATUS_OK;
677}
678#endif
679
682 lxb_html_element_t *element,
684{
685#if 0
686 lxb_html_document_css_t *css = &document->css;
687
688 return lxb_selectors_match_node(css->selectors,
689 lxb_dom_interface_node(element),
690 style->selector,
691 lxb_html_document_style_cb, style);
692#endif
693 return LXB_STATUS_OK;
694}
695
696#if 0
697static lxb_status_t
698lxb_html_document_style_cb(lxb_dom_node_t *node,
699 lxb_css_selector_specificity_t spec, void *ctx)
700{
701 lxb_css_rule_style_t *style = ctx;
702
703 // FIXME: we don't have support for anything other than HTML.
704
705 if (node->ns != LXB_NS_HTML) {
706 return LXB_STATUS_OK;
707 }
708
709 /* Valid behavior when there are no declarations in the style. */
710
711 if (style->declarations == NULL) {
712 return LXB_STATUS_OK;
713 }
714
716 style->declarations, spec);
717}
718#endif
719
725
728 const lxb_char_t *html, size_t size)
729{
733
736 {
737 lxb_html_document_clean(document);
738 }
739
740 opt = document->opt;
741 doc = lxb_dom_interface_document(document);
742
744 if (status != LXB_STATUS_OK) {
745 goto failed;
746 }
747
749 if (status != LXB_STATUS_OK) {
750 goto failed;
751 }
752
754 if (status != LXB_STATUS_OK) {
755 goto failed;
756 }
757
758 document->opt = opt;
759
760 return lxb_html_parse_chunk_end(doc->parser);
761
762failed:
763
764 document->opt = opt;
765
766 return status;
767}
768
771{
774 {
775 lxb_html_document_clean(document);
776 }
777
779 if (status != LXB_STATUS_OK) {
780 return status;
781 }
782
784 document);
785}
786
789 const lxb_char_t *html, size_t size)
790{
792 html, size);
793}
794
800
803 lxb_dom_element_t *element,
804 const lxb_char_t *html, size_t size)
805{
807 lxb_html_parser_t *parser;
808 lxb_html_document_opt_t opt = document->opt;
809
811 if (status != LXB_STATUS_OK) {
812 goto failed;
813 }
814
815 parser = document->dom_document.parser;
816
818 element->node.local_name,
819 element->node.ns);
820 if (status != LXB_STATUS_OK) {
821 goto failed;
822 }
823
825 if (status != LXB_STATUS_OK) {
826 goto failed;
827 }
828
829 document->opt = opt;
830
832
833failed:
834
835 document->opt = opt;
836
837 return NULL;
838}
839
842 lxb_dom_element_t *element)
843{
845 lxb_html_parser_t *parser;
846
848 if (status != LXB_STATUS_OK) {
849 return status;
850 }
851
852 parser = document->dom_document.parser;
853
854 return lxb_html_parse_fragment_chunk_begin(parser, document,
855 element->node.local_name,
856 element->node.ns);
857}
858
866
872
875{
878
879 doc = lxb_dom_interface_document(document);
880
881 if (doc->parser == NULL) {
884
885 if (status != LXB_STATUS_OK) {
887 return status;
888 }
889 }
892 }
893
894 return LXB_STATUS_OK;
895}
896
897#if 0
898static lxb_status_t
899lxb_html_document_done(lxb_html_document_t *document)
900{
901 size_t i, length;
904
905 if (!document->css_init) {
906 return LXB_STATUS_OK;
907 }
908
909 length = lexbor_array_length(document->css.stylesheets);
910
911 for (i = 0; i < length; i++) {
912 sst = lexbor_array_get(document->css.stylesheets, i);
913
915 if (status != LXB_STATUS_OK) {
916 return status;
917 }
918 }
919
920 return LXB_STATUS_OK;
921}
922#endif
923
924const lxb_char_t *
926{
928
930 lxb_html_document_title_walker, &title);
931 if (title == NULL) {
932 return NULL;
933 }
934
936}
937
940 const lxb_char_t *title, size_t len)
941{
943
944 /* TODO: If the document element is an SVG svg element */
945
946 /* If the document element is in the HTML namespace */
947 if (document->head == NULL) {
948 return LXB_STATUS_OK;
949 }
950
951 lxb_html_title_element_t *el_title = NULL;
952
954 lxb_html_document_title_walker, &el_title);
955 if (el_title == NULL) {
956 el_title = (void *) lxb_html_document_create_element(document,
957 (const lxb_char_t *) "title", 5, NULL);
958 if (el_title == NULL) {
960 }
961
963 lxb_dom_interface_node(el_title));
964 }
965
967 title, len);
968 if (status != LXB_STATUS_OK) {
970
971 return status;
972 }
973
974 return LXB_STATUS_OK;
975}
976
977const lxb_char_t *
979{
981
983 lxb_html_document_title_walker, &title);
984 if (title == NULL) {
985 return NULL;
986 }
987
988 return lxb_html_title_element_text(title, len);
989}
990
991static lexbor_action_t
992lxb_html_document_title_walker(lxb_dom_node_t *node, void *ctx)
993{
994 if (node->local_name == LXB_TAG_TITLE && node->ns == LXB_NS_HTML) {
995 *((void **) ctx) = node;
996
997 return LEXBOR_ACTION_STOP;
998 }
999
1000 return LEXBOR_ACTION_OK;
1001}
1002
1005 bool deep)
1006{
1007 return lxb_dom_document_import_node(&doc->dom_document, node, deep);
1008}
1009
1010#if 0
1011static lxb_status_t
1012lxb_html_document_event_insert(lxb_dom_node_t *node)
1013{
1017
1018 if (node->type == LXB_DOM_NODE_TYPE_ATTRIBUTE) {
1019 return lxb_html_document_event_insert_attribute(node);
1020 }
1021 else if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) {
1022 return LXB_STATUS_OK;
1023 }
1024
1025 // FIXME: we don't have support for anything other than HTML.
1026
1027 if (node->ns != LXB_NS_HTML) {
1028 return LXB_STATUS_OK;
1029 }
1030
1031 if (node->local_name == LXB_TAG_STYLE) {
1032 style = lxb_html_interface_style(node);
1033
1035 if (status != LXB_STATUS_OK) {
1036 return status;
1037 }
1038
1040
1042 if (status != LXB_STATUS_OK) {
1043 return status;
1044 }
1045 }
1046
1048}
1049
1050static lxb_status_t
1051lxb_html_document_event_insert_attribute(lxb_dom_node_t *node)
1052{
1056
1058 || node->local_name != LXB_DOM_ATTR_STYLE)
1059 {
1060 return LXB_STATUS_OK;
1061 }
1062
1063 // FIXME: we don't have support for anything other than HTML.
1064
1065 if (node->ns != LXB_NS_HTML) {
1066 return LXB_STATUS_OK;
1067 }
1068
1070 el = lxb_html_interface_element(attr->owner);
1071
1072 if (el != NULL && el->list != NULL) {
1073 status = lxb_html_document_event_remove_attribute(node);
1074 if (status != LXB_STATUS_OK) {
1075 return status;
1076 }
1077 }
1078
1079 if (attr->value == NULL || attr->value->data == NULL) {
1080 return LXB_STATUS_OK;
1081 }
1082
1083 return lxb_html_element_style_parse(el, attr->value->data,
1084 attr->value->length);
1085}
1086
1087static lxb_status_t
1088lxb_html_document_event_remove(lxb_dom_node_t *node)
1089{
1094
1095 if (node->type == LXB_DOM_NODE_TYPE_ATTRIBUTE) {
1096 return lxb_html_document_event_remove_attribute(node);
1097 }
1098 else if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) {
1099 return LXB_STATUS_OK;
1100 }
1101
1102 // FIXME: we don't have support for anything other than HTML.
1103
1104 if (node->ns != LXB_NS_HTML) {
1105 return LXB_STATUS_OK;
1106 }
1107
1108 if (node->local_name == LXB_TAG_STYLE) {
1110 if (status != LXB_STATUS_OK) {
1111 return status;
1112 }
1113 }
1114
1115 el = lxb_html_interface_element(node);
1116
1117 if (el->style == NULL) {
1118 return LXB_STATUS_OK;
1119 }
1120
1122
1123 context.doc = doc;
1124 context.all = false;
1125
1126 return lexbor_avl_foreach(doc->css.styles, &el->style,
1127 lxb_html_document_style_remove_cb, &context);
1128}
1129
1130static lxb_status_t
1131lxb_html_document_style_remove_cb(lexbor_avl_t *avl, lexbor_avl_node_t **root,
1132 lexbor_avl_node_t *node, void *ctx)
1133{
1136
1137 if (context->all) {
1138 lxb_html_element_style_remove_all(context->doc, root, style);
1139 }
1140
1141 lxb_html_element_style_remove_all_not(context->doc, root, style, false);
1142
1143 return LXB_STATUS_OK;
1144}
1145
1146static lxb_status_t
1147lxb_html_document_event_remove_attribute(lxb_dom_node_t *node)
1148{
1154
1155 // FIXME: we don't have support for anything other than HTML.
1156
1157 if (node->local_name != LXB_DOM_ATTR_STYLE || node->ns != LXB_NS_HTML) {
1158 return LXB_STATUS_OK;
1159 }
1160
1162 el = lxb_html_interface_element(attr->owner);
1163
1164 if (el == NULL || el->list == NULL) {
1165 return LXB_STATUS_OK;
1166 }
1167
1169
1170 context.doc = doc;
1171
1173 lxb_html_document_style_remove_my_cb, &context);
1174 if (status != LXB_STATUS_OK) {
1175 return status;
1176 }
1177
1178 el->list->first = NULL;
1179 el->list->last = NULL;
1180
1182
1183 return LXB_STATUS_OK;
1184}
1185
1186static lxb_status_t
1187lxb_html_document_style_remove_my_cb(lexbor_avl_t *avl, lexbor_avl_node_t **root,
1188 lexbor_avl_node_t *node, void *ctx)
1189{
1192
1193 lxb_html_element_style_remove_all_not(context->doc, root, style, true);
1194
1195 return LXB_STATUS_OK;
1196}
1197
1198static lxb_status_t
1199lxb_html_document_event_destroy(lxb_dom_node_t *node)
1200{
1205
1206 if (node->type == LXB_DOM_NODE_TYPE_ATTRIBUTE) {
1207 return lxb_html_document_event_remove_attribute(node);
1208 }
1209 else if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) {
1210 return LXB_STATUS_OK;
1211 }
1212
1213 // FIXME: we don't have support for anything other than HTML.
1214
1215 if (node->ns != LXB_NS_HTML) {
1216 return LXB_STATUS_OK;
1217 }
1218
1219 el = lxb_html_interface_element(node);
1220
1221 if (el->style == NULL) {
1222 if (el->list != NULL) {
1223 goto destroy;
1224 }
1225
1226 return LXB_STATUS_OK;
1227 }
1228
1230
1231 context.doc = doc;
1232 context.all = true;
1233
1235 lxb_html_document_style_remove_cb, &context);
1236
1237 if (status != LXB_STATUS_OK) {
1238 return status;
1239 }
1240
1241destroy:
1242
1243 el->list->first = NULL;
1244 el->list->last = NULL;
1245
1247
1248 return LXB_STATUS_OK;
1249}
1250
1251static lxb_status_t
1252lxb_html_document_event_set_value(lxb_dom_node_t *node,
1253 const lxb_char_t *value, size_t length)
1254{
1257
1259 || node->local_name != LXB_DOM_ATTR_STYLE)
1260 {
1261 return LXB_STATUS_OK;
1262 }
1263
1264 // FIXME: we don't have support for anything other than HTML.
1265
1266 if (node->ns != LXB_NS_HTML) {
1267 return LXB_STATUS_OK;
1268 }
1269
1270 if (attr->owner == NULL) {
1271 return LXB_STATUS_OK;
1272 }
1273
1274 status = lxb_html_document_event_remove_attribute(node);
1275 if (status != LXB_STATUS_OK) {
1276 return status;
1277 }
1278
1280 value, length);
1281}
1282#endif
1283
1284/*
1285 * No inline functions for ABI.
1286 */
1292
1298
1304
1305bool
1310
1313{
1314 return lxb_html_document_mraw(document);
1315}
1316
1322
1323void
1329
1332{
1333 return lxb_html_document_opt(document);
1334}
1335
1336void *
1338 size_t struct_size)
1339{
1340 return lxb_html_document_create_struct(document, struct_size);
1341}
1342
1343void *
1348
1351 const lxb_char_t *local_name,
1352 size_t lname_len, void *reserved_for_opt)
1353{
1354 return lxb_html_document_create_element(document, local_name, lname_len,
1355 reserved_for_opt);
1356}
1357
size_t len
Definition apprentice.c:174
lxb_inline void * lexbor_array_get(lexbor_array_t *array, size_t idx)
Definition array.h:62
lxb_inline size_t lexbor_array_length(lexbor_array_t *array)
Definition array.h:72
@ LXB_DOM_ATTR_STYLE
Definition attr_const.h:52
lxb_status_t lexbor_avl_init(lexbor_avl_t *avl, size_t chunk_len, size_t struct_size)
Definition avl.c:45
lexbor_avl_t * lexbor_avl_create(void)
Definition avl.c:39
void lexbor_avl_clean(lexbor_avl_t *avl)
Definition avl.c:68
lexbor_avl_t * lexbor_avl_destroy(lexbor_avl_t *avl, bool self_destroy)
Definition avl.c:76
lxb_status_t lexbor_avl_foreach(lexbor_avl_t *avl, lexbor_avl_node_t **scope, lexbor_avl_node_f cb, void *ctx)
Definition avl.c:455
struct lexbor_avl_node lexbor_avl_node_t
Definition avl.h:19
struct lexbor_avl lexbor_avl_t
Definition avl.h:18
@ LXB_STATUS_ERROR_MEMORY_ALLOCATION
Definition base.h:51
@ LXB_STATUS_ERROR_WRONG_ARGS
Definition base.h:58
@ LXB_STATUS_OK
Definition base.h:49
lexbor_action_t
Definition base.h:73
@ LEXBOR_ACTION_OK
Definition base.h:74
@ LEXBOR_ACTION_STOP
Definition base.h:75
struct lxb_css_stylesheet lxb_css_stylesheet_t
Definition base.h:65
struct lxb_css_rule_style lxb_css_rule_style_t
Definition base.h:67
LXB_API lxb_status_t lxb_css_memory_init(lxb_css_memory_t *memory, size_t prepare_count)
Definition css.c:28
struct lxb_css_memory lxb_css_memory_t
LXB_API lxb_css_memory_t * lxb_css_memory_destroy(lxb_css_memory_t *memory, bool self_destroy)
Definition css.c:97
LXB_API void lxb_css_memory_clean(lxb_css_memory_t *memory)
Definition css.c:81
struct lxb_css_rule_list lxb_css_rule_list_t
Definition base.h:66
struct lxb_css_rule_declaration_list lxb_css_rule_declaration_list_t
Definition base.h:69
LXB_API lxb_css_memory_t * lxb_css_memory_create(void)
Definition css.c:22
struct lxb_css_parser lxb_css_parser_t
Definition base.h:41
lxb_css_parser_t * lxb_css_parser_create(void)
Definition parser.c:13
void lxb_css_parser_clean(lxb_css_parser_t *parser)
Definition parser.c:104
lxb_css_parser_t * lxb_css_parser_destroy(lxb_css_parser_t *parser, bool self_destroy)
Definition parser.c:130
lxb_status_t lxb_css_parser_init(lxb_css_parser_t *parser, lxb_css_syntax_tokenizer_t *tkz)
Definition parser.c:19
lxb_inline void lxb_css_parser_memory_set(lxb_css_parser_t *parser, lxb_css_memory_t *memory)
Definition parser.h:268
lxb_inline void lxb_css_parser_selectors_set(lxb_css_parser_t *parser, lxb_css_selectors_t *selectors)
Definition parser.h:280
@ LXB_CSS_PROPERTY__LAST_ENTRY
Definition const.h:125
lxb_status_t lxb_css_selectors_init(lxb_css_selectors_t *selectors)
Definition selectors.c:86
lxb_css_selectors_t * lxb_css_selectors_destroy(lxb_css_selectors_t *selectors, bool self_destroy)
Definition selectors.c:120
lxb_css_selectors_t * lxb_css_selectors_create(void)
Definition selectors.c:80
void lxb_css_selectors_clean(lxb_css_selectors_t *selectors)
Definition selectors.c:105
DNS_STATUS status
Definition dns_win32.c:49
lxb_status_t lexbor_dobject_init(lexbor_dobject_t *dobject, size_t chunk_size, size_t struct_size)
Definition dobject.c:22
void lexbor_dobject_clean(lexbor_dobject_t *dobject)
Definition dobject.c:64
lexbor_dobject_t * lexbor_dobject_destroy(lexbor_dobject_t *dobject, bool destroy_self)
Definition dobject.c:75
lexbor_dobject_t * lexbor_dobject_create(void)
Definition dobject.c:16
lxb_dom_interface_t *(* lxb_dom_interface_create_f)(lxb_dom_document_t *document, lxb_tag_id_t tag_id, lxb_ns_id_t ns)
Definition interface.h:61
struct lxb_dom_document lxb_dom_document_t
Definition interface.h:41
#define lxb_dom_interface_attr(obj)
Definition interface.h:29
#define lxb_dom_interface_node(obj)
Definition interface.h:31
#define lxb_dom_interface_document(obj)
Definition interface.h:25
struct lxb_dom_node lxb_dom_node_t
Definition interface.h:38
struct lxb_dom_attr lxb_dom_attr_t
Definition interface.h:40
struct lxb_dom_element lxb_dom_element_t
Definition interface.h:39
@ LXB_DOM_DOCUMENT_DTYPE_HTML
Definition document.h:30
@ LXB_DOM_NODE_TYPE_ATTRIBUTE
Definition node.h:26
@ LXB_DOM_NODE_TYPE_ELEMENT
Definition node.h:25
void lexbor_array_delete(lexbor_array_t *array, size_t begin, size_t length)
Definition array.c:170
lexbor_array_t * lexbor_array_create(void)
Definition array.c:11
lexbor_array_t * lexbor_array_destroy(lexbor_array_t *array, bool self_destroy)
Definition array.c:47
void lexbor_array_clean(lexbor_array_t *array)
Definition array.c:39
lxb_status_t lexbor_array_push(lexbor_array_t *array, void *value)
Definition array.c:87
void * lexbor_array_pop(lexbor_array_t *array)
Definition array.c:102
lxb_status_t lexbor_array_init(lexbor_array_t *array, size_t size)
Definition array.c:17
uint32_t lexbor_hash_make_id(const lxb_char_t *key, size_t length)
Definition hash.c:343
lxb_status_t lexbor_hash_init(lexbor_hash_t *hash, size_t table_size, size_t struct_size)
Definition hash.c:120
void * lexbor_hash_insert(lexbor_hash_t *hash, const lexbor_hash_insert_t *insert, const lxb_char_t *key, size_t length)
Definition hash.c:186
lxb_status_t lexbor_hash_copy(lexbor_hash_t *hash, lexbor_hash_entry_t *entry, const lxb_char_t *key, size_t length)
Definition hash.c:400
lexbor_hash_t * lexbor_hash_create(void)
Definition hash.c:114
void * lexbor_hash_search(lexbor_hash_t *hash, const lexbor_hash_search_t *search, const lxb_char_t *key, size_t length)
Definition hash.c:274
lexbor_hash_t * lexbor_hash_destroy(lexbor_hash_t *hash, bool destroy_obj)
Definition hash.c:168
lxb_dom_interface_t * lxb_html_interface_clone(lxb_dom_document_t *document, const lxb_dom_interface_t *intrfc)
Definition interface.c:66
lxb_dom_interface_t * lxb_html_interface_destroy(lxb_dom_interface_t *intrfc)
Definition interface.c:120
lxb_dom_interface_t * lxb_html_interface_create(lxb_html_document_t *document, lxb_tag_id_t tag_id, lxb_ns_id_t ns)
Definition interface.c:25
new_type size
Definition ffi.c:4365
new_type attr
Definition ffi.c:4364
#define NULL
Definition gdcache.h:45
struct lexbor_hash_search lexbor_hash_search_t
Definition hash.h:22
struct lexbor_hash_entry lexbor_hash_entry_t
Definition hash.h:42
struct lexbor_hash_insert lexbor_hash_insert_t
Definition hash.h:23
@ LXB_HTML_STATUS_OK
Definition base.h:34
#define lxb_html_interface_style(obj)
Definition interface.h:77
struct lxb_html_body_element lxb_html_body_element_t
Definition interface.h:101
#define lxb_html_interface_element(obj)
Definition interface.h:36
#define lxb_html_interface_document(obj)
Definition interface.h:20
struct lxb_html_style_element lxb_html_style_element_t
Definition interface.h:152
struct lxb_html_title_element lxb_html_title_element_t
Definition interface.h:162
struct lxb_html_element lxb_html_element_t
Definition interface.h:111
struct lxb_html_head_element lxb_html_head_element_t
Definition interface.h:119
struct lxb_html_document lxb_html_document_t
Definition interface.h:95
@ LXB_HTML_DOCUMENT_READY_STATE_UNDEF
Definition document.h:31
@ LXB_HTML_DOCUMENT_READY_STATE_LOADING
Definition document.h:32
lxb_inline lxb_html_head_element_t * lxb_html_document_head_element(lxb_html_document_t *document)
Definition document.h:206
lxb_inline void * lxb_html_document_destroy_struct(lxb_html_document_t *document, void *data)
Definition document.h:276
lxb_inline lxb_dom_element_t * lxb_html_document_destroy_element(lxb_dom_element_t *element)
Definition document.h:292
LXB_API void lxb_html_document_css_destroy(lxb_html_document_t *document)
lxb_inline lxb_html_body_element_t * lxb_html_document_body_element(lxb_html_document_t *document)
Definition document.h:212
unsigned int lxb_html_document_opt_t
Definition document.h:28
LXB_API lxb_status_t lxb_html_document_css_init(lxb_html_document_t *document)
lxb_html_document_opt
Definition document.h:38
lxb_inline lxb_dom_document_t * lxb_html_document_original_ref(lxb_html_document_t *document)
Definition document.h:218
lxb_inline lexbor_mraw_t * lxb_html_document_mraw(lxb_html_document_t *document)
Definition document.h:237
lxb_inline bool lxb_html_document_is_original(lxb_html_document_t *document)
Definition document.h:230
lxb_inline lexbor_mraw_t * lxb_html_document_mraw_text(lxb_html_document_t *document)
Definition document.h:243
lxb_inline void * lxb_html_document_create_struct(lxb_html_document_t *document, size_t struct_size)
Definition document.h:268
lxb_inline lxb_html_element_t * lxb_html_document_create_element(lxb_html_document_t *document, const lxb_char_t *local_name, size_t lname_len, void *reserved_for_opt)
Definition document.h:282
LXB_API void lxb_html_document_css_clean(lxb_html_document_t *document)
lxb_inline void lxb_html_document_opt_set(lxb_html_document_t *document, lxb_html_document_opt_t opt)
Definition document.h:249
lxb_inline lxb_html_document_t * lxb_html_element_document(lxb_html_element_t *element)
Definition element.h:165
lxb_status_t lxb_html_parse_fragment_chunk_begin(lxb_html_parser_t *parser, lxb_html_document_t *document, lxb_tag_id_t tag_id, lxb_ns_id_t ns)
Definition parser.c:178
lxb_dom_node_t * lxb_html_parse_fragment_chunk_end(lxb_html_parser_t *parser)
Definition parser.c:301
lxb_html_parser_t * lxb_html_parser_destroy(lxb_html_parser_t *parser)
Definition parser.c:79
lxb_status_t lxb_html_parse_chunk_end(lxb_html_parser_t *parser)
Definition parser.c:419
lxb_status_t lxb_html_parse_chunk_process(lxb_html_parser_t *parser, const lxb_char_t *html, size_t size)
Definition parser.c:403
void lxb_html_parser_clean(lxb_html_parser_t *parser)
Definition parser.c:66
lxb_status_t lxb_html_parser_init(lxb_html_parser_t *parser)
Definition parser.c:32
lxb_html_parser_t * lxb_html_parser_unref(lxb_html_parser_t *parser)
Definition parser.c:104
lxb_status_t lxb_html_parse_fragment_chunk_process(lxb_html_parser_t *parser, const lxb_char_t *html, size_t size)
Definition parser.c:280
lxb_html_parser_t * lxb_html_parser_create(void)
Definition parser.c:26
@ LXB_HTML_PARSER_STATE_BEGIN
Definition parser.h:22
lxb_inline lxb_status_t lxb_html_parser_state(lxb_html_parser_t *parser)
Definition parser.h:126
lxb_status_t lxb_dom_document_clean(lxb_dom_document_t *document)
Definition document.c:179
lxb_dom_document_t * lxb_dom_document_destroy(lxb_dom_document_t *document)
Definition document.c:199
lxb_dom_node_t * lxb_dom_document_import_node(lxb_dom_document_t *doc, lxb_dom_node_t *node, bool deep)
Definition document.c:432
lxb_status_t lxb_dom_document_init(lxb_dom_document_t *document, lxb_dom_document_t *owner, lxb_dom_interface_create_f create_interface, lxb_dom_interface_clone_f clone_interface, lxb_dom_interface_destroy_f destroy_interface, lxb_dom_document_dtype_t type, unsigned int ns)
Definition document.c:72
lxb_status_t lxb_dom_node_text_content_set(lxb_dom_node_t *node, const lxb_char_t *content, size_t len)
Definition node.c:1198
void lxb_dom_node_simple_walk(lxb_dom_node_t *root, lxb_dom_node_simple_walker_f walker_cb, void *ctx)
Definition node.c:500
void lxb_dom_node_insert_child(lxb_dom_node_t *to, lxb_dom_node_t *node)
Definition node.c:385
lxb_dom_node_t * lxb_html_document_parse_fragment(lxb_html_document_t *document, lxb_dom_element_t *element, const lxb_char_t *html, size_t size)
Definition document.c:802
lxb_html_document_t * lxb_html_document_create(void)
Definition document.c:189
void lxb_html_document_clean(lxb_html_document_t *document)
Definition document.c:195
lexbor_mraw_t * lxb_html_document_mraw_text_noi(lxb_html_document_t *document)
Definition document.c:1318
lxb_status_t lxb_html_document_parse(lxb_html_document_t *document, const lxb_char_t *html, size_t size)
Definition document.c:727
void lxb_html_document_css_parser_attach(lxb_html_document_t *document, lxb_css_parser_t *parser)
Definition document.c:345
lxb_dom_document_t * lxb_html_document_original_ref_noi(lxb_html_document_t *document)
Definition document.c:1300
lxb_status_t lxb_html_document_element_styles_attach(lxb_html_element_t *element)
Definition document.c:544
lxb_html_head_element_t * lxb_html_document_head_element_noi(lxb_html_document_t *document)
Definition document.c:1288
lxb_dom_element_t * lxb_html_document_destroy_element_noi(lxb_dom_element_t *element)
Definition document.c:1359
void lxb_html_document_css_memory_attach(lxb_html_document_t *document, lxb_css_memory_t *memory)
Definition document.c:352
lxb_html_body_element_t * lxb_html_document_body_element_noi(lxb_html_document_t *document)
Definition document.c:1294
void lxb_html_document_opt_set_noi(lxb_html_document_t *document, lxb_html_document_opt_t opt)
Definition document.c:1324
lxb_status_t lxb_html_document_parse_chunk_begin(lxb_html_document_t *document)
Definition document.c:770
lxb_status_t lxb_html_document_stylesheet_attach(lxb_html_document_t *document, lxb_css_stylesheet_t *sst)
Definition document.c:430
lxb_status_t lxb_html_document_parse_chunk(lxb_html_document_t *document, const lxb_char_t *html, size_t size)
Definition document.c:788
lxb_status_t lxb_html_document_style_attach(lxb_html_document_t *document, lxb_css_rule_style_t *style)
Definition document.c:604
void * lxb_html_document_destroy_struct_noi(lxb_html_document_t *document, void *data)
Definition document.c:1344
lxb_status_t lxb_html_document_css_customs_init(lxb_html_document_t *document)
Definition document.c:359
lxb_html_document_opt_t lxb_html_document_opt_noi(lxb_html_document_t *document)
Definition document.c:1331
void * lxb_html_document_create_struct_noi(lxb_html_document_t *document, size_t struct_size)
Definition document.c:1337
lxb_status_t lxb_html_document_parse_fragment_chunk(lxb_html_document_t *document, const lxb_char_t *html, size_t size)
Definition document.c:860
uintptr_t lxb_html_document_css_customs_find_id(lxb_html_document_t *document, const lxb_char_t *key, size_t length)
Definition document.c:377
lxb_status_t lxb_html_document_style_remove(lxb_html_document_t *document, lxb_css_rule_style_t *style)
Definition document.c:617
bool lxb_html_document_is_original_noi(lxb_html_document_t *document)
Definition document.c:1306
lxb_status_t lxb_html_document_stylesheet_remove(lxb_html_document_t *document, lxb_css_stylesheet_t *sst)
Definition document.c:493
lxb_inline lxb_status_t lxb_html_document_parser_prepare(lxb_html_document_t *document)
Definition document.c:874
uintptr_t lxb_html_document_css_customs_id(lxb_html_document_t *document, const lxb_char_t *key, size_t length)
Definition document.c:410
void lxb_html_document_stylesheet_destroy_all(lxb_html_document_t *document, bool destroy_memory)
Definition document.c:585
lxb_html_element_t * lxb_html_document_create_element_noi(lxb_html_document_t *document, const lxb_char_t *local_name, size_t lname_len, void *reserved_for_opt)
Definition document.c:1350
lxb_status_t lxb_html_document_stylesheet_apply(lxb_html_document_t *document, lxb_css_stylesheet_t *sst)
Definition document.c:444
void lxb_html_document_css_customs_destroy(lxb_html_document_t *document)
Definition document.c:371
const lxb_char_t * lxb_html_document_title(lxb_html_document_t *document, size_t *len)
Definition document.c:925
lxb_status_t lxb_html_document_title_set(lxb_html_document_t *document, const lxb_char_t *title, size_t len)
Definition document.c:939
const lxb_char_t * lxb_html_document_title_raw(lxb_html_document_t *document, size_t *len)
Definition document.c:978
lxb_status_t lxb_html_document_stylesheet_add(lxb_html_document_t *document, lxb_css_stylesheet_t *sst)
Definition document.c:482
lxb_status_t lxb_html_document_parse_fragment_chunk_begin(lxb_html_document_t *document, lxb_dom_element_t *element)
Definition document.c:841
lxb_status_t lxb_html_document_style_attach_by_element(lxb_html_document_t *document, lxb_html_element_t *element, lxb_css_rule_style_t *style)
Definition document.c:681
lxb_status_t lxb_html_document_parse_chunk_end(lxb_html_document_t *document)
Definition document.c:796
lxb_html_document_t * lxb_html_document_interface_create(lxb_html_document_t *document)
Definition document.c:122
lexbor_mraw_t * lxb_html_document_mraw_noi(lxb_html_document_t *document)
Definition document.c:1312
lxb_html_document_t * lxb_html_document_destroy(lxb_html_document_t *document)
Definition document.c:721
lxb_dom_node_t * lxb_html_document_parse_fragment_chunk_end(lxb_html_document_t *document)
Definition document.c:868
lxb_dom_node_t * lxb_html_document_import_node(lxb_html_document_t *doc, lxb_dom_node_t *node, bool deep)
Definition document.c:1004
lxb_html_document_t * lxb_html_document_interface_destroy(lxb_html_document_t *document)
Definition document.c:166
lxb_status_t lxb_html_parse_chunk_prepare(lxb_html_parser_t *parser, lxb_html_document_t *document)
Definition parser.c:355
lxb_status_t lxb_html_element_style_list_append(lxb_html_element_t *element, lxb_css_rule_declaration_list_t *list, lxb_css_selector_specificity_t spec)
Definition element.c:379
lxb_html_style_node_t * lxb_html_element_style_remove_all_not(lxb_html_document_t *doc, lexbor_avl_node_t **root, lxb_html_style_node_t *style, bool bs)
Definition element.c:444
lxb_status_t lxb_html_element_style_parse(lxb_html_element_t *element, const lxb_char_t *style, size_t size)
Definition element.c:238
lxb_html_style_node_t * lxb_html_element_style_remove_by_list(lxb_html_document_t *doc, lexbor_avl_node_t **root, lxb_html_style_node_t *style, lxb_css_rule_declaration_list_t *list)
Definition element.c:522
lxb_html_style_node_t * lxb_html_element_style_remove_all(lxb_html_document_t *doc, lexbor_avl_node_t **root, lxb_html_style_node_t *style)
Definition element.c:498
LXB_API void * lexbor_calloc(size_t num, size_t size)
Definition memory.c:27
void * lexbor_mraw_calloc(lexbor_mraw_t *mraw, size_t size)
Definition mraw.c:227
@ LXB_NS_HTML
Definition const.h:26
unsigned char key[REFLECTION_KEY_LEN]
zend_constant * data
struct lxb_css_rule lxb_css_rule_t
Definition rule.h:41
LXB_API lxb_css_rule_declaration_list_t * lxb_css_rule_declaration_list_destroy(lxb_css_rule_declaration_list_t *list, bool self_destroy)
@ LXB_CSS_RULE_LIST
Definition rule.h:32
@ LXB_CSS_RULE_STYLE
Definition rule.h:34
#define lxb_css_rule_list(rule)
Definition rule.h:21
#define lxb_css_rule_style(rule)
Definition rule.h:23
uint32_t lxb_css_selector_specificity_t
Definition selector.h:107
lxb_status_t lxb_selectors_find(lxb_selectors_t *selectors, const xmlNode *root, const lxb_css_selector_list_t *list, lxb_selectors_cb_f cb, void *ctx)
Definition selectors.c:410
void lxb_selectors_destroy(lxb_selectors_t *selectors)
Definition selectors.c:316
lxb_status_t lxb_selectors_init(lxb_selectors_t *selectors)
Definition selectors.c:285
lxb_status_t lxb_selectors_match_node(lxb_selectors_t *selectors, const xmlNode *node, const lxb_css_selector_list_t *list, lxb_selectors_cb_f cb, void *ctx)
Definition selectors.c:434
void lxb_selectors_clean(lxb_selectors_t *selectors)
Definition selectors.c:309
lxb_selectors_t * lxb_selectors_create(void)
Definition selectors.c:114
bool lexbor_str_data_ncasecmp(const lxb_char_t *first, const lxb_char_t *sec, size_t size)
Definition str.c:435
Definition dce.c:49
lxb_css_rule_t * first
Definition rule.h:94
lxb_css_rule_t * last
Definition rule.h:95
lxb_css_rule_t * first
Definition rule.h:59
lxb_css_selector_list_t * selector
Definition rule.h:80
lxb_css_rule_declaration_list_t * declarations
Definition rule.h:81
lxb_css_rule_t * next
Definition rule.h:45
lxb_css_rule_type_t type
Definition rule.h:44
lxb_css_rule_t * root
Definition stylesheet.h:22
lxb_dom_node_t node
Definition document.h:36
lxb_dom_event_remove_f ev_remove
Definition document.h:49
lxb_dom_event_insert_f ev_insert
Definition document.h:48
lxb_dom_event_destroy_f ev_destroy
Definition document.h:50
lxb_dom_event_set_value_f ev_set_value
Definition document.h:51
lxb_dom_node_t node
Definition element.h:33
uintptr_t ns
Definition node.h:48
lxb_dom_document_t * owner_document
Definition node.h:50
lxb_dom_node_type_t type
Definition node.h:59
uintptr_t local_name
Definition node.h:46
Definition document.c:38
uintptr_t id
Definition document.c:40
lexbor_hash_entry_t entry
Definition document.c:39
lexbor_array_t * stylesheets
Definition document.h:49
lexbor_hash_t * customs
Definition document.h:52
lexbor_avl_t * styles
Definition document.h:48
lxb_css_parser_t * parser
Definition document.h:46
lxb_css_selectors_t * css_selectors
Definition document.h:45
lxb_css_memory_t * memory
Definition document.h:44
lexbor_dobject_t * weak
Definition document.h:50
lxb_html_document_t * doc
Definition document.c:45
lxb_css_rule_declaration_list_t * list
Definition document.c:52
lxb_html_document_t * doc
Definition document.c:51
lxb_html_head_element_t * head
Definition document.h:62
lxb_html_document_opt_t opt
Definition document.h:71
lxb_html_document_done_cb_f done
Definition document.h:68
lxb_html_document_css_t css
Definition document.h:65
lxb_html_document_ready_state_t ready_state
Definition document.h:69
lxb_html_body_element_t * body
Definition document.h:63
lxb_dom_document_t dom_document
Definition document.h:58
void * iframe_srcdoc
Definition document.h:60
lexbor_avl_node_t * style
Definition element.h:24
lxb_css_rule_declaration_list_t * list
Definition element.h:25
lxb_dom_element_t element
Definition element.h:23
lxb_css_stylesheet_t * stylesheet
lxb_html_element_t element
struct lxb_html_style_weak lxb_html_style_weak_t
Definition style.h:19
lxb_status_t lxb_html_element_style_remove(lxb_html_style_element_t *style)
lxb_status_t lxb_html_style_element_parse(lxb_html_style_element_t *element)
LXB_API lxb_css_stylesheet_t * lxb_css_stylesheet_destroy(lxb_css_stylesheet_t *sst, bool destroy_memory)
@ LXB_TAG_TITLE
Definition const.h:210
@ LXB_TAG_STYLE
Definition const.h:195
const lxb_char_t * lxb_html_title_element_strict_text(lxb_html_title_element_t *title, size_t *len)
const lxb_char_t * lxb_html_title_element_text(lxb_html_title_element_t *title, size_t *len)
unsigned int lxb_status_t
Definition types.h:28
#define lxb_inline
Definition types.h:21
unsigned char lxb_char_t
Definition types.h:27
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
value