Skip to content

Commit 0bed3d5

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: NEWS for GH-17485 Cherry-pick lexbor/lexbor@e58e1e8c Cherry-pick lexbor/lexbor@ae97abfb Cherry-pick lexbor/lexbor@e39083b0
2 parents 5471f11 + 0b04061 commit 0bed3d5

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

ext/dom/lexbor/lexbor/html/tag.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ lxb_html_tag_is_void(lxb_tag_id_t tag_id)
8282
case LXB_TAG_INPUT:
8383
case LXB_TAG_LINK:
8484
case LXB_TAG_META:
85-
case LXB_TAG_PARAM:
8685
case LXB_TAG_SOURCE:
8786
case LXB_TAG_TRACK:
8887
case LXB_TAG_WBR:

ext/dom/lexbor/lexbor/html/tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ lxb_html_tree_acknowledge_token_self_closing(lxb_html_tree_t *tree,
333333

334334
bool is_void = lxb_html_tag_is_void(token->tag_id);
335335

336-
if (is_void) {
336+
if (!is_void) {
337337
lxb_html_tree_parse_error(tree, token,
338338
LXB_HTML_RULES_ERROR_NOVOHTELSTTAWITRSO);
339339
}

ext/dom/lexbor/lexbor/html/tree/insertion_mode/foreign_content.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,10 @@ lxb_html_tree_insertion_mode_foreign_content_anything_else(lxb_html_tree_t *tree
113113
node = lxb_html_tree_current_node(tree);
114114

115115
if (token->tag_id == LXB_TAG_SCRIPT && node->ns == LXB_NS_SVG) {
116-
lxb_html_tree_acknowledge_token_self_closing(tree, token);
117116
return lxb_html_tree_insertion_mode_foreign_content_script_closed(tree, token);
118117
}
119118
else {
120119
lxb_html_tree_open_elements_pop(tree);
121-
lxb_html_tree_acknowledge_token_self_closing(tree, token);
122120
}
123121

124122
return true;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
GH-17485 (Self-closing tag on void elements shouldn't be a parse error/warning in \Dom\HTMLDocument)
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
$Data = "<!DOCTYPE HTML>\n<br />\n<input />";
8+
$Document = \Dom\HTMLDocument::createFromString( $Data );
9+
echo $Document->saveHTML();
10+
?>
11+
--EXPECT--
12+
<!DOCTYPE html><html><head></head><body><br>
13+
<input></body></html>

0 commit comments

Comments
 (0)