1531263bd2
A writer with a tall panel does not want to shrink it from the left edge: what
they know is "this one is too tall". The format had a width and nothing else, so
the only way to make a figure shorter was to guess a percentage and check the
page — and the previous commit's answer, "type 638px", asked them to do the
arithmetic themselves.
So `{height=300px}` joins `{width=…}`, in the same attribute block, and the
editor grows a second box beside the first. Both are typeable as well as
pre-set, both write through the reader's own parse function, and the hint beside
them says what the picture will measure on the page.
Three rules, and the point of all three is that a figure cannot be stretched:
* **a width is exact, a height is a cap.** A width has a reference — the column,
or a length the writer chose — while nothing measures a height against
anything, and enlarging a picture past its own pixels only makes it soft. In
the flow of a sentence a height is always a downscale, which comes to the same
thing as exact.
* **given one, the other follows from the picture's own shape** — `max-height`
for a height, `width` for a width — so the height is never written by hand.
* **given both, they are a box to fit inside**, not a box to fill. Two numbers
that need not have the picture's proportions can only mean "no bigger than",
and the check asserts the drawn rectangle still matches the file's ratio.
Whichever box is left empty keeps the other's setting, so a size can be set in
two steps, and clearing either goes back to the natural size.
`check-image.mjs`: 26 checks to 36. Two of the new ones found real bugs while
being written. The first: with both a width and a height in one `{…}` block,
neither side parsed — the patterns were anchored to the whole block, so a figure
with two numbers silently printed at its natural size. The attribute block is now
split into declarations first. The second was mine: returning "contain" for a
height-only figure left a 1276×2000 box around a small picture, which the caption
then sat under. A height is a cap, and a cap needs no contain.
The MCP tool takes the same two arguments, so a model can write either number,
and a percentage height is refused with the reason it cannot work: a sentence is
flowed text, so there is nothing for it to be a percentage of and the browser
ignores it. v8 is deployed and DSH has verified both numbers round-tripping.