Skip to content

Fix spurious ~34px horizontal scroll on csskit.rs (bump taffy) - #727

Merged
nicoburns merged 1 commit into
mainfrom
devin/1786922561-fix-spurious-horizontal-scroll
Aug 16, 2026
Merged

Fix spurious ~34px horizontal scroll on csskit.rs (bump taffy)#727
nicoburns merged 1 commit into
mainfrom
devin/1786922561-fix-spurious-horizontal-scroll

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

https://csskit.rs showed a spurious ~34px horizontal scroll at a 1200px viewport. Root cause: taffy's block/grid (and flexbox) algorithms unconditionally added a container's own end-side padding to its content_size, even for boxes that are not scroll containers. The page's footer (a padded block whose child <p> has negative horizontal margins pulling it into the padding) reported content_size.width = 1234, which propagated to the root and made the document scrollable (scroll_width = 34).

Fixed upstream in DioxusLabs/taffy#1114: end-side padding is now only included in content_size when the container is a scroll container, matching browser scrollable-overflow semantics. This PR bumps the taffy rev to pick that up (the pinned rev is the fix commit on the PR branch; can be re-pinned once the taffy PR merges), and adapts to taffy's LayoutOutput::first_baselinesbaselines: Baselines rename that landed on taffy main in between:

// packages/blitz-dom/src/layout/{mod,inline}.rs
- first_baselines: Point { x: None, y: first_baseline },
+ baselines: taffy::Baselines::from_first(first_baseline),

Verified with the screenshot example: the csskit.rs root goes from content_size=1234x3246, scroll_width=34 to content_size=1200x3246, scroll_width=0, with rendering unchanged. cargo test --workspace, clippy and fmt pass.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/b6f5529e9a3e4823b603788b475ab109
Requested by: @nicoburns

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

Bump taffy to pick up the fix that only includes a container's own
end-side padding in its content_size when the container is a scroll
container. Ordinary padded boxes no longer propagate spurious overflow
to the viewport (e.g. the ~34px horizontal scroll on csskit.rs).

Also adapt to taffy's LayoutOutput::baselines API rename.
@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns merged commit e22327c into main Aug 16, 2026
15 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