Files
Karl Seguin 7a0be11d40 Experiment with collapsing whitespace
This might break things, and in the scale of things, probably doesn't save
enough memory, BUT...if you look at the most common text nones on a page,
you'll likely see hundreds or thousands of nodes containing just space and
newline. On an Amazon product page, for example, there are 80 text nodes
containing just a newline + 80 spaces. In fact, there are over 4000 text nodes
containing just whitespace.

Ideally, we could simply ignore them and not even generate the Node. But that's
likely to break some JavaScript (e.g. it would mess up the child count, the
firstChild, etc...). So this simply attempts to collapse the leading and
trailing whitespace (it doesn't trim them, it merely replaces \s+ with " ").

This could _still_ break some JavaScript, but seems safer. The real win is here
is that " " gets interned, so doesn't require an dupe/allocation.
2026-01-22 15:00:32 +08:00
..
2026-01-19 07:36:46 +08:00
2026-01-20 16:23:22 +08:00
2026-01-19 09:12:16 +08:00
2026-01-19 07:28:56 +08:00
2026-01-19 07:36:46 +08:00