Baseline-align in-flow atomic inlines via Parley's InlineBox::baseline - #750
Open
nicoburns wants to merge 10 commits into
Open
Baseline-align in-flow atomic inlines via Parley's InlineBox::baseline#750nicoburns wants to merge 10 commits into
nicoburns wants to merge 10 commits into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
staging-devin-ai-integration
Bot
changed the base branch from
devin/1786754807-taffy-last-baseline
to
main
August 18, 2026 23:32
staging-devin-ai-integration
Bot
force-pushed
the
devin/1787089158-inline-box-baseline-721
branch
from
August 19, 2026 00:33
9a874e1 to
54cabab
Compare
…tive-leading fixes - Inline-block uses its last in-flow line box baseline, but inline flex/grid containers use their first baseline per css-align. - Bump parley to DioxusLabs/parley#10 which fixes clamping of negative half-leading in line extents and adds opt-in CSS2 \u00a7 10.8 line-box strut support; enable the strut in Blitz's inline layout. - With an explicit baseline, an inline box's line-height contribution may legitimately be negative, so only clamp reserved space for bottom-aligned boxes, and position baseline-aligned boxes from the top of their margin box.
Enabling the strut regressed ~200 WPT tests whose references use vertical-align: top images to suppress the descender gap below baseline-aligned images, which Blitz cannot yet honor.
…le flex/grid baselines from content
staging-devin-ai-integration
Bot
force-pushed
the
devin/1787089158-inline-box-baseline-721
branch
from
August 19, 2026 11:45
54cabab to
45b4b4b
Compare
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
Wires Taffy's baseline output through to Parley's
InlineBox::baselineso in-flow atomic inlines are baseline-aligned per CSS instead of bottom-edge aligned, and bumps Parley to DioxusLabs/parley#7 (rev95a9ff1, which includes DioxusLabs/parley#10) for line-metrics fixes plusvertical-align: top/bottomsupport.In
compute_inline_layout, when updating each in-flow inline box from its Taffy layout output:Taffy baselines are measured from the top border edge; Parley expects the baseline relative to the top of the inline box (which here is the margin box, since
ibox.width/heightinclude margins), hencemargin.top + b. Thebaselines.lastvalues are populated by the Taffy last-baseline work (#721), whose commits are included in this PR now that it targetsmain.Two adjustments to existing negative-vertical-margin handling now that boxes can carry a baseline:
ibox.height) is only clamped to>= 0for bottom-aligned boxes (no baseline); with an explicit baseline the ascent/descent contributions may legitimately be negative (e.g.margin-top: -20emon an inline-flex).ibox.yis the margin-box top (Parley places it atline_baseline - baseline), so the border box goes atibox.y + margin.top(unclamped); bottom-aligned boxes keep the previousmargin.top.max(0.0)bottom-anchoring.Parley bump to
95a9ff1(DioxusLabs/parley#7, on top of #10) brings:line-height-*tests below).builder.set_compute_strut(true).InlineBox::vertical_align(InlineBoxVerticalAlign::{Baseline, Top, Bottom}). Blitz maps the computedbaseline-shiftlonghand (the stylo longhand behindvertical-align: top/bottom) to it:With
vertical-align: top/bottomsupported, the strut no longer regresses the ~200 tests whose references usevertical-align: topimages (spot-checkedwidth-006.xht,inline-replaced-width-001.xht,float-003.xht,width-percentage-001.xht,background-size-025.html: all pass locally with strut + vertical-align).append_inline_box_to_linesignature changed; out-of-flow floated boxes now passalignment: None.WPT results
CI's full-suite run vs
mainreports 142 newly passing / 50 newly failing (net +92) (full diff in the generated section below). All 50 were re-verified locally (each passes onmainat 10606cc and failed on this branch before the latest commits) and triaged. 8 of the 50 are fixed by the latest commits; the remainder cluster as follows.Fixed in this PR (8)
contain-layout-baseline-001/005,contain-layout-flexbox-001,contain-layout-grid-001: layout containment must suppress the box's baseline (css-contain §3 "no baseline"). Blitz now checks the computedcontainvalue forlayout(also covered bystrict/content) and passesbaseline: Nonefor such atomic inlines.baseline-of-scrollable-1a: a scrollable inline flex/grid container still takes its baseline from its content (as if not scrolled), clamped to the border box (css-align §9.1 / Not clamping baseline position when scrollable overflow gives weird results w3c/csswg-drafts#7660) — only inline-block scroll containers synthesize from the bottom margin edge. Blitz now clampsoutput.baselines.firstto[0, height]for flex/grid scroll containers instead of dropping it.floats-141.xht(fixed in an earlier commit): 1px glyph shift from a fractional inline-box baseline;ibox.baselineis now rounded to physical pixels.flexbox-baseline-multi-line-horiz-004.html,grid-baseline-001.html: fixed by bumping Taffy to pick up Flexbox: fix container baseline for column-reverse containers taffy#1127 (wrap-reverse container baseline from the visually startmost line) and Grid: exclude items with auto block-axis margins from baseline alignment taffy#1125 (items with auto block-axis margins don't participate in grid baseline alignment).Upstream Taffy baseline gaps (3 remaining)
Three Taffy fixes landed upstream (DioxusLabs/taffy#1125, #1127, #1126) and this PR's Taffy pin was bumped to a merge of taffy
maininto the last-baseline branch (8c49a27f), which fixedflexbox-baseline-multi-line-horiz-004andgrid-baseline-001(see above). Still failing:baseline-block-with-overflow-001.html,baseline-of-scrollable-1b.html: taffy#1126 added block scroll-container baseline clamping/synthesis, but these still fail because Blitz's inline layout doesn't feed Taffy block-child baselines into inline-block vertical alignment for these structures (the tests wrap the scrollable boxes so the relevant baseline propagation is only partially exercised).flexbox-baseline-multi-line-vert-002.html: the vertical-writing-mode variant additionally depends on the CSS2 strut interaction (see next section).Spurious base passes exposed by parley#10's nbsp fix (5)
inline-block-zorder-002/004/005.xht,inline-table-zorder-001.xht,inline-table-width-002b.xht: onmain, any element whose text content is only renders completely blank (even its background), so these tests compared blank-vs-blank and "passed". Parley update to sync with master branch of Dioxus #10 fixes nbsp handling, so this PR actually renders them, exposing pre-existing issues: the zorder tests fail on paint order (a later sibling block's background, pulled up via negative margin, is painted over earlier inline-block/inline-table content, contra CSS2 Appendix E);inline-table-width-002badditionally involves an unrenderedinline-table, with test/ref differing only in line spacing around the invisible box.CSS2 line-box strut interactions (12) — pass again with
set_compute_strut(false)list-style(-image/-type)-applies-to-012/014.xht(6 tests),contain-size-flexbox-002.html,font-colorization.html,intrinsic-percent-replaced-008.html,intrinsic-percent-replaced-dynamic-005.html,abs-pos-with-replaced-child.html, and (combined with the baseline wiring)flexbox-baseline-multi-line-vert-002.html.The strut itself is spec-correct (CSS2 §10.8) and is what fixes the much larger set of
vertical-align: topreference mismatches; these failures are cases where the strut interacts with other Blitz gaps rather than the strut being wrong. E.g. theliststests wrap a zero-height list-item inside an inline-block: the strut now reserves a full line for the otherwise-empty line box containing the zero-height inline box, pushing the outside marker one line below where the (strut-less) reference paints it — proper handling needs marker boxes to participate in the line like browsers do. Theintrinsic-percent-replaced/abs-pos-with-replaced-childrefs contain text next to replaced elements whose heights now differ by the strut's leading. Individual fixes here are follow-up work in Blitz's marker/replaced-element line handling, not in this PR's wiring.Parley 0.11.1 → git-main upgrade behavior changes (27) — fail regardless of strut/baseline wiring
These remain failing with the strut disabled and the baseline wiring neutralized, so they come from the Parley upgrade itself (new CSS2 per-side line metrics from linebender/parley#639, nbsp now rendering, changed trailing-whitespace/hanging behavior), or from pre-existing Blitz issues newly exposed by it:
css-ruby/br-clear-all-000,empty-ruby-base-container,empty-ruby-text-container-abs/-float,ruby-base-container-abs/-float— empty ruby structures now contribute line height where they previously collapsed.trailing-ideographic-space-013/014,hanging-whitespace-002.tentative,full-width-leading-spaces-004,hanging-punctuation-first-002— parley main changed trailing-space hang/measurement behavior (nearby siblings of these tests start passing, so it's a behavior trade within the same feature).font-family-applies-to-005,font-feature-settings-tibetan,small-caps-letter-spacing-002,font-colorization— shaping/metrics changes in parley main (several other shaping tests start passing).floats-149.xht: the green block collapses to zero height — its only in-flow content is an empty inline whose children are floats; a line box containing only an empty inline + floats no longer contributes height under the new line-metrics model (CSS2 §9.4.2 empty-inline handling needed).empty-span-size-002.html: empty spans' contribution to line height changed with the new per-side line metrics.t41-html4-keywords-a,contain-animation-001,custom-highlight-painting-inheritance-001/002,text-decoration-skip-spaces-001,css-break/ruby-003— small text-position shifts from the new line metrics cause these paint-comparison tests to mismatch.grid-layout-auto-tracks,column-subgrid-grid-gap-008— content-sized track sizing shifted by the changed text-line heights.Note:
flexbox-baseline-multi-item-horiz-001a.html-style tests still fail, but for orthogonal reasons (synthesized baselines of empty/no-text flex items), not the inline-box wiring.WPT results
142 newly passing, 43 newly failing (net +99).
Full diff (185 changed tests)
Generated by the WPT workflow.
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/3817a3c1194f47afbc30e587ba79678f
Requested by: @nicoburns