mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Update Lexbor (#14735)
Until commit aaa722f9a44a486f361e4266ff322afcf7d6421a This pulls in some upstream fixes, including some of mine.
This commit is contained in:
parent
c97885b3cc
commit
445c1c920b
7 changed files with 11 additions and 33 deletions
|
@ -42,7 +42,6 @@ lxb_css_log_init(lxb_css_log_t *log, lexbor_mraw_t *mraw)
|
|||
status = lexbor_array_obj_init(&log->messages, 64,
|
||||
sizeof(lxb_css_log_message_t));
|
||||
if (status != LXB_STATUS_OK) {
|
||||
memset(&log->mraw, 0, sizeof(lexbor_mraw_t));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,6 @@ lxb_css_syntax_ident_serialize(const lxb_char_t *data, size_t length,
|
|||
|
||||
static const lexbor_str_t str_s = lexbor_str("\\");
|
||||
|
||||
p = data;
|
||||
end = data + length;
|
||||
hex_map = lexbor_str_res_char_to_two_hex_value_lowercase;
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ lxb_css_syntax_tokenizer_cache_expand(lxb_css_syntax_tokenizer_cache_t *cache,
|
|||
new_size = cache->length + up_to;
|
||||
list = lexbor_realloc(cache->list,
|
||||
sizeof(lxb_css_syntax_token_t *) * new_size);
|
||||
if (cache == NULL) {
|
||||
if (list == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,22 +398,16 @@ lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree,
|
|||
lxb_html_tree_insertion_position_t ipos;
|
||||
|
||||
pos = lxb_html_tree_appropriate_place_inserting_node(tree, NULL, &ipos);
|
||||
|
||||
if (ipos == LXB_HTML_TREE_INSERTION_POSITION_CHILD) {
|
||||
element = lxb_html_tree_create_element_for_token(tree, token, ns, pos);
|
||||
}
|
||||
else {
|
||||
element = lxb_html_tree_create_element_for_token(tree, token, ns,
|
||||
pos->parent);
|
||||
if (pos == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
element = lxb_html_tree_create_element_for_token(tree, token, ns);
|
||||
if (element == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pos != NULL) {
|
||||
lxb_html_tree_insert_node(pos, lxb_dom_interface_node(element), ipos);
|
||||
}
|
||||
|
||||
status = lxb_html_tree_open_elements_push(tree,
|
||||
lxb_dom_interface_node(element));
|
||||
|
@ -426,8 +420,7 @@ lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree,
|
|||
|
||||
lxb_html_element_t *
|
||||
lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree,
|
||||
lxb_html_token_t *token, lxb_ns_id_t ns,
|
||||
lxb_dom_node_t *parent)
|
||||
lxb_html_token_t *token, lxb_ns_id_t ns)
|
||||
{
|
||||
lxb_dom_node_t *node = lxb_html_tree_create_node(tree, token->tag_id, ns);
|
||||
if (node == NULL) {
|
||||
|
@ -1560,8 +1553,7 @@ lxb_html_tree_adoption_agency_algorithm(lxb_html_tree_t *tree,
|
|||
fake_token.base_element = node;
|
||||
|
||||
element = lxb_html_tree_create_element_for_token(tree, &fake_token,
|
||||
LXB_NS_HTML,
|
||||
common_ancestor);
|
||||
LXB_NS_HTML);
|
||||
if (element == NULL) {
|
||||
*status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
||||
|
||||
|
@ -1615,8 +1607,7 @@ lxb_html_tree_adoption_agency_algorithm(lxb_html_tree_t *tree,
|
|||
fake_token.base_element = formatting_element;
|
||||
|
||||
element = lxb_html_tree_create_element_for_token(tree, &fake_token,
|
||||
LXB_NS_HTML,
|
||||
furthest_block);
|
||||
LXB_NS_HTML);
|
||||
if (element == NULL) {
|
||||
*status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
||||
|
||||
|
|
|
@ -118,8 +118,7 @@ lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree,
|
|||
|
||||
LXB_API lxb_html_element_t *
|
||||
lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree,
|
||||
lxb_html_token_t *token, lxb_ns_id_t ns,
|
||||
lxb_dom_node_t *parent);
|
||||
lxb_html_token_t *token, lxb_ns_id_t ns);
|
||||
|
||||
LXB_API lxb_status_t
|
||||
lxb_html_tree_append_attributes(lxb_html_tree_t *tree,
|
||||
|
|
|
@ -63,8 +63,7 @@ lxb_html_tree_insertion_mode_before_html_open(lxb_html_tree_t *tree,
|
|||
lxb_html_element_t *element;
|
||||
|
||||
element = lxb_html_tree_create_element_for_token(tree, token,
|
||||
LXB_NS_HTML,
|
||||
&tree->document->dom_document.node);
|
||||
LXB_NS_HTML);
|
||||
if (element == NULL) {
|
||||
tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
||||
|
||||
|
|
|
@ -252,16 +252,7 @@ lxb_html_tree_insertion_mode_in_head_script(lxb_html_tree_t *tree,
|
|||
return lxb_html_tree_process_abort(tree);
|
||||
}
|
||||
|
||||
if (ipos == LXB_HTML_TREE_INSERTION_POSITION_CHILD) {
|
||||
element = lxb_html_tree_create_element_for_token(tree, token,
|
||||
LXB_NS_HTML, ap_node);
|
||||
}
|
||||
else {
|
||||
element = lxb_html_tree_create_element_for_token(tree, token,
|
||||
LXB_NS_HTML,
|
||||
ap_node->parent);
|
||||
}
|
||||
|
||||
element = lxb_html_tree_create_element_for_token(tree, token, LXB_NS_HTML);
|
||||
if (element == NULL) {
|
||||
tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue