Commit 3d7e970d0ad for php.net
commit 3d7e970d0ada5d7d7b9caa00b707db0dc1dc4b30
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Thu Apr 30 00:45:04 2026 +0200
[skip ci] Remove redundant ext/dom/lexbor/patches from PHP-8.5
Those are the result of a bad upmerge. They were moved to ext/lexbor/patches,
and were present twice in this branch.
diff --git a/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch b/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch
deleted file mode 100644
index 32d9d42d2bf..00000000000
--- a/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From 0cd2add6c46400b808329442f81451b369863983 Mon Sep 17 00:00:00 2001
-From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
-Date: Sat, 26 Aug 2023 15:08:59 +0200
-Subject: [PATCH 1/6] Expose line and column information for use in PHP
-
----
- source/lexbor/dom/interfaces/node.h | 2 ++
- source/lexbor/html/token.h | 2 ++
- source/lexbor/html/tokenizer.c | 24 +++++++++++++++++++++++-
- source/lexbor/html/tokenizer.h | 2 ++
- source/lexbor/html/tokenizer/state.h | 2 ++
- source/lexbor/html/tree.c | 11 +++++++++++
- source/lexbor/html/tree/error.c | 5 +++--
- source/lexbor/html/tree/error.h | 5 +++--
- 8 files changed, 48 insertions(+), 5 deletions(-)
-
-diff --git a/source/lexbor/dom/interfaces/node.h b/source/lexbor/dom/interfaces/node.h
-index 6c74ac5..b95373c 100644
---- a/source/lexbor/dom/interfaces/node.h
-+++ b/source/lexbor/dom/interfaces/node.h
-@@ -86,6 +86,8 @@ struct lxb_dom_node {
-
- lxb_dom_node_type_t type;
-
-+ size_t line;
-+
- #ifdef LXB_DOM_NODE_USER_VARIABLES
- LXB_DOM_NODE_USER_VARIABLES
- #endif /* LXB_DOM_NODE_USER_VARIABLES */
-diff --git a/source/lexbor/html/token.h b/source/lexbor/html/token.h
-index 79accd0..0b7f4fd 100644
---- a/source/lexbor/html/token.h
-+++ b/source/lexbor/html/token.h
-@@ -33,6 +33,8 @@ enum lxb_html_token_type {
- typedef struct {
- const lxb_char_t *begin;
- const lxb_char_t *end;
-+ size_t line;
-+ size_t column;
-
- const lxb_char_t *text_start;
- const lxb_char_t *text_end;
-diff --git a/source/lexbor/html/tokenizer.c b/source/lexbor/html/tokenizer.c
-index 22b88ed..1d9f378 100644
---- a/source/lexbor/html/tokenizer.c
-+++ b/source/lexbor/html/tokenizer.c
-@@ -92,6 +92,7 @@ lxb_html_tokenizer_init(lxb_html_tokenizer_t *tkz)
-
- tkz->pos = tkz->start;
- tkz->end = tkz->start + LXB_HTML_TKZ_TEMP_SIZE;
-+ /* current_line & current_column already initialized by calloc (zero-based) */
-
- tkz->tree = NULL;
- tkz->tags = NULL;
-@@ -153,6 +154,8 @@ lxb_html_tokenizer_inherit(lxb_html_tokenizer_t *tkz_to,
- tkz_to->start = tkz_from->start;
- tkz_to->end = tkz_from->end;
- tkz_to->pos = tkz_to->start;
-+ tkz_to->current_line = tkz_from->current_line;
-+ tkz_to->current_column = tkz_from->current_column;
-
- return LXB_STATUS_OK;
- }
-@@ -571,7 +574,26 @@ lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data,
- tkz->last = end;
-
- while (data < end) {
-- data = tkz->state(tkz, data, end);
-+ size_t current_column = tkz->current_column;
-+ const lxb_char_t *new_data = tkz->state(tkz, data, end);
-+ while (data < new_data) {
-+ /* Codepoints < 0x80 are encoded the same as their ASCII counterpart, so '\n' will uniquely identify a newline. */
-+ if (*data == '\n') {
-+ tkz->current_line++;
-+ current_column = 0;
-+ } else {
-+ /* Other characters can be mapped back to the unicode codepoint offset because UTF-8 is a prefix code.
-+ * Continuation bytes start with 0b10XXXXXX so we can skip those to only get the start of an encoded code point. */
-+ if ((*data & 0b11000000) == 0b10000000) {
-+ /* Continuation byte, do nothing */
-+ } else {
-+ /* First byte for a codepoint */
-+ current_column++;
-+ }
-+ }
-+ data++;
-+ }
-+ tkz->current_column = current_column;
- }
-
- return tkz->status;
-diff --git a/source/lexbor/html/tokenizer.h b/source/lexbor/html/tokenizer.h
-index 12b7c81..aa1ac37 100644
---- a/source/lexbor/html/tokenizer.h
-+++ b/source/lexbor/html/tokenizer.h
-@@ -79,6 +79,8 @@ struct lxb_html_tokenizer {
- const lxb_char_t *end;
- const lxb_char_t *begin;
- const lxb_char_t *last;
-+ size_t current_line;
-+ size_t current_column;
-
- /* Entities */
- const lexbor_sbst_entry_static_t *entity;
-diff --git a/source/lexbor/html/tokenizer/state.h b/source/lexbor/html/tokenizer/state.h
-index 5e91444..52eaa9a 100644
---- a/source/lexbor/html/tokenizer/state.h
-+++ b/source/lexbor/html/tokenizer/state.h
-@@ -90,6 +90,8 @@ extern "C" {
- do { \
- tkz->pos = tkz->start; \
- tkz->token->begin = v_begin; \
-+ tkz->token->line = tkz->current_line; \
-+ tkz->token->column = tkz->current_column; \
- } \
- while (0)
-
-diff --git a/source/lexbor/html/tree.c b/source/lexbor/html/tree.c
-index 062ea56..3f4c18d 100644
---- a/source/lexbor/html/tree.c
-+++ b/source/lexbor/html/tree.c
-@@ -431,6 +431,9 @@ lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree,
- return NULL;
- }
-
-+ node->line = token->line;
-+ /* We only expose line number in PHP DOM */
-+
- lxb_status_t status;
- lxb_dom_element_t *element = lxb_dom_interface_element(node);
-
-@@ -767,6 +770,11 @@ lxb_html_tree_insert_character_for_data(lxb_html_tree_t *tree,
-
- lxb_dom_interface_text(text)->char_data.data = *str;
-
-+ if (tree->tkz_ref) {
-+ text->line = tree->tkz_ref->token->line;
-+ /* We only expose line number in PHP DOM */
-+ }
-+
- if (ret_node != NULL) {
- *ret_node = text;
- }
-@@ -806,6 +814,9 @@ lxb_html_tree_insert_comment(lxb_html_tree_t *tree,
- return NULL;
- }
-
-+ node->line = token->line;
-+ /* We only expose line number in PHP DOM */
-+
- tree->status = lxb_html_token_make_text(token, &comment->char_data.data,
- tree->document->dom_document.text);
- if (tree->status != LXB_STATUS_OK) {
-diff --git a/source/lexbor/html/tree/error.c b/source/lexbor/html/tree/error.c
-index ffdc55c..ef36eab 100644
---- a/source/lexbor/html/tree/error.c
-+++ b/source/lexbor/html/tree/error.c
-@@ -22,8 +22,9 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors,
- }
-
- entry->id = id;
-- entry->begin = token->begin;
-- entry->end = token->end;
-+ entry->line = token->line;
-+ entry->column = token->column;
-+ entry->length = token->end - token->begin;
-
- return entry;
- }
-diff --git a/source/lexbor/html/tree/error.h b/source/lexbor/html/tree/error.h
-index 7a212af..b186772 100644
---- a/source/lexbor/html/tree/error.h
-+++ b/source/lexbor/html/tree/error.h
-@@ -109,8 +109,9 @@ lxb_html_tree_error_id_t;
-
- typedef struct {
- lxb_html_tree_error_id_t id;
-- const lxb_char_t *begin;
-- const lxb_char_t *end;
-+ size_t line;
-+ size_t column;
-+ size_t length;
- }
- lxb_html_tree_error_t;
-
---
-2.51.2
-
diff --git a/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch b/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
deleted file mode 100644
index 1902abf96e3..00000000000
--- a/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From a4c29ba8d1ea1065ce6bd4a34382d53140cf1924 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 2/6] 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 4912efb..7b2c620 100644
---- 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 100644
---- 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 100644
---- 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 05fe738..1e09cda 100644
---- a/source/lexbor/html/tree/insertion_mode/before_html.c
-+++ b/source/lexbor/html/tree/insertion_mode/before_html.c
-@@ -78,6 +78,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.51.2
-
diff --git a/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch b/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
deleted file mode 100644
index 51f77483bc6..00000000000
--- a/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 46fc776449252e74795569759a19d13857a59069 Mon Sep 17 00:00:00 2001
-From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
-Date: Thu, 24 Aug 2023 22:57:48 +0200
-Subject: [PATCH 3/6] Patch utilities and data structure to be able to generate
- smaller lookup tables
-
-Changed the generation script to check if everything fits in 32-bits.
-And change the actual field types to 32-bits. This decreases the hash
-tables in size.
----
- source/lexbor/core/shs.h | 4 ++--
- utils/lexbor/encoding/single-byte.py | 4 ++--
- utils/lexbor/lexbor/LXB.py | 12 +++++++++---
- 3 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/source/lexbor/core/shs.h b/source/lexbor/core/shs.h
-index 7a63a07..c84dfaa 100644
---- a/source/lexbor/core/shs.h
-+++ b/source/lexbor/core/shs.h
-@@ -27,9 +27,9 @@ lexbor_shs_entry_t;
-
- typedef struct {
- uint32_t key;
-- void *value;
-+ uint32_t value;
-
-- size_t next;
-+ uint32_t next;
- }
- lexbor_shs_hash_t;
-
-diff --git a/utils/lexbor/encoding/single-byte.py b/utils/lexbor/encoding/single-byte.py
-index d7d1bb2..5420c16 100755
---- a/utils/lexbor/encoding/single-byte.py
-+++ b/utils/lexbor/encoding/single-byte.py
-@@ -128,7 +128,7 @@ class SingleByte:
- entries = values[idx]
- key_id = entries[1].decode('utf-8')
-
-- hash_key.append(key_id, '(void *) {}'.format(idx + 0x80))
-+ hash_key.append(key_id, idx + 0x80)
-
- return hash_key.create(rate = 1)
-
-@@ -161,7 +161,7 @@ def toHex(s):
- lst = []
-
- for ch in bytes(s, 'utf-8'):
-- hv = hex(ch).replace('0x', '\\\\x')
-+ hv = hex(ch).replace('0x', '\\x')
- lst.append("'{}'".format(hv))
-
- return ', '.join(lst)
-diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
-index 3e75812..2370c66 100755
---- a/utils/lexbor/lexbor/LXB.py
-+++ b/utils/lexbor/lexbor/LXB.py
-@@ -94,7 +94,7 @@ class HashKey:
- def append(self, key_id, value):
- self.buffer.append([self.hash_id(int(key_id, 0)), value])
-
-- def create(self, terminate_value = '{0, NULL, 0}', rate = 2, is_const = True, data_before = None):
-+ def create(self, terminate_value = '{0, 0, 0}', rate = 2, is_const = True, data_before = None):
- test = self.test(int(self.max_table_size / 1.2), int(self.max_table_size * 1.2))
-
- rate_dn = rate - 1
-@@ -142,9 +142,12 @@ class HashKey:
- entry = table[idx]
-
- if entry:
-+ assert entry[0] < 2**32
-+ assert entry[1] < 2**32
-+ assert entry[2] < 2**32
- result.append("{{{}, {}, {}}},".format(entry[0], entry[1], entry[2]))
- else:
-- result.append("{0, NULL, 0},")
-+ result.append("{0, 0, 0},")
-
- if int(idx) % rate == rate_dn:
- result.append("\n ")
-@@ -154,9 +157,12 @@ class HashKey:
- if len(table):
- entry = table[-1]
- if entry:
-+ assert entry[0] < 2**32
-+ assert entry[1] < 2**32
-+ assert entry[2] < 2**32
- result.append("{{{}, {}, {}}}\n".format(entry[0], entry[1], entry[2]))
- else:
-- result.append("{0, NULL, 0}\n")
-+ result.append("{0, 0, 0}\n")
-
- result.append("};")
-
---
-2.51.2
-
diff --git a/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch b/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch
deleted file mode 100644
index 6cb6658a164..00000000000
--- a/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From ae9d7254ac129cc3be34de6fd34af27baf3bb396 Mon Sep 17 00:00:00 2001
-From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
-Date: Wed, 29 Nov 2023 21:26:47 +0100
-Subject: [PATCH 4/6] Remove unused upper case tag static data
-
----
- source/lexbor/tag/res.h | 2 ++
- source/lexbor/tag/tag.c | 2 ++
- 2 files changed, 4 insertions(+)
-
-diff --git a/source/lexbor/tag/res.h b/source/lexbor/tag/res.h
-index 604757f..5672d4a 100644
---- a/source/lexbor/tag/res.h
-+++ b/source/lexbor/tag/res.h
-@@ -226,6 +226,7 @@ static const lxb_tag_data_t lxb_tag_res_data_default[LXB_TAG__LAST_ENTRY] =
- {{.u.short_str = "xmp", .length = 3, .next = NULL}, LXB_TAG_XMP, 1, true}
- };
-
-+#if 0
- static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] =
- {
- {{.u.short_str = "#UNDEF", .length = 6, .next = NULL}, LXB_TAG__UNDEF, 1, true},
-@@ -427,6 +428,7 @@ static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY]
- {{.u.short_str = "WBR", .length = 3, .next = NULL}, LXB_TAG_WBR, 1, true},
- {{.u.short_str = "XMP", .length = 3, .next = NULL}, LXB_TAG_XMP, 1, true}
- };
-+#endif
-
- static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[263] =
- {
-diff --git a/source/lexbor/tag/tag.c b/source/lexbor/tag/tag.c
-index 780bc47..be5bb30 100644
---- a/source/lexbor/tag/tag.c
-+++ b/source/lexbor/tag/tag.c
-@@ -92,6 +92,7 @@ lxb_tag_data_by_name(lexbor_hash_t *hash, const lxb_char_t *name, size_t len)
- lexbor_hash_search_lower, name, len);
- }
-
-+#if 0
- const lxb_tag_data_t *
- lxb_tag_data_by_name_upper(lexbor_hash_t *hash,
- const lxb_char_t *name, size_t len)
-@@ -114,6 +115,7 @@ lxb_tag_data_by_name_upper(lexbor_hash_t *hash,
- return (const lxb_tag_data_t *) lexbor_hash_search(hash,
- lexbor_hash_search_upper, name, len);
- }
-+#endif
-
- /*
- * No inline functions for ABI.
---
-2.51.2
-
diff --git a/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch b/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch
deleted file mode 100644
index 9ef6e305e49..00000000000
--- a/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 19cf6183813e013dfe0eb2303c15eaf6e01b9faf Mon Sep 17 00:00:00 2001
-From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
-Date: Wed, 29 Nov 2023 21:29:31 +0100
-Subject: [PATCH 5/6] Shrink size of static binary search tree
-
-This also makes it more efficient on the data cache.
----
- source/lexbor/core/sbst.h | 19 ++++++++++++++-----
- source/lexbor/html/tokenizer/state.c | 2 +-
- utils/lexbor/html/tokenizer_entities_bst.py | 8 ++++----
- utils/lexbor/lexbor/LXB.py | 2 +-
- 4 files changed, 20 insertions(+), 11 deletions(-)
-
-diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h
-index b0fbc54..15a1d40 100644
---- a/source/lexbor/core/sbst.h
-+++ b/source/lexbor/core/sbst.h
-@@ -15,16 +15,25 @@ extern "C" {
-
- #include "lexbor/core/base.h"
-
-+#ifdef __has_attribute
-+# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
-+# define LXB_NONSTRING __attribute__((nonstring))
-+# else
-+# define LXB_NONSTRING
-+# endif
-+#else
-+# define LXB_NONSTRING
-+#endif
-
- typedef struct {
- lxb_char_t key;
-
-- void *value;
-- size_t value_len;
-+ lxb_char_t value[6] LXB_NONSTRING;
-+ unsigned char value_len;
-
-- size_t left;
-- size_t right;
-- size_t next;
-+ unsigned short left;
-+ unsigned short right;
-+ unsigned short next;
- }
- lexbor_sbst_entry_static_t;
-
-diff --git a/source/lexbor/html/tokenizer/state.c b/source/lexbor/html/tokenizer/state.c
-index db362c6..6c3cbeb 100644
---- a/source/lexbor/html/tokenizer/state.c
-+++ b/source/lexbor/html/tokenizer/state.c
-@@ -1825,7 +1825,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz,
- goto done;
- }
-
-- if (entry->value != NULL) {
-+ if (entry->value[0] != 0) {
- tkz->entity_end = (tkz->pos + (data - begin)) - tkz->start;
- tkz->entity_match = entry;
- }
-diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py
-index b34bca1..2bfea81 100755
---- a/utils/lexbor/html/tokenizer_entities_bst.py
-+++ b/utils/lexbor/html/tokenizer_entities_bst.py
-@@ -1,6 +1,6 @@
-
- import json
--import sys, re, os
-+import sys, os
-
- # Find and append run script run dir to module search path
- ABS_PATH = os.path.dirname(os.path.abspath(__file__))
-@@ -62,7 +62,7 @@ def entities_bst_create_layer(name, entry, index):
-
- def entities_bst_create(index):
- bst = {}
-- bst[0] = ["\0", 0, 0, 0, "NULL"]
-+ bst[0] = ["\0", 0, 0, 0, "{0}"]
-
- begin = 1
- idx = end = entities_bst_create_tree(index, bst, begin)
-@@ -114,7 +114,7 @@ def entities_bst_create_tree(index, bst, idx):
- assert len(index[ split[0] ]['values']) < 2, 'Double values'
-
- if len(index[ split[0] ]['values']) == 0:
-- value = "NULL"
-+ value = "{0}"
- else:
- value = '"{}"'.format(toHex(index[ split[0] ]['values'][0]['characters']))
-
-@@ -146,7 +146,7 @@ def toHex(s):
- lst = []
-
- for ch in bytes(s, 'utf-8'):
-- hv = hex(ch).replace('0x', '\\\\x')
-+ hv = hex(ch).replace('0x', '\\x')
- lst.append(hv)
-
- return ''.join(lst)
-diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
-index 2370c66..c41e645 100755
---- a/utils/lexbor/lexbor/LXB.py
-+++ b/utils/lexbor/lexbor/LXB.py
-@@ -27,7 +27,7 @@ class Temp:
-
- for line in fh:
- for name in self.patterns:
-- line = re.sub(name, '\n'.join(self.patterns[name]), line)
-+ line = line.replace(name, '\n'.join(self.patterns[name]))
- self.buffer.append(line)
- fh.close()
-
---
-2.51.2
-
diff --git a/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch b/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch
deleted file mode 100644
index a643f971648..00000000000
--- a/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 54399ee441d922d89c32909e2028f899f6091cd6 Mon Sep 17 00:00:00 2001
-From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
-Date: Sun, 7 Jan 2024 21:59:28 +0100
-Subject: [PATCH 6/6] Patch out unused CSS style code
-
----
- source/lexbor/css/rule.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/source/lexbor/css/rule.h b/source/lexbor/css/rule.h
-index 308dced..d192a01 100644
---- a/source/lexbor/css/rule.h
-+++ b/source/lexbor/css/rule.h
-@@ -361,6 +361,7 @@ lxb_css_rule_ref_dec(lxb_css_rule_t *rule)
- lxb_inline void
- lxb_css_rule_ref_dec_destroy(lxb_css_rule_t *rule)
- {
-+#if 0
- if (rule->ref_count > 0) {
- rule->ref_count--;
- }
-@@ -368,6 +369,7 @@ lxb_css_rule_ref_dec_destroy(lxb_css_rule_t *rule)
- if (rule->ref_count == 0) {
- (void) lxb_css_rule_destroy(rule, true);
- }
-+#endif
- }
-
- lxb_inline void
---
-2.51.2
-