Skip to content

fix(layout): keep list text when the indent leaves it no width - #682

Merged
Tim81 merged 72 commits into
mainfrom
feat/list-indent-clamp
Nov 26, 2026
Merged

Tim81 merged 72 commits into
mainfrom
feat/list-indent-clamp

Conversation

@Tim81

@Tim81 Tim81 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #476

Closes #685

Summary

A paragraph that returns Nothing was treated as placed, in two places in ListRenderer.

  • Layout: a list indent at or beyond the content width discards the item text and keeps the marker #476. A list indent that leaves an entry no text width saved as a column of markers with the
    text discarded, and nothing reported it. The gutter is clamped so the text is drawn.
  • A list item's content line that does not fit the space left is dropped silently #685. An entry whose marker fitted what was left of a page and whose text did not (or the
    reverse) was drawn with one part missing. The entry moves whole to the next page.
  • New LayoutDiagnosticCode members, all severity Error: ListIndentClamped (203),
    ListIndentClampSkipped (207), ListEntryPartDropped (208). The default save succeeds;
    StrictDiagnostics refuses them. They are the only public additions.
  • A document that holds a renderer of yours, an entry in a font it cannot draw, or an element near
    the continuation limit lays every list out as before. Without StrictDiagnostics its outcome
    stays main's, apart from the A reused list renderer draws the lines its earlier layout placed #691 reuse class below. With it, a 207 refuses the save, and a list
    laid out this way reports one even where no entry would have been clamped or moved
    (ListIndentClampSkipped states which lists report). A follow-up PR narrows 207 to lists where a
    clamp or a move was skipped before 2.4 ships (Follow-ups).

Production code last changed at 473e462. git diff --stat 473e462 a7a67cf -- src lists
ListElement.cs and ListRenderer.cs, 8 insertions and 6 deletions, all comment and XML-doc
lines; 565d449, 634c092, 0ad585c and a7a67cf otherwise change tests and the CHANGELOG.
Measurements at 473e462 describe a7a67cf too.

The rules

The authority is the XML docs of ListElement (the placement rule, six cases),
ListElement.Indent, ListRenderer.Layout and LayoutDiagnosticCode (203, 207, 208).

The clamp (#476). An entry whose gutter would leave its text no width gets one: the width of
its widest word, or all the room right of its marker's inset when the word is wider. The content
starts at the area's right edge less that width and can overprint the marker, which is never moved.
It applies only where the text width was zero or less; ListElement.Indent lists what it leaves
alone and carries a "Do not pass" paragraph for such an indent (3.0 will refuse it). A nested list
whose indent reaches the area width still throws, with the same message.

The move (#685). An entry is placed when its marker and its text are both placed. Otherwise it
moves whole to the next page, as it did when neither fitted, provided a page of its own holds both.
A marker that wrapped into more lines than the room left counts as not placed; text with no width
is not a part that did not fit.

Laid out as it was. A list gets no clamp and no move (ListElement states each case) when:

  • the document holds a renderer that is not one of the library's own, added with
    Document.Add(IRenderer) or DocumentRenderer.Add(IRenderer), wherever it sits and whether or
    not it holds a list. The library cannot read where such a renderer starts, and a list that moved
    ahead of it can change whether the document saves. BarcodeRenderer counts as the library's own
    through the internal IListFreeRenderer;
  • the document holds an entry in a font it cannot draw, at any depth: drawing its text throws, so
    moving anything ahead of it could turn a save into a throw or the reverse;
  • the document holds, after one of its lists, an element that can need about as many page
    continuations as the limit allows, read from the element and not from a layout (ListElement
    gives the count);
  • the new layout would take this list past the 50,000-continuation limit (per list);
  • the list holds an entry no page holds (a marker line, or text at the width the clamp would give
    it, taller than a page);
  • the list is laid out through a context the document did not build for it (WithArea, the public
    LayoutContext constructor, a renderer of yours), or its entries came from a layout that was not
    the document's own call in this save.

The first three are decided once for the document, from the elements added to it and before the
first layout pass (DocumentRenderer.ScanLists, called from RunLayout), so the page-counting
pass of a header or footer and the drawing pass lay each list out the same way.

Reports. 203 once per list the document draws from its first entry, Count the entries
clamped. 207 once per list the document places as it was and draws from its first entry, because
of the continuation limit, a
renderer of yours, a font it cannot draw or an element near the limit; Count is the entries the
clamp would have narrowed, or 1, and the message names every cause the scan read. An empty list
reports nothing. 208 once per list that places an entry with a part not drawn, Count the number
of such entries in the pieces drawn. A list a renderer of yours holds reports neither 207 nor 208, because the document did not
place it.

Deliberate output changes against main 73b6c60

Measured at 473e462 by an independent review unless a commit says otherwise. The counts below come
from 67,192 generated documents without StrictDiagnostics (three generator variants of the four)
unless the row says otherwise.

Class Count Why
Text drawn that main discarded, or text that appears because an entry moved 4,055 with a 203, 207 or 208 report; 666 with none #476, #685
The same text at other positions 83 (31 with none of 203, 207, 208) a moved entry shifts what follows
New report, bytes unchanged 7,602 new codes
Text lost, each in a document with no renderer of yours and each with a 208 26 a list laid out as it was starts where the lists ahead of it, which keep both fixes, leave the cursor
A reused renderer draws the placement the first document gave an entry 2,704 of the 101,400 documents of the earlier-layout set that hold a renderer of yours #691
Refused under StrictDiagnostics for 207 or 208 830 of 72,817 generated documents that hold a renderer of yours new code under strict mode

Of the 67,192, 15,974 are identical and 38,786 threw on both with the same message; none changes
status. The 697 that changed with no 203, 207 or 208 and no text lost (666 and 31) hold no renderer
of yours, and their diagnostics differ in 55. A moved entry also changes where a keep run ends, so
reports of 601, 801 and 802 can change. At a limit of 300 continuations (a constant edited in both
builds, 3,000 documents of 100 to 330 entries a list, implementer at 604c70c), 902 report 207 and
none loses text.

The 2,704 documents (#691). Each is the second document of a renderer that a first,
library-only document placed itself, in the list kind whose gutter depends on the width. The first
document moves an entry (#685), and the second draws the placement that gave it, where main drew only
the part that fitted. All 2,704 are list kind gutter; none changes status. Implementer at 604c70c,
over the six shapes whose first document places the list directly (48,672 documents that hold a
renderer of yours): with the first document laid out as it was, all equal main; without that, 2,704
differ. The compatibility rules allow it because the fix of #685, which this PR closes, changes the
first document's bytes. #691 stays open.

The 830 refusals. Each sets StrictDiagnostics and holds a renderer of yours: 812 for 207, 18
for 208, none for 203, by generator variant 77, 145, 365 and 243. In 312 main saved; in 518 it also
refused, with another exception (496 an IndexOutOfRangeException from
PdfFontResource.BaseFontName, 22 a strict UnembeddedFont refusal). StrictDiagnostics and the
three codes are in PublicAPI.Unshipped.txt, so no release has them and new API may refuse from the
start. The limit-300 variant adds 13 (main saved 12), a targeted set 28.

What stays as main

Documents that hold a renderer of yours (a renderer outside Layout and Barcodes among the elements
added), compared with main 73b6c60 for status and bytes, at 473e462, by the review. Codes 203, 207
and 208 are removed first, since main has none.

Set Size Result
Generated documents crossing earlier-layout shapes, widths and list kinds 101,400 of 103,200 documents 98,696 equal main (2,028 refuse on both with the same message); 2,704 differ (#691)
Generated documents, first differential set 42,007 of 50,000 documents all equal
Generated documents, second differential set 18,315 of 20,000 documents all equal
Four generators 72,817 of 110,000 documents 71,987 equal; 830 refused under strict
Limit-300 variant 1,417 of 3,000 documents 1,404 equal; 13 refused under strict
Hand-built shape sets, rows with and without a renderer of yours 1,768 rows in eight sets, and 82 rows of newer shapes every row that holds a renderer of yours has main's status and bytes, except 28 rows under strict (main saved, refused for 207) and 18 rows of the #691 class; rows that hold none equal 8d4d002

Documents with no renderer of yours equal 8d4d002, the head before the renderer rule: 1,800 of 1,800
in the earlier-layout set, 7,993 of 7,993 in the first, 37,183 of 37,183 in the generators. 17 rows
of the second set differ from it and equal main, because the first document of their renderer
holds a renderer of yours. The rest differ from main only by the fixes.

Header and footer totals equal the file's page count in all 27,189 rows checked. Two shapes print
another total on main and here alike: a DocumentRenderer whose PdfDocument already holds pages
(DocumentRenderer.Header says {pages} does not count them), and a renderer whose result depends
on how often it is called.

Mutations

One mutant per row, run in a detached worktree. Rows at 473e462 ran 663 tests in 14 list classes.

Mutant Failing Commit
the scan never counts a renderer of yours / counts a barcode / skips it once an element near the limit was found 60 / 2 / 2 473e462
a renderer counts only after a list / only before a list / the assembly test is inverted 20 / 40 / 47 473e462
the decision is taken between the measuring and the drawing pass / the font rule is switched off 7 / 19 473e462
the scan does not set the all-lists flag / FoundCallerRenderer is always false 56 / 101 473e462
the renderer cause is dropped from the cause bits or from the 207 message 101 each 473e462
the message joins its last cause with ", " / names only the first / names the renderer first 1 / 7 / 1 473e462
the scan never runs 97 of 362 tests 604c70c
FoundCallerRenderer always true (a 207 names a renderer the document does not hold) 0 of 663, and 0 of 2,846 in all of Layout.Tests 473e462
the same mutant 3 of 22 in ListCallerRendererRuleTests, exactly the three new rows 634c092

The always-true mutant was the review's one survivor; 565d449 adds rows with no renderer that
assert the message does not name one.

The late undrawable-entry checks that 604c70c deleted were dead for documents with no renderer of
yours: a tripwire that threw when one failed fired 0 times at 473e462, in about 285,000 documents
and all 2,846 Layout.Tests. That is a measurement and a source argument, not a proof for every shape.

Gates at 634c092

Run by the implementer of 565d449 and 634c092, oracles required (veraPDF 1.30.4, qpdf 12.4.2,
poppler from MSYS2): Release build of the solution, 0 warnings; Layout.Tests 5,698 run over both
target frameworks, 0 failed, 4 skipped; Barcodes.Tests 2,104 run, 0 failed; dotnet format --verify-no-changes, clean-room check and generate-roadmap.py --check all pass.

The review ran them at 473e462: Layout.Tests 2,846 per target framework, 0 failed, 2 skipped;
Barcodes.Tests 1,052 per framework, 0 failed. No report says the AOT smoke ran at either commit.

Removed in 3.0 (#688)

3.0 lays a list out one way (#696 is the design issue), so these 2.x devices go; each carries a
comment naming 3.0 and #688. Names are as found in src at 634c092; none is in src at 73b6c60
except _twin, which main has in TableRenderer only.

  • ListRenderer: the twin and its delegation (Unclamped, _unclamped, _twin, _clampSkipped,
    LayOutAsTwin, _delegate); the earlier-entries rule (_builtUnder, _builtForCaller,
    _earlier, BuiltByAnEarlierLayout, AdoptEarlier, WithoutClamp, Entry.UnclampedGutter);
    the check for an entry no page holds (TryEntriesOnAnEmptyPage, _placeabilityKnown,
    _wholeAsMain, _unplaceable); CanDrawEntry, HoldsUndrawableEntry, TwinPlacement,
    _handoff, _placementInherited, BuildCalls.
  • ListLayoutRun, LayoutContext.IsAddressedByDocument, ListItem.OwnRuns,
    DocumentRenderer.ScanLists, PdfDocument.CanDrawFont, ParagraphRenderer.Placement and
    RestorePlacement; IListFreeRenderer, its use on BarcodeRenderer and the
    InternalsVisibleTo from Layout to Barcodes that exists for it; code 207 and the cases of 208
    that exist for the twin.

Follow-ups

A list indent at or above the area width left the item text with a
non-positive width, which the paragraph renderer discards, while the
marker, which has no margin, was still drawn. A nested child lost its
text from half the area width for the same reason.

An entry whose gutter would leave its text no width now gets the width
of its widest word, never starting left of its own marker's inset. A
width that is positive but short of the widest word, an entry with no
word to measure, and a nested indent that reaches the area width keep
their earlier output and refusal.

Each list with a clamped entry is reported as the new
LayoutDiagnosticCode.ListIndentClamped (203, Error).
…tinuation limit

Drawing text the list used to discard adds lines, so a document that saved
could now need more than the 50,000 page continuations one element may take
and throw. A list with a clamped entry is now counted in entries and wrapped
lines, which bounds its continuations; a list above 50,000 of them is laid out
without drawing first, from the cursor, and is placed with no clamp when that
run reaches the limit. That placement is the layout the list had before the
clamp, so it saves the same pages or throws the same exception.

The fallback is reported as the new ListIndentClampSkipped (207), because
ListIndentClamped says the text was drawn and here it is not.
…room

An entry whose text had no width was placed as a marker with nothing beside
it, so a marker taller than the page refused the whole entry. With the clamp
the text got a width and the entry saved with the text and no marker.

A clamped entry whose marker returns Nothing now treats its text as Nothing
too, which is the outcome it had: the list splits before the entry, or at a
page top the save throws the same exception. A continuation is left alone,
because its marker was drawn on an earlier page.
The clamp does not draw every entry's text. An entry with no word that
measures wider than zero keeps its text discarded, a line taller than the
area is not drawn, and a word wider than the room right of the marker gets
that room rather than its own width. A list reports its clamped entries once,
and a renderer that starts after the first entry reports none.

Correct ListElement.Indent, ListIndentClamped, its message and the CHANGELOG
entry to say so, and add the same note to the ListRenderer constructor.
…me the second override

The Math.Max after the correction loop in TryClampGutter cannot change its
result: the word is narrower than the room, so the first difference is
already at or above the marker inset, and the loop only steps from above it.
Remove it, say why in a comment, and test the boundary the assertion that
the gutter is not left of the inset was meant to cover, with a word one
step short of the room.

Rewrap the comment lines over 100 columns, say that two cases now override
the widened gutter, and rename the test of an entry whose word measures zero.
ListElement.Indent said a flat list at an indent reaching the area width is
not refused. A flat list whose marker has no room on a page is refused at any
indent, including the indent that clamps its text. Say so.
Drop the exemption that left a continuation out of the rule that a clamped
entry whose marker has no room is placed as Nothing. The document never offers
a continuation less height than the page where the entry began, so the rule
cannot fire there, and a hand-built flow that does offer less now gets the same
answer as an entry that starts there.

Add the two tests the mutation run asked for: a probe that leaves the page
index moved flips the left edge of a mirrored page, and an answer kept for one
cursor is not returned for another.
# Conflicts:
#	src/VellumPdf.Layout/Rendering/ParagraphRenderer.cs
Tim81 added 18 commits November 22, 2026 14:14
…ace (#476, #685)

An entry whose text had no width was discarded before the clamp, so
laying that text out at a width could raise refusals that were never
read: a run style the line-height walk refuses (a non-finite font size
or colour channel) made a document that saved throw. An entry is now
clamped only when every run that holds text passes those checks, and
the continuation bound no longer builds an item for a list with no
height, so the refusal that reaches the caller is the one it was.

ListRenderer.Layout treated an entry as placed when either its marker
or its text returned Nothing. A text line that did not fit what was
left of a page was dropped while its marker was drawn, and a marker
that did not fit was dropped or overprinted while its text was drawn,
with nothing reported. An entry is now placed when both parts are;
otherwise it moves whole to the next page when a page of its own holds
both. An entry no page holds keeps the part that fits, in the bytes it
had, and is reported by the new ListEntryPartDropped (208).

Moving entries adds pages, so the continuation bound covers every list
and a list that would pass the limit falls back to the earlier
placement and is reported by ListIndentClampSkipped (207). Pieces of
that fallback list stay on the earlier placement.

An entry whose clamped line does not fit is no longer drawn as an empty
text object, so its bytes are the ones written before.
…s it falsified

ListElement.Indent, the ListRenderer constructor and Layout remarks, and the 203 remarks said a
line taller than the area was left alone and that a marker with no room was placed as it was. An
entry whose marker or text does not fit now moves to the next page, and one no page holds is
reported by ListEntryPartDropped.
…ssed it

The list adopts the continuation-limit mechanism of #686: the clamp and the moved
entries run only when the document addressed the call to the list and decided the
limit, and a list laid out under any other context, a list with an entry no page
holds, and an entry that cannot be drawn keep the placement they had. The list's own
probe, memo and decision in the document renderer are gone.

Refs #476, #685
… page, and pin the guards

The entry analysis lays each entry out on a page of its own and now puts the
paragraphs' placement back, so an entry the list does not move is drawn from the
state it had. A refusal the analysis meets hands the list to its twin, which raises
it where it always did. The bound, the page-top guard, nested entries and the twin's
identity each get a test.
…ed limit mechanism

Keep the page-continuation limit's stack-depth frame countable: PlaceRenderer is
not inlined into its caller.
…ont it cannot draw

Clamping or moving an entry changes where everything after it falls, and on 2.3.3 an entry
whose font the document cannot draw saved when its text fell where it does not fit and was
dropped, and threw where the text was drawn. The per-entry check kept only the entry itself
on its old layout, so an earlier list that moved or clamped could still flip the outcome of
a later entry, in the same list, in another list, or in a list a caller's renderer holds.

A document that holds such an entry now lays every list out as its twin. The document reads
its own lists before laying anything out. A list a caller's renderer holds is found when it is
laid out, so a list ahead of a renderer from outside the assembly makes the document lay out
once more first, and a layout that finds the entry in a measuring pass measures again. A twin
a caller's renderer holds reports nothing. LineCountAt gets a test with a right margin.
…ass that found the font

A dependent that settles measured both passes of the pass that found the font, which was
discarded: it now returns as soon as the pass lays out with a different rule, and the caller
measures again. The rows compare each document with the same document whose lists are replaced
by their twins, over a list that moves, a list that clamps, a list a renderer of the caller's
holds in each context, a header, a dependent, a marker and a nested child.
… per-entry drawable guards

The measuring pass that looks for a list a caller's renderer holds leaves each paragraph where
it placed it, and a list's Draw reads that when its own layout answers Nothing, so an entry
whose text the pass placed on a page where it fits was drawn there by the pass after it. The
lists now start over after that pass, as they do after a pass that found the font.

With every list of a document laid out as its twin once any entry cannot be drawn, the
per-entry guards on the clamp and on moving an entry cannot be reached from a document, so
they go.
…a held list

The pass that finds a list a caller's renderer holds laid the lists ahead of it out the new
way, and a list laid out the new way measures text that 2.3.3 never measured, which adds
glyphs to the subset of an embedded font. A document that holds a font it cannot draw is
meant to save the file 2.3.3 saved, so that pass lays every list out as its twin and runs
before any pass that is kept. A pass that found the font no longer needs to be measured
again, which goes.
A piece a list splits off is laid out as a list of its own, and with no generation it saw a
newer one on every page, forgot its entries and built them again, which made a list of many
pages quadratic. The pieces now carry it, and a test counts the builds.
Three conflicts, all in documentation and the reserved-code comment. IRenderer.Layout keeps
main's table paragraph ahead of the list paragraphs. WithArea names both built-in renderers that
lay out the earlier way under the copy. The reserved list drops 203 and 301, which the two
changes now define.
…nd so does the probe copy

A list a document holds and a caller's renderer holds too lays the second
placement out from the entries the first built, as it did before the fixes,
so the stale draw there is the one 2.3.3 gives. The extra layout pass lays out
a copy that holds the entries built before, not the list as it is now, so an
item added since adds no glyph to an embedded font's subset.
A table cell now reads line ends, so a cell of n characters can hold n + 1
lines. Say why two plus the rows and characters still bounds a table's
continuations, and pin it with tables whose cells hold line feeds beside empty
cells, over a range of page heights, with the limit set to the bound. Pin the
probe copy's entries for a list laid out before the save as well.
… found them

The extra layout pass lays a list out on a copy with paragraphs of its own. A
copy that shared the paragraphs of a reused renderer placed them where the lists
ahead of it do not move an entry, and the second document drew that placement
where its own layout placed nothing. Pin it with a caller's renderer that takes
no room, and drop the copy's width, which nothing reads.
…tries for the document

A renderer that a caller's renderer held and laid out first, at another
width or under WithArea, and that was then added to the same document,
was laid out from entries built again at the document's width. 2.3.3
builds a list's entries once, at its first layout, and draws every later
placement from them.

The twin now records that it built its entries under a call the document
did not address to the list, and a later call the document does address
then lays the list out as its twin, as for entries another save built.
The calls the document makes within one save still count as one layout.

Say when a reused list reports: nothing, unless the document lays every
list out as its twin, when it reports 207 and 208 as any list does. Drop
the width the twin carried and never read, reword the sentence in
IRenderer.Layout that could be read the wrong way round, and add a test
that no two Standard 14 values share the memo.
…lds placed twice, the memo

A document that keeps every list as its twin builds the entries the list
keeps through the twin, so a later save must lay the list out from them
and not build its own. A list with an entry no page holds is reported at
each placement of the same renderer: the twin entries built for the
first one belong to the document, not to a caller.

The Standard 14 memo test asks each pair of values with nothing between
the two questions, so a memo that packs a value and its answer so that
two values collide fails it.
…lls them

A twin's overflow piece took its placement from the context of each call,
so a piece the document called itself became one the document had placed,
and reported ListEntryPartDropped (208) for a list a caller's renderer
holds. That happened when a caller's renderer returned the list's own
result, and when a list was placed over entries a caller's renderer or
another save built. The bytes were unchanged, but StrictDiagnostics
refused a save that the list as it was saved.

A piece now takes the placement of the call that made it, and Held stays
distinct from a twin nobody handed a placement to.

Also drops the field that recorded whether the document called the list
when its twin built the entries. The twin builds fresh entries under such
a call only when the document has already chosen the twin, for this list
or for every list, and its later calls go to the twin without reading the
field.
A piece that resumes inside an entry is the overflow the document calls
next, so a held list's placement has to reach it as well as the pieces
that start at an entry.
A list that the near-limit rule laid out as it was reported 207 with the
message "The document holds a list entry in a font it cannot draw", even
when the document held no such font. The run now records which rule found
what, and the message names the font, the element after a list that comes
near the limit, or both.
The scan skipped the near-limit test once another cause had turned every
list into its twin, so the message named both causes only for the orders
in which the near-limit element was found first. Each rule is now tested
whatever the other has found. Only the message text of a 207 changes: the
bytes, the status and the set of codes are the same. The scan makes one
ContinuationBoundOf call per element after a list, as it did before the
first cause was found. The call sums a paragraph, list or table only up
to the limit plus one, reads a heading in constant time, and counts the
tabs of preformatted text once.

The 207-cause test now asserts the words of each cause for font,
near-limit and both, in both orders, and for a near-limit list as well as
a near-limit Preformatted.

A list a caller's renderer lays out only from Draw is found when it is
drawn, since the extra pass measures and never draws. IRenderer.Layout,
ListRenderer.Layout, ListElement, LayoutDiagnosticCode and the CHANGELOG
now state that boundary, a test pins the output it gives, and the
sentence about a list placed over entries a renderer built first keeps
the exception for a document that lays every list out as it was.

Pins the first piece a caller hands the document as an overflow, for an
entry split and a mid-entry split.
…t out as it was

The list fixes were applied or not according to what a probing pass found
in a caller's renderer, so one save could lay a list out two ways: a footer
counted pages with the new layout and the drawing pass used the old one. A
document that holds any renderer that is not the library's own now lays
every list out as its twin, decided once before the first pass, so the
probing pass and everything that existed only for it are removed. The 207
of such a list names the renderer among its causes.
A font found only while a list lays out, in a list a renderer of the caller's
holds or over entries an earlier layout built, still turns every list into its
twin, but no longer adds itself to the message of the lists placed after it.
…probing pass needed

The scan reads every list the document holds, and an item's style cannot change
after it is built, so a list could find nothing while it laid out that the scan
had not found, except a list a renderer of the caller's holds, which the
renderer rule already covers.
…s does not name one

The fallback theory had no row without a renderer, so a 207 that named a
renderer in a document that holds none passed every test. Rows with the font
and the near-limit causes alone now expect the renderer cause to be absent.
Two test names that said the opposite of what they assert, and comments that
still described a second layout pass, are corrected.
Counts and the page-count sentence go; the figures belong to the pull request
body, each with the commit it was measured at.
…t was

Without StrictDiagnostics a document whose lists are laid out as they
were keeps the outcome it had. With it, each such list with an entry
reports ListIndentClampSkipped (207), an error, so a save that does not
throw is refused. The CHANGELOG and ListElement now say both. Two test
comments are corrected: one named a caller's renderer where the row adds
a list before the one under test, and one was over the line length.
The sentences added for StrictDiagnostics said every list with an entry
reports 207. A list started at a later item, a list a renderer of yours
holds and an empty list report nothing. The CHANGELOG, ListElement and
ListRenderer.Layout now say that a 207 refuses the save under
StrictDiagnostics and leave which lists report one to the code's own
documentation.
@Tim81
Tim81 merged commit 251adf8 into main Nov 26, 2026
4 checks passed
Tim81 added a commit that referenced this pull request Nov 26, 2026
Closes #691.

A ListRenderer built its entries at its first layout and kept them for
every later one: another save, another document, a layout of yours
before the save, a renderer of yours that held the list. A paragraph
that answered Nothing kept where its last layout put its lines, and
Draw read that, so a reused renderer drew an entry's lines from an
earlier document at a place where nothing was placed, and an item added
since was never laid out.

A list now builds its entries for each save and each kind of call (the
document's own calls, and a renderer of yours), from the items it holds
then. A piece a split returned keeps the entries of the layout that
made it. A child whose layout answers Nothing draws nothing.
ListRenderer.Layout states the rule.

Deliberate changes: a reused renderer draws what a new renderer for the
same list draws, and is refused for what its list holds now, as a new
one is. A document refused only because a reused list renderer drew an
earlier layout's lines now saves. The code that reproduced an earlier
layout's entries for #682 is removed.
@Tim81
Tim81 deleted the feat/list-indent-clamp branch November 26, 2026 20:21
Tim81 added a commit that referenced this pull request Nov 27, 2026
Since #682 every list laid out as its twin (as it was before the clamp of
#476 and the moving of #685) and drawn from its first entry reported
ListIndentClampSkipped (207, an Error) with a Count of at least 1, so
StrictDiagnostics refused such a document even when the twin and the new
layout were identical.

A twin now reports 207 only for an entry it left as it was that the new
layout would have changed: an entry whose gutter the clamp would have
narrowed, or one the new layout would have moved to the next page. Count
is the number of those entries, each counted once; move sites are counted
per piece in the twin's own walk and merged by the diagnostic sink. An
entry is not counted when drawing it in the new layout would draw text in
a font the document cannot draw, since that save throws; the exemption
reads the wrap's own tokens (ParagraphRenderer's tokenising step, split out
of WordWrap) and treats a page reference as a word in its style. The
message names exactly the causes that applied. Which lists are laid out as
the twin is unchanged; without strict mode the bytes equal main on the
Layout goldens and in a 285,038-row generated comparison.
Tim81 added a commit that referenced this pull request Nov 27, 2026
…es it (#687)

The wrap of 2.3.3 was applied wherever a twin or a forwarded renderer
was used: a list sent to its twin for an undrawable font, a renderer of
the caller's in the document or an entry that fits no empty page, a
forwarded table and a paragraph with a start line. The rulings of #682
say those lists are placed as main places them, and nothing about them
concerns the limit, so they changed output for no verdict's sake.

The 2.3.3 wrap now applies to the twin the document chose or is probing,
to the entries of a list laid out as its twin for the limit, and to the
entries of every list of a document in which an element after a list
comes near the limit. A context says so (WrapAsBefore); the table twin
cuts at the glyph under the same condition.

The list's bound for an entry reads the join of runs from the tokeniser
itself, so runs that share one style instance count, and the cut no
longer appends a rune through a boxing call, which allocated more than
main did per character.

The rows that pin the verdict of 2.3.3 are taken from a v2.3.3 build,
one line to a page, with runs that share a style instance and runs that
do not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant