This reverts commit bada8e1710. #7638 merged with its gate failing: besides six unformatted
files, render and trace don't compile against craft-libs e2dc681 (u64::from(usize) in
render/src/paint.rs, a private craft-libs function, and a call with one argument too many in
trace/src/opaque.rs), so main's CI fails. The tree is that of 0adbdce6cb, whose CI passed.
With automation read roots in force, an SVG or SVGZ that would name a
linked image's file outside them is refused before any file, folder or
reply is written, with "a linked image file is outside the read roots",
which names no file or folder. An <image> names the file with
images: link, and with embed when the document holds no pixels for the
image. With preserveEditing, the native document the SVG carries names
every linked image and placed file, the relative paths kept of them and
each data set's image, so those are checked too, and a stored brush
entry that does not read as a brush is refused because its links cannot
be checked.
- The check runs where the linked JavaScript check runs:
document.serialize, document.export, document.exportSelection,
document.exportForScreens and assets.export, every SVG and SVGZ save,
file.exportAs and the SVG Options dialog's Show Code. It also covers
clipboard.exportSvg, and a Copy that an automation request asks for
puts no SVG on the system clipboard when it would name such a file.
- Only the art each file writes is checked: the selected objects with
selectedOnly and Export Selection, the art over each chosen artboard,
hidden layers and objects only when hiddenLayers is on (a save keeps
them by default), never template layers or the symbol or opacity-mask
editing layer, and the symbols, patterns and brushes that art uses.
An image colorized with a solid fill whose pixels are gray or missing
names no file, so it is not checked outside Preserve Editing.
- Embedded pixels, a file inside the roots, a relative path that leads
inside them and a URL are written as before, and the person at the
keyboard exports every link as stored.
Docs: docs/mcp.md, docs/target-app-parity.md and the params text; de
and nl rows for the new message, next to the JavaScript message's rows.
A trace handed in for imageTrace.make or imageTrace.makeAndExpand was
matched by its object, image, pixels and settings alone, so a trace made
in one document could stand in for the command in another open document
with the same image and settings. The trace's inputs now carry the
document's uid: TraceRun::current is false in any other document, and the
commands there drop the trace handed in and trace their own image, as one
undo step.
Test: a_trace_run_applies_only_in_its_own_document.
Document::symbol_art_bounds measured a symbol's art without the
document, so an instance of another symbol in that art counted as the
20 x 20 square. It now measures the art through SymbolBoxes, so a nested
instance takes its own symbol's art, and an inline graphic of the outer
symbol is sized by it and follows it when that symbol changes.
- The inline resolve order also follows the instances that size a
symbol's art, so a symbol is measured after the type in the art of
the symbols it holds is laid out again.
- A symbol whose art reaches itself through an instance and an inline
graphic is an empty slot. Only instances that the measurement uses
count, so one a clipping path hides adds no dependency.
- A missing symbol, a symbol without art, a symbol that holds an
instance of itself, and nesting 32 deep still measure as the square.
- SymbolBoxes finds symbols through a name index built once, and the
inline resolve pass and inline_art_bounds share one index, instead
of scanning the symbol list for each lookup.