Propagate body overflow to the viewport - #716
Open
nicoburns wants to merge 2 commits into
Open
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:
|
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
Per CSS overflow propagation, when the root element's overflow is
visible, the<body>'s overflow is propagated to the viewport and the body's used overflow isvisible— it must not become a scroll container or clip its own content. Blitz previously only special-cased the root element, sobody { overflow: hidden }made the body itself a clipping scroll container, breaking e.g. percentagemax-heightresolution inflexbox-definite-sizes-003/004.Changes:
BaseDocument::viewport_overflow_propagation_source()— returns the element whose overflow is propagated to the viewport: the root element if its overflow is non-visible, otherwise the<body>. Any containment (contain!= none) on the root or the body suppresses propagation entirely (per css-contain-2; coverscss/css-contain/contain-{body,html}-overflow-*).flush_styles_to_layoutresets that element's TaffyoverflowtoVisible(andscrollbar_widthto 0) after style flush, so layout treats it as non-scrollable.blitz-paint's clip logic keys clipping suppression off the propagation source instead of unconditionally exempting the root element (a contained root now clips its own overflow, e.g.contain-html-overflow-002).WPT results (release runner):
css/css-flexbox: 805 → 807 passing (flexbox-definite-sizes-003/004fixed), no regressions.css/css-overflow: +5 (overflow-body-propagation-007/008/009/016,scrollable-overflow-with-nested-elements-005), no regressions.css/css-contain:contain-body-overflow-003/004andcontain-html-overflow-001..004kept passing via the containment exception (contain-body-overflow-002andcontain-layout-ink-overflow-013/015fail on main too).Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/17cea825d78643e298cf44b2ef9f6680
Requested by: @nicoburns
WPT results
28 newly passing, 7 newly failing (net +21).
Full diff (35 changed tests)
Generated by the WPT workflow.