Follows #6592. Paste now also skips the names that effects in the
document's brush art use when it picks a free name for a pasted SVG
filter. When no free name keeps the filter within the 64 KB limit (a
one-letter name at the limit with every free letter and digit taken),
the paste is refused instead of keeping the name of the document's
filter. Clipboard::import_into and import_text_styles return a Result,
and their callers pass the error on before the document changes.
An exception that a finally block passes on, or one that leaves a
built-in's callback, no longer becomes $.error again over an error thrown
after it; throwing a caught error again still makes it the last one.
$.sleep with more than 0 inside a getter, a conversion or a built-in's
callback now throws whether or not the platform has a clock, so the web
build throws there as the other builds do.
Paste renamed a pasted SVG filter to a name no filter of the document
held, but an effect could still use that name, for example after its
filter was deleted. Defining a filter of that name later changed both
effects. Paste now also skips the names the document's effects use,
read only when a pasted filter needs a new name.
A new name with a tab, line feed or carriage return was written into
the filter's id as is, which XML reads as a space, so the id no longer
matched the effect's name. svg_filter::with_id now writes those
characters as character references, and paste takes a name only when
the filter's id reads back as that name.
`leading: "12abc"` set 12 pt leading and returned success, while `size`
and `tracking` in the same command refused trailing text. `leading` now
reads its value with `length_given`, so a string must be a whole number
or a length with a unit. The error message is unchanged.
The compiler now keeps a function declaration's name with its code, so
$.stack no longer shows [anonymous] for a declared function that is
called after the function that declared it has returned. The member test
expects "Web" for $.os in the wasm build, as the engine gives there.
The side limit compared the region's height in points times the scale
with 32,768. Far from the origin the snapped region can come back a
fraction of a pixel over, so art that the renderer draws at exactly
32,768 pixels was refused (a rectangle at y = 100,000 rasterized at
400 ppi). The check now uses the renderer's own rounded pixel width and
height.
Saving a legacy .ai of version 7 flattens each transparent image at its own
resolution, limited only by total pixels. The renderer draws at most 32,768
pixels a side, so an image that came out longer than that at its resolution
was cut off and placed as if whole: the part past that length showed the art
under it without the image. The resolution is now lowered until the longest
side fits.
Print as Bitmap limited each page's image to 65,535 pixels a side, but the
renderer draws at most 32,768. A 9000 x 100 pt artboard at a 300 ppi raster
effects resolution printed as an image that stopped at 7,864 pt and was
placed as if whole. The resolution is now lowered until the longest side
fits.
A getter, a conversion, a callback of a built-in function or a file
$.evalFile runs is executed on native frames, so the run cannot stop at a
$.sleep there. Such a call used to only mark the run to pause, so the
code after it ran first and the wait came later. $.sleep with more than 0
milliseconds now throws an Error there, as alert, confirm and prompt do.
toSource checked the 16,777,216-unit length limit only after a whole
string was written. A long string of characters that are escaped could
reach the heap limit first, which ends the run instead of throwing a
RangeError. The limit is now checked before each part is added.
A failure $.evalFile raised for a file it could not run was placed by
matching the uncaught error's message against the last such failure. A
script that caught the failure and threw it again later, or threw a new
error whose message held its text, was reported at the failed file's line
instead of the second throw.
The failure now carries a mark (HostError::Marked) with the exception.
A catch clause drops the mark, a throw raises the value without one, and
a finally block that ends normally throws it on with its mark, nested
finally blocks included. Realm::error_mark gives the mark of the error a
run ended with, and the engine looks up the file, line and column by it.
Pasted art whose SVG filter is renamed to a free name ("Soft 2") had
the new name written into the filter's id. For a filter at the 64 KB
limit the longer id made it too long to draw, so the pasted art lost
the effect. Paste now takes the first free name under which the filter
still fits: a shorter start of its name ("Sof"), else a free letter or
digit. The filter's id is always the effect's name.
Threaded type read from a file was flowed through its frames before
the document's composite fonts were registered, so a story set in one
was measured in the fallback font. Frames then held the wrong share of
the story after opening, until a frame was edited. load_with now lends
the document's composite fonts while it lays out its threads.
Object > Rasterize and the redrawn path of Crop Image allowed images up to
65,535 pixels a side, but the renderer draws at most 32,768. A 100 x 5569 pt
rectangle rasterized at 600 ppi came back 32,768 pixels tall, and the bottom
29% of the art was gone. Such an image is now refused like one over the
64 megapixel limit, and the art stays as it was.
A centered label such as Q||1 has no baseline for its empty middle
line, so a label that keeps more leading was not moved back to its
place. The graph now centers a label whose first and last lines hold
characters, whatever the lines between them hold.
The tool-edit sweep sent `{"<key>": "on"}` for every documented key, so
`prefs.export` wrote a preferences file named `on` into crates/engine on
every run, and `folder`, `destinationFolder` and `diffPath` strings from
`junk_params` named locations under the working directory.
- `is_path_key` covers `path`, `diffPath`, `folder` and
`destinationFolder`; `safe_value` sends a temp file for a file key and
a temp folder for a folder key, and both sweeps use it.
- A new test builds both sweeps' cases for every command and fails when
a string under one of those keys is outside the temp folder, without
running any command.