Skip to content

Add transpose helpers for Size, Rect, LayoutInput and LayoutOutput - #1265

Merged
nicoburns merged 3 commits into
mainfrom
devin/1791396700-transpose-helpers
Oct 7, 2026
Merged

nicoburns merged 3 commits into
mainfrom
devin/1791396700-transpose-helpers

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Objective

Small, layout-neutral helpers so that a tree implementation can run a node's layout algorithm in the axes of a CSS vertical writing-mode while Taffy itself stays horizontal-tb: Blitz transposes the LayoutInput it receives from the parent before dispatching an orthogonal child, and transposes the LayoutOutput back.

  • Size<T>::transpose(), Rect<T>::transpose() (left↔top, right↔bottom), RequestedAxis::transpose()
  • LayoutInput::transpose() — swaps every per-axis input; vertical_margins_are_collapsible is reset to Line::FALSE since margins cannot collapse across a change of block axis
  • LayoutOutput::transpose() — swaps size/scrollable_overflow_rect/oof_positioning_area; drops baselines and collapsible margins (block-axis quantities that would otherwise land on the parent's inline axis)
  • Doc comments on the style getters of LayoutPartialTree/LayoutBlockContainer/LayoutFlexboxContainer/LayoutGridContainer/LayoutContainingBlock stating the contract the algorithms already follow: container getters are only called for the node being laid out, child/OOF-item getters only by the node laying them out. This is what lets the two be expressed in different axes.

No behaviour change; CHANGELOG.md updated.

Context

Companion to the Blitz writing-modes feature (see the Blitz PR referenced from this one). An audit of src/compute confirmed no child style is read through a container getter, so no API change beyond the docs is needed.

Pre-existing clippy -D warnings failures on main (incompatible_msrv in compact_length.rs, useless_borrows_in_formatting in parse.rs) are unrelated and left alone.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/518900d464cb4cd0be95740dba21d3f1
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/518900d464cb4cd0be95740dba21d3f1?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Document that container style getters are only called for the node being laid out and child/oof
item getters only by the node laying them out, so tree implementations can express each in
different axes (CSS writing modes).
@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1791396700-transpose-helpers branch from f88f806 to 1a839a6 Compare October 7, 2026 18:44
@nicoburns
nicoburns enabled auto-merge (squash) October 7, 2026 18:46
@nicoburns
nicoburns disabled auto-merge October 7, 2026 18:52
@nicoburns
nicoburns merged commit d384458 into main Oct 7, 2026
30 of 32 checks passed
@nicoburns
nicoburns deleted the devin/1791396700-transpose-helpers branch October 7, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant