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
7
#include "
lexbor/html/tree/insertion_mode.h
"
8
9
10
bool
11
lxb_html_tree_insertion_mode_after_after_body
(
lxb_html_tree_t
*tree,
12
lxb_html_token_t
*token)
13
{
14
switch
(token->
tag_id
) {
15
case
LXB_TAG__EM_COMMENT
: {
16
lxb_dom_comment_t
*comment;
17
18
comment =
lxb_html_tree_insert_comment
(tree, token,
19
lxb_dom_interface_node
(tree->
document
));
20
if
(comment ==
NULL
) {
21
return
lxb_html_tree_process_abort
(tree);
22
}
23
24
break
;
25
}
26
27
case
LXB_TAG__EM_DOCTYPE
:
28
case
LXB_TAG_HTML
:
29
return
lxb_html_tree_insertion_mode_in_body
(tree, token);
30
31
case
LXB_TAG__END_OF_FILE
:
32
tree->
status
=
lxb_html_tree_stop_parsing
(tree);
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
42
tree->
status
=
lxb_html_token_data_skip_ws_begin
(&ws_token);
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
:
54
lxb_html_tree_parse_error
(tree, token,
LXB_HTML_RULES_ERROR_UNTO
);
55
56
tree->
mode
=
lxb_html_tree_insertion_mode_in_body
;
57
58
return
false
;
59
}
60
61
return
true
;
62
}
lxb_html_tree_insertion_mode_after_after_body
bool lxb_html_tree_insertion_mode_after_after_body(lxb_html_tree_t *tree, lxb_html_token_t *token)
Definition
after_after_body.c:11
LXB_STATUS_OK
@ LXB_STATUS_OK
Definition
base.h:49
lxb_dom_interface_node
#define lxb_dom_interface_node(obj)
Definition
interface.h:31
lxb_dom_comment_t
struct lxb_dom_comment lxb_dom_comment_t
Definition
interface.h:49
NULL
#define NULL
Definition
gdcache.h:45
lxb_html_tree_t
struct lxb_html_tree lxb_html_tree_t
Definition
base.h:28
lxb_html_token_data_skip_ws_begin
lxb_status_t lxb_html_token_data_skip_ws_begin(lxb_html_token_t *token)
Definition
token.c:179
LXB_HTML_RULES_ERROR_UNTO
@ LXB_HTML_RULES_ERROR_UNTO
Definition
error.h:22
insertion_mode.h
lxb_html_tree_insertion_mode_in_body
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
lxb_html_tree_process_abort
bool lxb_html_tree_process_abort(lxb_html_tree_t *tree)
Definition
tree.c:224
lxb_html_tree_insert_comment
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_html_tree_stop_parsing
lxb_status_t lxb_html_tree_stop_parsing(lxb_html_tree_t *tree)
Definition
tree.c:216
lxb_html_tree_parse_error
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
lxb_html_token_t
Definition
token.h:33
lxb_html_token_t::text_end
const lxb_char_t * text_end
Definition
token.h:40
lxb_html_token_t::tag_id
lxb_tag_id_t tag_id
Definition
token.h:48
lxb_html_token_t::text_start
const lxb_char_t * text_start
Definition
token.h:39
lxb_html_tree::status
lxb_status_t status
Definition
tree.h:66
lxb_html_tree::mode
lxb_html_tree_insertion_mode_f mode
Definition
tree.h:62
lxb_html_tree::document
lxb_html_document_t * document
Definition
tree.h:42
LXB_TAG__EM_DOCTYPE
@ LXB_TAG__EM_DOCTYPE
Definition
const.h:29
LXB_TAG__END_OF_FILE
@ LXB_TAG__END_OF_FILE
Definition
const.h:25
LXB_TAG_HTML
@ LXB_TAG_HTML
Definition
const.h:125
LXB_TAG__EM_COMMENT
@ LXB_TAG__EM_COMMENT
Definition
const.h:28
LXB_TAG__TEXT
@ LXB_TAG__TEXT
Definition
const.h:26
ext
dom
lexbor
lexbor
html
tree
insertion_mode
after_after_body.c
Generated on Sat Aug 23 2025 01:46:07 for php-internal-docs by
1.13.2