Apple: honour Prop.Axis, and fix the circular width it exposed #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue/4-apple-horizontal-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A horizontal
Scrollis the framework's answer toRowoverflow. GTK andAndroid honoured
Prop.Axis; the Apple renderer had an explicit no-op, so onmacOS and iOS such a row still clipped.
The axis is read at
createandcreatereaches Swift as one int, so ittravels as kind code 9. 6 stays the vertical one, and no function is added —
phase 1's ConsistencySuite is untouched (6/6 still green).
The interesting part was not the new kind. The outer vertical
Scrollhad beenleft on AppKit's defaults, with a comment saying it laid out correctly without
constraints. It did, until something inside it asked the container for its
width. A horizontal scroller does exactly that, which closed a loop — the
Columnasks its children, a child asks theColumn— and Auto Layout resolvesa circular width as zero. The button row collapsed to 0px rather than clipping.
So pinning the document view on the cross axis is not an optimisation for the
horizontal case; it is what keeps the vertical one composable.
That first showed up as a passing test printing "viewport asks 0px":
viewport * 4 < contentis trivially true at zero. GTK's 4x ratio is a GTKconstant, not a cross-toolkit invariant — a GtkScrolledWindow reports a minimum
near zero, an NSScrollView has no intrinsic size and is pinned to fill its
parent, and a UIScrollView reports its laid-out frame. The three numbers are not
comparable. The portable invariant is that a horizontal scroller leaves its
content's width free, so content != viewport; on the wrong axis they are equal
to the pixel. Both platforms were falsified by forcing kind 6 and confirming the
check goes red.
Measured:
macOS content 357px, viewport 206px 27/27 checks
iOS content 267px, viewport 370px 26/26 checks
On every simulator available here the phone is wider than the five buttons, so
the overflow path is exercised on macOS only. The iOS self-test says so out
loud rather than passing silently.
Closes #4
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
e4c5b7d445to4c49bd582f