Name Date Size #Lines LOC

..22-Oct-2023-

0001-Expose-line-and-column-information-for-use-in-PHP.patchH A D07-Feb-20246.9 KiB189166

0001-Patch-out-CSS-parser.patchH A D22-Oct-202310.9 KiB350293

0001-Patch-utilities-and-data-structure-to-be-able-to-gen.patchH A D22-Oct-20233.5 KiB10383

0001-Remove-unused-upper-case-tag-static-data.patchH A D03-Dec-20231.9 KiB5446

0001-Shrink-size-of-static-binary-search-tree.patchH A D03-Dec-20233.8 KiB11698

0001-Track-implied-added-nodes-for-options-use-in-PHP.patchH A D22-Oct-20232.8 KiB6857

README.mdH A D29-Nov-20232.2 KiB4032

README.md

1# Lexbor patches
2
3Upon syncing the Lexbor sources, the patches in this directory need to be applied.
4The current Lexbor version is 2.4.0.
5
6## Overview
7
8This contains the following patch files in mailbox format.
9
10* 0001-Expose-line-and-column-information-for-use-in-PHP.patch
11  A PHP specific patch to expose the line and column number to PHP.
12* 0001-Track-implied-added-nodes-for-options-use-in-PHP.patch
13  A PHP specific patch to track implied added nodes for options.
14* 0001-Patch-out-CSS-parser.patch
15  A PHP specific patch to patch out the CSS parser, which is unused and hence this patch reduces the binary size.
16* 0001-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
17  A PHP specific patch to patch utilities and data structure to be able to generate smaller lookup tables.
18  This patch won't be upstreamed because it breaks generality of those data structures, i.e. it only works
19  because we only use it for character encoding.
20* 0001-Remove-unused-upper-case-tag-static-data.patch
21  A PHP specific patch to remove unused upper case tag static data. This shrinks the static data size.
22* 0001-Shrink-size-of-static-binary-search-tree.patch
23  A PHP specific patch to shrink the size of the static binary search tree for entities.
24  This shrinks the static data size and reduces data cache pressure.
25
26  **Note** for this patch the utilities to generate the tables are also patched.
27  Make sure to apply on a fresh Lexbor clone and run (in `lexbor/utils/encoding`): `python3 single-byte.py` and `python3 multi-byte.py` to generate the tables.
28  Also run `python3 tokenizer_entities_bst.py` to generate the static binary search tree for entities.
29
30## How to apply
31
32* cd into `ext/dom/lexbor/lexbor`
33* `git am -3 ../patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch`
34* `git am -3 ../patches/0001-Track-implied-added-nodes-for-options-use-in-PHP.patch`
35* `git am -3 ../patches/0001-Patch-out-CSS-parser.patch`
36* `git am -3 ../patches/0001-Patch-utilities-and-data-structure-to-be-able-to-gen.patch`
37* `git am -3 ../patches/0001-Remove-unused-upper-case-tag-static-data.patch`
38* `git am -3 ../patches/0001-Shrink-size-of-static-binary-search-tree.patch`
39* `git reset HEAD~6` # 6 is the number of commits created by the above commands
40