Repository navigation
Implement vertical writing-modes - #1090
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
staging-devin-ai-integration
Bot
force-pushed
the
devin/1791396755-writing-modes-phase1
branch
from
October 7, 2026 18:56
be0dc8b to
227a24c
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1791396755-writing-modes-phase1
branch
from
October 7, 2026 19:08
227a24c to
53f1bc6
Compare
writing-modes feature (phases 1–4)writing-modes
staging-devin-ai-integration
Bot
force-pushed
the
devin/1791396755-writing-modes-phase1
branch
3 times, most recently
from
October 7, 2026 20:59
96b5d49 to
3f76b31
Compare
This was referenced Oct 7, 2026
staging-devin-ai-integration
Bot
force-pushed
the
devin/1791396755-writing-modes-phase1
branch
from
October 7, 2026 22:53
4547f1b to
df802cf
Compare
…al block-size fixes
… block size for orthogonal fit-content, enable writing-modes in the WPT runner
…id tracks/placement/auto-flow/areas, gap)
…gainst the frame A node's Taffy direction is now its start edge along the frame's inline axis (block-start for orthogonal nodes). left/right alignment keywords resolve against the frame's line-left, and self-start/self-end in the block axis are pre-resolved against the node's own writing mode since Taffy's block axis has no direction.
left/right in justify-content resolve against the frame's line-left (inline main axis) or physical left (block main axis of a vertical frame). Children of column flex containers apply align-self in the frame's inline axis, tracked via BaseDocument::current_align_axis_is_inline.
LayoutOutput::transpose leaves oof_candidates untouched, so a box whose static-position parent is orthogonal to its containing block was positioned with swapped axes.
…writing-mode css-writing-modes-3 §8 takes the root's used writing-mode from <body> unconditionally; the horizontal-tb condition was wrong (fixes wm-propagation-body-040/044 and the sideways-root variants 048/050/052/053).
staging-devin-ai-integration
Bot
force-pushed
the
devin/1791396755-writing-modes-phase1
branch
from
October 7, 2026 23:29
df802cf to
8b04376
Compare
Replaced-element layout read node.layout_style() directly and so resolved percentage padding against the containing block's block size.
…F boxes unrounded_layout stays in the placing algorithm's writing mode, so getBoundingClientRect / offset* now go through BaseDocument::physical_unrounded_layout. compute_orthogonal_child_layout only drops the stretched block size for in-flow children.
physical_unrounded_geometry walks the containing-block chain once; the layout pass records each node's writing mode in LayoutData so horizontal chains take the same loop as before and only chains with a vertical box are physicalised root-down.
…tive and the browser app
This was referenced Oct 8, 2026
staging-devin-ai-integration Bot
pushed a commit
to nicoburns/stylo
that referenced
this pull request
Oct 8, 2026
…lds (servo#481) Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support](DioxusLabs/blitz#1090), and will be able to take advantage of these values once they're available.
Loirooriol
pushed a commit
to servo/stylo
that referenced
this pull request
Nov 9, 2026
…lds (#481) Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support](DioxusLabs/blitz#1090), and will be able to take advantage of these values once they're available.
6 tasks
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Nov 11, 2026
…s in Servo builds. r=firefox-style-system-reviewers,emilio Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support][1], and will be able to take advantage of these values once they're available. [1]: DioxusLabs/blitz#1090 Imports servo/stylo#481 Differential Revision: https://phabricator.services.mozilla.com/D341385
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Nov 11, 2026
…s in Servo builds. r=firefox-style-system-reviewers,emilio Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support][1], and will be able to take advantage of these values once they're available. [1]: DioxusLabs/blitz#1090 Imports servo/stylo#481 Differential Revision: https://phabricator.services.mozilla.com/D341385 UltraBlame original commit: e765db79469eb1200d5d480703563a386f4b9d64
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Nov 11, 2026
…s in Servo builds. r=firefox-style-system-reviewers,emilio Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support][1], and will be able to take advantage of these values once they're available. [1]: DioxusLabs/blitz#1090 Imports servo/stylo#481 Differential Revision: https://phabricator.services.mozilla.com/D341385 UltraBlame original commit: e765db79469eb1200d5d480703563a386f4b9d64
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Nov 11, 2026
…s in Servo builds. r=firefox-style-system-reviewers,emilio Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support][1], and will be able to take advantage of these values once they're available. [1]: DioxusLabs/blitz#1090 Imports servo/stylo#481 Differential Revision: https://phabricator.services.mozilla.com/D341385 UltraBlame original commit: e765db79469eb1200d5d480703563a386f4b9d64
github-actions Bot
pushed a commit
to servo/stylo
that referenced
this pull request
Nov 12, 2026
…s in Servo builds. r=firefox-style-system-reviewers,emilio Enables the `sideways-rl` and `sideways-lr` writing modes in Servo builds. These are still gated behind the `layout.writing-mode.enabled` pref which Servo doesn't enable. So there shouldn't be any Servo-side effect until Servo implements `writing-mode` and enables that pref. Blitz [just landed `writing-mode` support][1], and will be able to take advantage of these values once they're available. [1]: DioxusLabs/blitz#1090 Imports #481 Differential Revision: https://phabricator.services.mozilla.com/D341385
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opt-in CSS vertical
writing-modelayout for Blitz, implemented entirely at the Blitz↔Taffy boundary (Taffy stays horizontal-tb; it only gained the neutraltranspose()helpers in DioxusLabs/taffy#1265, pin bump in #1091). Everything is behind a newwriting-modecargo feature onstylo_taffy/blitz-dom/blitz, with passthrough features ondioxus-native-dom,dioxus-nativeand thebrowserapp (off by default everywhere; only thewptrunner enables it): the default build is byte-identical on the fullcss+svgWPT suites (feature off vs the samemain: 117230 → 117230 passing units, +0/−0).Design (see module docs in
blitz-dom/src/layout/writing_mode.rs): every box's layout algorithm runs in that box's own writing mode (layout_wm); Blitz translates at three seams.stylo_taffy):TaffyStyloStylecarries thelayout_wm: WritingModeit is read in; its getters map physical properties (sizes, margin/padding/border/inset rects, overflow-x/y, aspect-ratio, direction, float/clear, text-align, left/right alignment) into it through theWritingModeExtextension trait on Stylo'sWritingMode(writing_mode.rs). The helpers are always compiled with thecfg(feature)inside, so every getter has a single code path. Writing-mode-relative properties (flex-direction, grid tracks/placement/auto-flow/areas,gap) are passed through unchanged since Taffy's Row/Column are already inline/block.Node::layout_style()is the box's own writing mode;Node::layout_style_in(wm)is used by allget_*_child_style/get_oof_item_style/ inline-box / table-cell reads, withLayoutPassState::layout_wmtracking the writing mode of the running algorithm (root_wm, the root's used writing mode taken from<body>, is resolved once per pass). A pre-resolvepercent_basishandles percentage padding on orthogonal boxes (css-writing-modes-3 §7.3: resolves against the CB's inline size, while Taffy's transposedparent_size.widthis the CB's block size).compute_child_layout_in_own_wm): when a box's writing mode is orthogonal to its parent's,LayoutInputis transposed, an in-flow child of a block container drops the stretched inline size (it is the child's block size; out-of-flow boxes keep their inset-derived sizes), an auto inline size is resolved to fit-content against the CB block size / available space / ICB (§7.3.1; nearest scroll container not yet considered), and theLayoutOutputis transposed back.unrounded_layoutstays in the placing algorithm's writing mode (writing physical values back breaks on Taffy cache hits);physicalise_and_round_layoutreplacestaffy::round_layoutand convertsfinal_layoutto physical coordinates, mirroring the block axis for*-rlmodes, then rounds cumulative positions as Taffy does (each box edge rounded once). CSSOM geometry (getBoundingClientRect,offset*) goes throughBaseDocument::physical_unrounded_geometry, which walks the containing-block chain once (main's loop when no box on the chain is vertical, otherwise a single root→node descent carrying the placer's writing mode and physical size); the round pass records each node's writing mode inLayoutData.writing_modeso this needs no style borrows. Release A/B vsmain: 0.42 vs 0.43 µs per call at depth 100, 1.9 vs 2.0 µs at depth 400.Also:
layout.writing-mode.enabledStylo pref is set under the feature (Stylo otherwise drops the declaration), the root's used writing mode follows<body>per css-writing-modes-3 §8 (unlesscontainis set on<html>/<body>), table parts and replaced intrinsic sizes are converted into the table's / element's writing mode.Test results (feature enabled, full
css+svgsuites vs the samemain, subtest granularity, SKIPs excluded)Suites with any change (unit = subtest for testharness, test for reftests):
Total: 117230 → 121964 passing units (+4865 gained, 131 lost). *48 of the cssom-view "lost" are renamed subtests (
scrollWidthHeight-negative-margin-002now enumerates writing modes, same 24% pass rate).Remaining losses are code paths not yet adapted rather than bugs in the adapted ones:
abs-pos-non-replaced-v{lr,rl}-*(22): alldirection: rtl— the static position of an abspos inline following an LTR run in an RTL line resolves at the wrong end. Parley gives inline boxes the bidi level of the preceding run instead of resolving them as U+FFFC (see the TODO inparley/src/shape/mod.rs); horizontal passes only because those refs don't distinguish.border|padding-v*-00x(strut gap after an<img>in a vertical line),text-combine-upright-*,ruby-text-combine-upright-*,text-orientation-*,inline-replaced-vrl-002,available-size-011, baseline-overflow andbaseline-source-*.vertical-rlscroll origin (wm-propagation-body-scroll-offset-vertical-rl), orthogonal multicol static positions, subgrid orthogonal items,hit-test-inline-fragmentation-with-border-radius(css-break).Not covered (planned follow-ups): rotated inline painting, vertical text shaping and inline-box bidi levels (Parley),
vertical-rlscroll origin, orthogonal fit-content against a fixed-size scroll container,align-items: self-start/self-endinherited by a child with a different writing mode (Taffy resolvesalign-self: autointernally), form-control intrinsic sizes in vertical writing modes.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
WPT results
Subtests: 4926 newly passing, 73 newly failing (net +4853).
Subtest changes by area (52 areas)
Full diff (766 changed tests)
Generated by the WPT workflow.