CharacterStyle.applyTo returned early on any empty range, so on an empty
text frame it never reached charStyle.apply, which restyles the stored
runs of empty text. It now passes an empty frame through and keeps the
no-op only for an empty range inside text.
While a script runs a `command.batch`, the session kept the style lists
of every step that changed them, so each such step also made the next
edit copy the whole list. The session now keeps one copy of each open
document's lists, as the last step left them, and records the names of
the styles a step removed or renamed and the documents a step reverted.
The style objects check those names, so a style that a batch removes and
makes again, or renames and names back, is still a different style.
- A style object goes stale when the steps of one `command.batch` remove
its style and add another under the same name, as it does when separate
`vc.run` calls do. The session notes each batch step's style lists while
a script runs, and the style objects check each of them.
- `add(name)` with all 4,096 style slots of the run taken throws before it
adds the style; with one slot left it adds it.
- `typename` of a removed style's `characterAttributes` or
`paragraphAttributes` throws `Stale style`, as its other members do.
- The style load commands refuse `data` over 64 MB without copying it.
- docs/mcp.md states the 64 MB limit for `data` and decoded `dataBase64`;
docs/gaps.md G6 and the docs/roadmap.md M13 row list the script text
and style members.
A style object kept working after file.revert when the file read back held a style with the same name. Each style object now keeps the document's revert count, as text ranges do, and one made before a revert throws Stale style. The range style lists follow the per-paragraph entries of the text model, and the host name table lists the style classes.
A removal or rename whose result cannot reach the script is put back,
and style objects now follow a command only once it is kept. A failed
atomic object-model call puts style objects back with the documents.
document.characterStyles and document.paragraphStyles list a document's
styles, the Normal style first, and add, find and remove them. Each
CharacterStyle and ParagraphStyle has a name, its attributes, applyTo
with clearingOverrides, and remove; setting an attribute redefines the
style through charStyle.setAttrs or paraStyle.setAttrs. A text range's
characterStyles and paragraphStyles list the styles its text is in.
Style names are trimmed and must have 1 to 256 characters and no
control characters, one run names at most 4,096 styles, and a style
object throws Stale style once its style is removed or renamed by a
command. ParagraphStyle.characterAttributes is not available yet.
charStyle.load, paraStyle.load and textStyle.loadAll refuse a file
larger than 64 MB without reading it in full.