php-src/ext/dom/lexbor/patches/0001-Track-implied-added-nodes-for-options-use-in-PHP.patch
Niels Dossche f093409052
[RFC] DOM HTML5 parsing and serialization support (Lexbor library part) (#12493)
* Update meta files

* Add (patched) Lexbor v2.4.0

* Add (already-applied) Lexbor patches

* Add linguist-vendored flag for Lexbor
2023-10-22 17:26:21 +02:00

67 lines
2.8 KiB
Diff

From 7f04b3dc1501458e7f5cd0d6e6cd05db524ae6ae Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Mon, 14 Aug 2023 20:18:51 +0200
Subject: [PATCH] Track implied added nodes for options use in PHP
---
source/lexbor/html/tree.h | 3 +++
source/lexbor/html/tree/insertion_mode/after_head.c | 1 +
source/lexbor/html/tree/insertion_mode/before_head.c | 2 ++
source/lexbor/html/tree/insertion_mode/before_html.c | 2 ++
4 files changed, 8 insertions(+)
diff --git a/source/lexbor/html/tree.h b/source/lexbor/html/tree.h
index 2a43f8b..d964f01 100755
--- a/source/lexbor/html/tree.h
+++ b/source/lexbor/html/tree.h
@@ -55,6 +55,9 @@ struct lxb_html_tree {
bool foster_parenting;
bool frameset_ok;
bool scripting;
+ bool has_explicit_html_tag;
+ bool has_explicit_head_tag;
+ bool has_explicit_body_tag;
lxb_html_tree_insertion_mode_f mode;
lxb_html_tree_insertion_mode_f original_mode;
diff --git a/source/lexbor/html/tree/insertion_mode/after_head.c b/source/lexbor/html/tree/insertion_mode/after_head.c
index ad551b5..1448654 100755
--- a/source/lexbor/html/tree/insertion_mode/after_head.c
+++ b/source/lexbor/html/tree/insertion_mode/after_head.c
@@ -71,6 +71,7 @@ lxb_html_tree_insertion_mode_after_head_open(lxb_html_tree_t *tree,
return lxb_html_tree_process_abort(tree);
}
+ tree->has_explicit_body_tag = true;
tree->frameset_ok = false;
tree->mode = lxb_html_tree_insertion_mode_in_body;
diff --git a/source/lexbor/html/tree/insertion_mode/before_head.c b/source/lexbor/html/tree/insertion_mode/before_head.c
index 14621f2..cd2ac2a 100755
--- a/source/lexbor/html/tree/insertion_mode/before_head.c
+++ b/source/lexbor/html/tree/insertion_mode/before_head.c
@@ -67,6 +67,8 @@ lxb_html_tree_insertion_mode_before_head_open(lxb_html_tree_t *tree,
return lxb_html_tree_process_abort(tree);
}
+ tree->has_explicit_head_tag = true;
+
tree->mode = lxb_html_tree_insertion_mode_in_head;
break;
diff --git a/source/lexbor/html/tree/insertion_mode/before_html.c b/source/lexbor/html/tree/insertion_mode/before_html.c
index ed5e367..b078ac5 100755
--- a/source/lexbor/html/tree/insertion_mode/before_html.c
+++ b/source/lexbor/html/tree/insertion_mode/before_html.c
@@ -79,6 +79,8 @@ lxb_html_tree_insertion_mode_before_html_open(lxb_html_tree_t *tree,
return lxb_html_tree_process_abort(tree);
}
+ tree->has_explicit_html_tag = true;
+
tree->mode = lxb_html_tree_insertion_mode_before_head;
break;
--
2.41.0