Name Date Size #Lines LOC

..22-Oct-2023-

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

0002-Track-implied-added-nodes-for-options-use-in-PHP.patchH A D29-Jun-20242.8 KiB6857

0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patchH A D29-Jun-20243.5 KiB10383

0004-Remove-unused-upper-case-tag-static-data.patchH A D29-Jun-20241.9 KiB5446

0005-Shrink-size-of-static-binary-search-tree.patchH A D29-Jun-20243.8 KiB11698

0006-Patch-out-unused-CSS-style-code.patchH A D29-Jun-202414.4 KiB446378

README.mdH A D29-Jun-20242.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* 0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
13  A PHP specific patch to track implied added nodes for options.
14* 0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
15  A PHP specific patch to patch utilities and data structure to be able to generate smaller lookup tables.
16  This patch won't be upstreamed because it breaks generality of those data structures, i.e. it only works
17  because we only use it for character encoding.
18* 0004-Remove-unused-upper-case-tag-static-data.patch
19  A PHP specific patch to remove unused upper case tag static data. This shrinks the static data size.
20* 0005-Shrink-size-of-static-binary-search-tree.patch
21  A PHP specific patch to shrink the size of the static binary search tree for entities.
22  This shrinks the static data size and reduces data cache pressure.
23* 0006-Patch-out-unused-CSS-style-code.patch
24  A PHP specific patch to remove CSS style and selector bindings from the Lexbor document.
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/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch`
35* `git am -3 ../patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch`
36* `git am -3 ../patches/0004-Remove-unused-upper-case-tag-static-data.patch`
37* `git am -3 ../patches/0005-Shrink-size-of-static-binary-search-tree.patch`
38* `git am -3 ../patches/0006-Patch-out-unused-CSS-style-code.patch`
39* `git reset HEAD~6` # 6 is the number of commits created by the above commands
40