Repository navigation
Description
An element taller than a page is a hard failure. Once #461 lands, both pagination passes throw
InvalidOperationException carrying the same message (search for ElementTooTallMessage rather
than trusting a line number):
An element is too tall to fit on a single page and cannot be rendered.
Reduce the element's content or increase the page size.
And LayoutImage has Width and Height but no fit mode, so the commonest cause — a photograph
larger than the page — is an exception rather than something the engine can resolve.
Scope
Fit modes on images and other intrinsically-sized elements: scale-to-fit, contain, cover, and none
(the current behaviour). With a fit mode set, an oversized image is scaled rather than fatal.
Report rather than silently resize: when the engine intervenes, say so through L19's diagnostics, so
a caller who did not expect scaling finds out.
Keep the throw for content that genuinely cannot be placed — a table row taller than a page with no
fit mode applicable. A silent truncation would be worse than an exception.
Acceptance
- An oversized image scaled by each fit mode, with the diagnostic raised.
- Genuinely unplaceable content still throwing, with the existing message.
Relates to
- Layout: pass 1 skips an element too tall to fit while pass 2 throws #460 — the pass disagreement, split out of this issue; fix(layout): loop instead of recursing, so deep documents render #461 fixes it.
- L19 — the diagnostic channel.
- L42 — the other half of making images pleasant.
Plan labels used above, resolved: L0d #288 · L42 #291 · L19 #304.
Narrowed 2026-09-09. This issue bundled two things: image fit modes, and a pass-1/pass-2
disagreement about content that cannot be placed. The second half needed no new public API, so it
was split out as #460, which #461 fixes alongside #459, targeted at 2.3.1. What remains here is the fit
modes, which need LayoutImage API additions and the diagnostics channel from #304.
Activity
[-]Layout: fit modes for oversized content, and a pass-1/pass-2 disagreement[/-][+]Layout: fit modes for oversized content[/+]