|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Status: Historical — implemented, then partially superseded by removal of the editor sandbox Author: Claude Opus 4.8 Created: 2026-05-29
Done (2026-05-29): Phases 0–4 landed. Repo-wide line coverage 81.47% → 85.63% (full coverage.sh run) — the 85% goal is met. Per-file: SandboxCodecs.cc 50→95%, RenderCoordinator.cc 19→69%, TextEditorCore.cc 62→80%, XMLDocument.cc 74→80%, TextEditor.cc 57→69%. The coverage push also surfaced and fixed three real bugs (two TextEditor crashes + the EncodeColor CurrentColor semantics). See Results.
Note: the editor sandbox prototype and SandboxCodecs.cc were later removed.
Local tools/coverage.sh measures 81.5% line coverage on main (43,698 / 53,640 lines; 9,942 uncovered). The 2026-03 plan (0007) closed the ECS-system and parser gaps it targeted — those files are now 90%+. The remaining gap has migrated almost entirely into donner/editor/, which holds 6,223 of 9,942 uncovered lines (63%) at 68% coverage, while the core libraries are strong: svg 90%, base 87%, css 91%.
This plan closes the biggest winnable gaps — plain-logic files with no or thin tests — and explicitly defers the ImGui-coupled UI widgets (which need a headless UI harness) to a separate, lower-ROI workstream. Phases 0–3 reach ~85% without touching ImGui code.
Phases 1–3 are independent (distinct files, mostly distinct BUILD targets) and are being executed in parallel.
Measured by full tools/coverage.sh --no-html //donner/... before/after.
| Metric | Before | After |
|---|---|---|
| Repo-wide line coverage | 81.47% | 85.63% |
| editor/sandbox/SandboxCodecs.cc | 50% | 95% |
| editor/RenderCoordinator.cc | 19% | 69% |
| editor/TextEditorCore.cc | 62% | 80% |
| base/xml/XMLDocument.cc | 74% | 80% |
| editor/TextEditor.cc | 57% | 69% |
The 85% goal is met (85.63%). TextEditor.cc (69%, ~966 lines uncovered) still has headroom — the residual is deep ImGui render/layout paths that need a real GPU/font backend rather than the headless harness; tracked as a future stretch, not required to hold ≥85%.
Coverage is measured by tools/coverage.sh (bazel coverage --config=latest_llvm) → filter_coverage.py → LCOV filtered_report.dat. Ranking is by absolute uncovered lines (LF−LH), which is what moves the denominator, matching how 0007 framed it.
| File | Uncov | % | Test? | ImGui? | Verdict |
|---|---|---|---|---|---|
| editor/TextEditor.cc | 1364 | 57% | yes | yes | Phase 4 |
| editor/sandbox/SandboxCodecs.cc | 775 | 50% | partial | no | Phase 1 |
| editor/TextEditorCore.cc | 654 | 62% | yes | yes | Phase 4 |
| base/xml/XMLDocument.cc | 442 | 74% | none | no | Phase 2 |
| editor/RenderCoordinator.cc | 314 | 19% | none | no | Phase 2 |
| svg/tool/DonnerSvgTool.cc | 311 | 18% | — | — | exclude (CLI) |
| svg/renderer/tests/ImageComparisonTestFixture.cc | 295 | — | — | — | Phase 0 (test infra) |
| editor/SidebarPresenter.cc | 245 | 31% | — | yes | Phase 4 |
| base/Path.cc | 209 | 88% | yes | no | Phase 3 (edge cases) |
| editor/DocumentSyncController.cc | 146 | 62% | yes | no | Phase 3 |
Uncovered lines by category: LOGIC 6,879 · SANDBOX 1,105 · GUI/ImGui 843 · TEST-INFRA 558 · CLI/TOOL 557.
No production architecture changes. Test additions mirror existing patterns: round-trip property tests for codecs (WireFormat_tests.cc), EditorBackendCore harness for editor-coordinator logic, and gmock matchers per the repo's diagnosability rules.
Phase 1 hardens a trust boundary: SandboxCodecs decodes wire data from a sandboxed renderer process. Malformed/truncated-input Decode* tests are a security win, not just a coverage win — they assert the decoders fail safely rather than over-read.