with_profiles on main returns the TempDir root as a third value, so the
three new listing tests did not compile after the merge. They now keep
their outside files under that root, which removes them on drop.
file.newProfiles and Manage Profiles checked a profile's file with
is_file, which follows a link. A profile file that was a link to a
document was listed as customized with Edit on, while file.new refuses
to read a link and gives the new document the defaults. A link that
led nowhere, or a folder, was listed as not customized, so Reset was
off and could not remove it, and Edit on a link that led nowhere wrote
the shipped profile where the link pointed.
The profile's file is now looked at without following a link:
- file.newProfiles lists a link or a folder as customized, with
unusable: "not a plain file".
- Manage Profiles dims that profile's name, says why in its tooltip,
and turns Edit off. Reset stays on for a link and removes the link,
not the file it leads to. Reset is off for a folder, and
file.newProfiles.reset gives an error instead of deleting a folder.
- file.newProfiles.edit gives an error for a link or a folder, and
creates a missing profile file without following a link put there.
Docs: docs/mcp.md (New Document profiles) and the command help.
The Array.prototype methods that skip missing elements, such as forEach
and map, read each index of a host collection with one indexer call
that has `true` as a third argument and use its answer as the element.
The docs of the module, HostClass::index and host_index now say that
such a call gives the element itself, or undefined when there is none,
and that reads without the third argument, such as those of join, are
ordinary reads.
- The grid-by-column test now checks each artboard's row and column, so
RLGridByCol must fill from the rightmost column. It compared only the
number of distinct rows and columns before, which a left-to-right fill
also passes.
- The keepEmpty test asserts that keepEmpty false deletes the compound
path, instead of accepting any state other than an empty compound.
- The addDocument profile test closes the profile document before the
script reads the profile, so the read goes through the app-folder
exemption and not through the rule for open documents' files.
- The report-origin test adds authored ReferenceError controls for
Window and activeDocument, and for BridgeTalk thrown as an error
object, so a hint list that grows to those names cannot change a
message the script wrote.
- New Document profile tests, and the temporary folders and files in
script_dom.rs and script_run.rs, use vectorcraft_testkit::TempDir, so
a failing assertion no longer leaves process-id folders behind. The
linked-profile test keeps its link target in the same temporary
folder.
resting_preset_cards_stand_on_a_tile took the first unselected list item
in the frame's access tree. That tree also holds the Home screen's
document cards behind the dialog, which lie flat by design, and the
update lists nodes in hash-map order, which changes from process to
process. When a Home card came first the test failed, so it failed on
some runs of the full workspace and passed alone.
The test now walks the dialog node's subtree and checks every unselected
card in it, so the result no longer depends on node order.
app.getIsFileOpen treated any path with a backslash as a Windows path,
turning each backslash into a folder separator and ignoring letter case.
On macOS and Linux a backslash is a character of a file name, so
getIsFileOpen answered true for the path /work/a\b.ai while /work/a/b.ai
was open.
Paths now get the Windows rules only on Windows or when they start with a
drive letter.
DocumentPreset.typename and toString() answered for a preset kept from
an earlier run with #targetengine, while its settings throw a TypeError.
Both now check the preset the way the settings do.
Documents.addDocumentNoUI(startupPreset) was missing. It now makes the
document addDocument(startupPreset) makes.
Array.prototype methods called on a host collection with more than 4,096
elements, such as forEach over a document's page items, visited only the
indices held as properties. A host collection keeps its elements in the
host, so those methods skipped every element. They now visit every
index of an object whose class has an indexer.
Each element read also called the indexer twice, once to test presence
and once to read the value. The methods now read an index of such an
object with one call, the one `k in object` makes, and take its answer as
the element.
- app.documents.add: artboardRowsOrCols sets the rows of GridByCol and
RLGridByCol and the columns of GridByRow and RLGridByRow; Row, RLRow
and Column do not use it.
- PageItem.duplicate runs node.move on the copy only with a relative
object, and move and duplicate skip node.move when the object is
already in place.
- edit.clear takes null for guides, keepEmpty and keepJoined as the key
left out, as switch_or reads them.
- The scripts entry in docs/target-app-parity.md no longer lists type
as missing; document.textFrames ships.
The Step and Repeat dialog now acts only on the document it was opened
on. Its preview no longer runs on another document, and OK is refused
there, or after File > Revert, with the reason shown. Opening the dialog
again rolls back the earlier dialog's preview instead of leaving its
copies on the canvas.
object.stepAndRepeat makes every copy first and inserts them in one
pass, so a large grid walks the document a fixed number of times
instead of once per copy. The stacking order of the copies is
unchanged. A negative margin, and a gap of minus the width or height
or less, are refused instead of being clamped or folding the grid back
on itself.
An inline image has no object of its own, and the interpreter keys an image
by its dictionary alone, so every inline image of one size and encoding got
the key of the first one and was imported with its pixels: Type 3 glyphs drawn
as inline stencil images came in as the wrong letters. An inline raster image
is now keyed by its samples too, and a stencil image by its decoded pixels.
Fixes#9247
* SVG import: refuse an SVG the memory can't hold instead of running out
The element limit now follows the installed memory, or the process's
cgroup limit where that is lower: about 8 KB an element, up to the
999,999 elements usvg reads. Past it the SVG is refused with an error
naming the memory, before usvg makes its tree.
Fixes#10165
* Tests: the shared element limit test follows the machine's limit
Moves craft-libs to a5669ed2f, which places overlays in the room of the
monitor the window is on (craft-libs f31beb26d, merged in #4506). The
old room assumed monitors tile the desktop by their size, so on a
landscape monitor to the right of a portrait one the File menu opened
at (726, 442), far from its title, with scroll arrows.
The new pin is craft-libs main just before #4278, whose dialog changes
need VectorCraft test updates that come with a later pin bump.
The new test menu_on_second_monitor opens the File menu with the window
on the landscape monitor at 1x and 1.5x; it fails on the old pin with
the menu at (726, 442).
docs/mcp.md said every group counts as the objects inside it toward the 2,000-object limit. The command expands only groups other than clipping groups (bridge.rs, the clip: false arm), so a clipping group counts as one object, which is not a circle.
When outlines replace circles that sit in different groups, the circles
that go left their groups behind with nothing in them. Each group or
compound path left empty now goes in the same undo step, and so does
each group above it left empty in turn; layers and sublayers stay.