Repository navigation
Description
Every numeric property in the layout package except a pie chart's accepts zero and negative values
and renders something, with no exception and no diagnostic. The pie chart refuses all six of its
own, each with a precise message naming the value. That contrast is what makes this a defect rather
than a preference: the package has already decided what the right behaviour is, in one element.
Measured on 4788c4b, a 300x400pt page at 10pt margins. Every row below renders and says nothing:
| Property | Value | Outcome |
|---|---|---|
TextStyle.FontSize |
0 | rendered |
TextStyle.FontSize |
-12 | rendered |
TextStyle.Leading |
-40 | rendered, silently ignored |
LineSeparator.LineWidth |
0 | rendered |
LineSeparator.LineWidth |
-5 | rendered |
ListElement.Indent |
-100 | rendered |
RunningBand.Height |
0 | rendered |
RunningBand.Height |
-50 | rendered |
element Margins |
-20 on all sides | rendered |
Cell.ColSpan |
50 on a one-cell row | rendered |
Cell.RowSpan |
50 on a one-row table | rendered |
document Margins |
-20 | rendered |
For contrast, the pie chart refuses a diameter of 0 and -100, a slice value of -1, all-zero slices,
no slices at all, and a stroke width of -1.
Two of these are worth separating out because they are not simply ignored. A negative
ListElement.Indent puts the item content left of the content box, and negative element or document
margins inflate the area rather than deflating it, so content is placed outside the box the caller
asked for. DocumentRenderer.ValidateGeometry does check the other end: a document margin is
refused once the horizontal pair meets the page width, measured refusing at 150 on a 300pt page and
accepting at 149. So the guard exists and only covers one side.
Two releases, and the reason for the split
2.3.3 reports. Every value above is detected and reported through the notify-and-continue
channel this library already has for text-encoding warnings and, since #469, for band truncation.
That lands the whole of the diagnostic value: the caller learns the property was ignored or
mishandled, which is what they cannot find out today.
3.0 refuses. Turning these into exceptions is what a patch release must not do, because every
one of them renders something now and a caller may be relying on it. That is not a hypothesis: the
consuming showcase repository spent a full cycle removing its own caps after discovering they
narrowed what the library accepts, and it has recorded "not in a patch" as a planning constraint on
exactly this set.
TextStyle.Leading set to NaN is the one row that needs no change in either release.
EffectiveLeading is Leading > 0 ? Leading : FontSize * 1.2, and NaN fails that comparison, so
the non-finite value is discarded before it can reach a coordinate. Worth a comment saying so
rather than a guard.
The refusals whose messages misdescribe their input, and the six that name a private field as their
parameter, are separate and patch-safe, because those inputs already throw.
Follow-up: #484 is where these are refused rather than reported, on v3.0. Filed separately because an issue carries one milestone and this one closes with the 2.3.3 reporting.
Activity
Tim81 commentedon Sep 12, 2026
A negative line width is not merely undocumented, it violates a shall
Read from the held ISO 32000-2:2020, clause 8.4.3.2, Line width:
So
LineSeparator.LineWidth = -3, which this issue measures as rendering and emitting-3 w, puts anon-conforming operand in the content stream. That is not the same category as the other eleven rows.
Why this changes the argument rather than adding a footnote. This issue splits on the ground that
every value in its table "renders something now and a caller may be relying on it", so 2.3.3 reports
and 3.0 refuses. That reasoning holds for a zero font size or a negative margin, which are legal
tokens producing an odd result. It does not hold here: the output is already wrong by the
specification, which is exactly the category this release is permitted to change.
The same clause settles the zero case too, and in the opposite direction from the current
documentation:
So zero is legal and defined, which is why
LayoutValidation.ValidateLineWidthdeliberately leaves italone, and that decision is right. But the standard advises against it, and the member's
documentation does not say so. NOTE the standard's own word here is should not, not shall not, so
this is a caller warning rather than a refusal.
Suggested split, replacing the current one
specification forbids.
member's documentation.
Found while verifying two specification citations that a review of #503 could not check, because
docs/iso/was empty in its worktree at the time.docs(layout): fix round two's own false claims in #503's boundaries
docs(layout): apply review round 7; state mechanisms, not outcomes
docs(layout): apply review round 8; sweep classes, pre-review own fixes
docs(layout): apply review round 12; weaken rules for queued defects
docs(layout): apply review round 14; document probed page-size gaps
Tim81 commentedon Sep 20, 2026
Split, by the maintainer's decision on 2026-09-20:
LineWidth(ISO 32000-2 8.4.3.2, "shall be a non-negative number") is refused in a patch. Tracked in Layout: a negative line width is written as-3 w, which ISO 32000-2 8.4.3.2 forbids #557, milestone v2.3.4.Document.*Warningsproperty, which is not hardening work. It waits for a later feature patch milestone or v3.0; no feature milestone exists yet, so this issue moves to v3.0 next to Refuse the input 2.3.x only reports: the contract changes a patch cannot make #484.Read from
origin/mainat cbbf7d5 while triaging:LayoutValidationstill checks only non-finite values for font size, line width and insets, and its comments name these rows as deferred to the next major. The claim in this issue's opening sentence that "every numeric property except a pie chart's" accepts zero and negative overreaches:ColSpanbelow one and non-finite font sizes, line widths and insets are already refused, andLeadingat or below zero is documented as "derive from the font size".