Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
* PHP-8.4:
  Cherry-pick lexbor/lexbor@f94d97a3
  • Loading branch information
nielsdos committed Jan 19, 2025
2 parents 8c11382 + 22704af commit 675f359
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,37 @@ lxb_html_tree_insertion_mode_in_select_optgroup(lxb_html_tree_t *tree,
return true;
}

lxb_inline bool
lxb_html_tree_insertion_mode_in_select_hr(lxb_html_tree_t *tree,
lxb_html_token_t *token)
{
lxb_html_element_t *element;
lxb_dom_node_t *node = lxb_html_tree_current_node(tree);

if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) {
lxb_html_tree_open_elements_pop(tree);
}

node = lxb_html_tree_current_node(tree);

if (lxb_html_tree_node_is(node, LXB_TAG_OPTGROUP)) {
lxb_html_tree_open_elements_pop(tree);
}

element = lxb_html_tree_insert_html_element(tree, token);
if (element == NULL) {
tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;

return lxb_html_tree_process_abort(tree);
}

lxb_html_tree_open_elements_pop(tree);

lxb_html_tree_acknowledge_token_self_closing(tree, token);

return true;
}

lxb_inline bool
lxb_html_tree_insertion_mode_in_select_optgroup_closed(lxb_html_tree_t *tree,
lxb_html_token_t *token)
Expand Down Expand Up @@ -319,6 +350,9 @@ lxb_html_tree_insertion_mode_in_select(lxb_html_tree_t *tree,
case LXB_TAG_OPTGROUP:
return lxb_html_tree_insertion_mode_in_select_optgroup(tree, token);

case LXB_TAG_HR:
return lxb_html_tree_insertion_mode_in_select_hr(tree, token);

case LXB_TAG_SELECT:
return lxb_html_tree_insertion_mode_in_select_select(tree, token);

Expand Down

0 comments on commit 675f359

Please sign in to comment.