Respect text-wrap-mode when line breaking around inline boxes - #16
Open
nicoburns wants to merge 1 commit into
Open
Respect text-wrap-mode when line breaking around inline boxes#16nicoburns wants to merge 1 commit into
nicoburns wants to merge 1 commit into
Conversation
🤖 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.
LLM Contributions: This PR was written by Devin (analysis, code, and description).
Fixes 10 WPT css-flexbox reftests in Blitz (
flexbox_flex-{0,1,N}-0-{N,Npercent,auto}-shrink.htmlandflexbox_flex-basis.html) whose reference pages usewhite-space: nowrapon a block containing only adjacentinline-blockspans. Parley wrapped the boxes anyway.Two problems:
TextWrapMode::NoWrap.LineState::text_wrap_mode) is only updated lazily from text clusters, so in a layout containing only inline boxes and no text it stays at the defaultWrapand the container'snowrapnever takes effect.Fix:
LayoutData::default_text_wrap_mode, set from the first resolved style inbuild_into_layoutand overridden byTreeBuilder::build_intowith the tree root style's wrap mode (with no text, the style table only contains a synthesized default style, so the root style must be taken from the tree builder).BreakerState.line.text_wrap_modefrom it inBreakLines::new, and only mark a break opportunity after an inline box when the current wrap mode isWrap.calculate_content_widths, so the min-content width of nowrap box-only content is the sum of box widths rather than the max.Verified against Blitz's WPT runner (same change applied to parley 0.10 via a Cargo patch override):
css/css-flexboxpass count goes 654 → 664 with zero regressions.Changelog
Link to Devin session: https://app.devin.ai/sessions/844c19c6f8394d5bbb88b577c1f0558e
Requested by: @nicoburns