php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
after_after_body.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2020 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
8
9
10bool
12 lxb_html_token_t *token)
13{
14 switch (token->tag_id) {
16 lxb_dom_comment_t *comment;
17
18 comment = lxb_html_tree_insert_comment(tree, token,
20 if (comment == NULL) {
21 return lxb_html_tree_process_abort(tree);
22 }
23
24 break;
25 }
26
28 case LXB_TAG_HTML:
29 return lxb_html_tree_insertion_mode_in_body(tree, token);
30
33 if (tree->status != LXB_STATUS_OK) {
34 return lxb_html_tree_process_abort(tree);
35 }
36
37 break;
38
39 case LXB_TAG__TEXT: {
40 lxb_html_token_t ws_token = *token;
41
43 if (tree->status != LXB_STATUS_OK) {
44 return lxb_html_tree_process_abort(tree);
45 }
46
47 if (ws_token.text_start == ws_token.text_end) {
48 return lxb_html_tree_insertion_mode_in_body(tree, token);
49 }
50 }
51 /* fall through */
52
53 default:
55
57
58 return false;
59 }
60
61 return true;
62}
bool lxb_html_tree_insertion_mode_after_after_body(lxb_html_tree_t *tree, lxb_html_token_t *token)
@ LXB_STATUS_OK
Definition base.h:49
#define lxb_dom_interface_node(obj)
Definition interface.h:31
struct lxb_dom_comment lxb_dom_comment_t
Definition interface.h:49
#define NULL
Definition gdcache.h:45
struct lxb_html_tree lxb_html_tree_t
Definition base.h:28
lxb_status_t lxb_html_token_data_skip_ws_begin(lxb_html_token_t *token)
Definition token.c:179
@ LXB_HTML_RULES_ERROR_UNTO
Definition error.h:22
LXB_API bool lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree, lxb_html_token_t *token)
Definition in_body.c:1685
bool lxb_html_tree_process_abort(lxb_html_tree_t *tree)
Definition tree.c:224
lxb_dom_comment_t * lxb_html_tree_insert_comment(lxb_html_tree_t *tree, lxb_html_token_t *token, lxb_dom_node_t *pos)
Definition tree.c:790
lxb_status_t lxb_html_tree_stop_parsing(lxb_html_tree_t *tree)
Definition tree.c:216
void lxb_html_tree_parse_error(lxb_html_tree_t *tree, lxb_html_token_t *token, lxb_html_tree_error_id_t id)
Definition tree.c:237
const lxb_char_t * text_end
Definition token.h:40
lxb_tag_id_t tag_id
Definition token.h:48
const lxb_char_t * text_start
Definition token.h:39
lxb_status_t status
Definition tree.h:66
lxb_html_tree_insertion_mode_f mode
Definition tree.h:62
lxb_html_document_t * document
Definition tree.h:42
@ LXB_TAG__EM_DOCTYPE
Definition const.h:29
@ LXB_TAG__END_OF_FILE
Definition const.h:25
@ LXB_TAG_HTML
Definition const.h:125
@ LXB_TAG__EM_COMMENT
Definition const.h:28
@ LXB_TAG__TEXT
Definition const.h:26