Record that padding is an inset and plan the frame-as-length representation

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Fable 5.1 committed 2026-09-18 19:47:12 -04:00
1 parent 1c52bc4e19
commit f33981e1e6
2 files changed
+120 -43

No files matched your search

+10 -7
View File
@@ -320,11 +320,13 @@ is narrowed by a length its parent decided: a declared `px` or `rel` length,
or the resolved slot of a `leftover` child. A box a widget reports for itself
does not narrow its descendants' frame.
`Pad` is an outset: it forwards its frame less the padding, draws the child
inside that area, and reports the child's used size plus padding. A
`rel(1.0)` child inside padding inside a share is a fraction of the resolved
share less that padding. The mixed "outset pixels, inset fractions and
shares" interpretation is rejected.
`Pad` is an inset (Bryan, 2026-09-18): it subtracts the padding from both
the child's frame and the child's box, and reports the child's size plus the
padding. A `rel(1.0)` child inside padding fills the pad without overflowing
it; a wrapping text inside padding wraps at the box the pad was given less
the padding. A span's frame never subtracts siblings, so a padded fixed
child measured after a 24 px sibling in a 900 px row wraps at 844 while a
`rel(1.0)` inside it is 868. There is no outset kind and no mixed kind.
A widget draws once, in the box it is asked in; its answer is placed inside
that box by re-expressing the drawing, and nothing is drawn again in a box an
@@ -333,8 +335,9 @@ decide whether a re-ask can be skipped. A container that puts an answer
somewhere other than where it asked says so with `Painter::place_at`, which
never runs the body. A frame is narrowed by a length of the parent's frame,
never by a region, and is put back into the part by the child's alignment on
every placement. This is `wip/one-ask` in the experiment checkout; whether
`Pad` narrows the frame by its padding is still open in `docs/HANDOFF.md`.
every placement. This is `wip/one-ask` in the experiment checkout. The
padding rule above needs the frame to be a length and the box a region in
the region node's coordinates, which is the next step in `docs/HANDOFF.md`.
## Layout decisions and invariants (2026-09-15 to 2026-09-17)