Fix clamping of negative half-leading in line extents - #9
Open
nicoburns wants to merge 1 commit into
Open
Conversation
Extents now default to f32::NEG_INFINITY so legitimately negative extents (line-height < ascent + descent) are preserved; lines with no extent contributions are resolved to zero in finish_line. Out-of-flow inline boxes no longer contribute (0, 0) extents.
🤖 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 was referenced Aug 12, 2026
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 (code and description) was authored by Devin, directed and reviewed by @nicoburns.
Bottom PR of the stack (#9 → #10 → #7).
When
line-height < ascent + descent, half-leading is negative and a line'sover/underextents are legitimately negative — butExtents::default()was{over: 0, under: 0}, somax()floored them at zero and lines rendered too tall (e.g.line-height: 0still produced a full-height line). This fixes thecss/CSS2/linebox/line-height-*WPT cluster (Group B in DioxusLabs/blitz#627).Extents::default()→f32::NEG_INFINITY(as the old code comment anticipated);finish_lineresolves lines with no extent contributions back toExtents::ZERO, keepingbuilders_emptyNaN-free.text_extents(ascent, descent, line_height, quantize) -> Extents.BreakerState::append_inline_box_to_line(next_x, Option<InlineBoxAlignment>, quantize):None(out-of-flow boxes) contributes nothing — previously their(0.0, 0.0)contribution silently clamped negative extents.finish_linecomputes and returns the final line height instead of receiving it precomputed.Changelog
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/6ab608fbe6fb46479d6dab03fedceb25