Skip to content

Exclude the trailing empty line after a final forced break from the last baseline - #946

Merged
nicoburns merged 1 commit into
mainfrom
devin/1790388547-inline-box-baseline
Sep 28, 2026
Merged

nicoburns merged 1 commit into
mainfrom
devin/1790388547-inline-box-baseline

Conversation

@nicoburns

@nicoburns nicoburns commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

#832 already made inline boxes export their baseline. This PR is what's left of the original change: one fix to the last baseline reported by inline layout.

When inline content ends in a forced line break (e.g. X<br>), Parley still emits an empty line after it, for text-editor semantics. #939 already leaves that line out of the measured height. But last_baseline was still taken from lines().last(), which is that empty line. So an inline-block ending in <br> was positioned one line too low relative to the text beside it.

// before
last_baseline = lines().last().map(line_baseline)
// after: skip the trailing empty line detected by the #939 check
last_baseline = layout.get(trailing_empty_line.unwrap_or(line_count) - 1).map(line_baseline)

Tests

  • Added tests/blitz-tests/tests/inline_box_baseline.rs with four tests. trailing_br_does_not_move_last_baseline fails on main. The other three cover inline-block baseline alignment that main already handles correctly: single line, last line of a multi-line box, and a scroll container falling back to its bottom margin edge.
  • WPT on css/CSS2, css-inline, css-align, css-flexbox, css-grid, css-tables and css-display: identical results before and after (7043 tests / 26035 subtests passing).

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

WPT results

Subtests: 1 newly passing, 0 newly failing (net +1).

Full diff (1 changed tests)
+ FAIL => PASS  [1/1]  +1  css/css-text/letter-spacing/letter-spacing-end-of-line-002.html

Generated by the WPT workflow.

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

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

@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1790388547-inline-box-baseline branch from 34ba910 to 591e041 Compare September 26, 2026 02:28
@staging-devin-ai-integration staging-devin-ai-integration Bot changed the title Align atomic inline boxes by their exported baseline Exclude the trailing empty line after a final forced break from the last baseline Sep 28, 2026
@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1790388547-inline-box-baseline branch from 591e041 to 2a72f0c Compare September 28, 2026 21:35
@nicoburns
nicoburns merged commit c95f92d into main Sep 28, 2026
16 checks passed
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