mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
The prepass decided what to look for in the tree by a dozen substring searches over the whole SVG text (`:not(`, the event attributes, `script`, `transform:` and nine more), and a separate pass counted the elements' depth before roxmltree. With an embedded picture the text is mostly its data URL: a 1.35 MB card SVG (a 968 KB PNG) paid about 7 ms of searches and 1 ms of depth scan per import, on a 64 ms render, and a 54-page PDF export 54 times that. `depth::prescan` is the one pass: it counts the depth as `xml_too_deep` did (the DOCTYPE entity count included) and, in the same walk, notes every `data:` attribute value, answering the text with those values left out, their quotes kept. The prepass and `fx::blends` search that text; the edits are still made in the source. A data URL can hold no tag, attribute name, selector or CSS declaration, and everything else, a `style="display:none"` included, is kept, so what is found is what was found before. `vectorcraft-cli perf --deep` gains a tracked row, "import SVG, one embedded PNG", beside the export row it had. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>