fix(geometry): check height overflow when white-space is nowrap - #231
Merged
Merged
Conversation
LeadcodeDev
force-pushed
the
fix/geometry-text-overflow-box
branch
from
September 21, 2026 23:39
25b96c4 to
b142b14
Compare
LeadcodeDev
force-pushed
the
fix/geometry-nowrap-height
branch
from
September 21, 2026 23:39
9467962 to
da572b3
Compare
53 tasks
LeadcodeDev
force-pushed
the
fix/geometry-text-overflow-box
branch
from
September 22, 2026 06:09
53cb999 to
da0db80
Compare
LeadcodeDev
force-pushed
the
fix/geometry-nowrap-height
branch
from
September 22, 2026 06:09
7be118b to
3bc56f9
Compare
LeadcodeDev
force-pushed
the
fix/geometry-text-overflow-box
branch
from
September 22, 2026 08:33
da0db80 to
82dafe2
Compare
LeadcodeDev
force-pushed
the
fix/geometry-nowrap-height
branch
from
September 22, 2026 08:34
3bc56f9 to
c5036fe
Compare
LeadcodeDev
force-pushed
the
fix/geometry-text-overflow-box
branch
from
September 22, 2026 08:43
82dafe2 to
931a445
Compare
LeadcodeDev
force-pushed
the
fix/geometry-nowrap-height
branch
from
September 22, 2026 08:43
c5036fe to
5521bc8
Compare
LeadcodeDev
changed the base branch from
fix/geometry-text-overflow-box
to
chantier/audit-2026-09
September 22, 2026 08:52
`check_unwrappable_text` — the only check left for a nowrap node — compares width only and always emits `Axis::X` (geometry.rs:781-793). So the Y axis is unchecked for any `white-space: nowrap|pre` text. `{"type":"text","content":"Hi","style":{"font-size":"120px","white-space":"nowrap","height":"40px"}}` has a single line ~156px tall painted out of a 40px content box and validates clean; delete the `white-space` key and the identical fixture is correctly reported as `ContentOverflowsBox`/`Axis::Y` (proved by the existing test `wrapped_text_taller_than_its_fixed_height_card_is_flagged`, geometry.rs:2806). The stated rationale only justifies skipping the *wrap-dependent* width re-measure; a nowrap node's height is exactly one `line_height` and needs no wrapping to compute.
Refs #220
LeadcodeDev
force-pushed
the
fix/geometry-nowrap-height
branch
from
September 22, 2026 08:59
5521bc8 to
6a84dde
Compare
LeadcodeDev
added a commit
that referenced
this pull request
Sep 22, 2026
`check_unwrappable_text` — the only check left for a nowrap node — compares width only and always emits `Axis::X` (geometry.rs:781-793). So the Y axis is unchecked for any `white-space: nowrap|pre` text. `{"type":"text","content":"Hi","style":{"font-size":"120px","white-space":"nowrap","height":"40px"}}` has a single line ~156px tall painted out of a 40px content box and validates clean; delete the `white-space` key and the identical fixture is correctly reported as `ContentOverflowsBox`/`Axis::Y` (proved by the existing test `wrapped_text_taller_than_its_fixed_height_card_is_flagged`, geometry.rs:2806). The stated rationale only justifies skipping the *wrap-dependent* width re-measure; a nowrap node's height is exactly one `line_height` and needs no wrapping to compute.
Refs #220
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.
Severity Low, category correctness. Location:
crates/rustmotion/src/cli/commands/geometry.rs:844Impact
check_unwrappable_text— the only check left for a nowrap node — compares width only and always emitsAxis::X(geometry.rs:781-793). So the Y axis is unchecked for anywhite-space: nowrap|pretext.{"type":"text","content":"Hi","style":{"font-size":"120px","white-space":"nowrap","height":"40px"}}has a single line ~156px tall painted out of a 40px content box and validates clean; delete thewhite-spacekey and the identical fixture is correctly reported asContentOverflowsBox/Axis::Y(proved by the existing testwrapped_text_taller_than_its_fixed_height_card_is_flagged, geometry.rs:2806). The stated rationale only justifies skipping the wrap-dependent width re-measure; a nowrap node's height is exactly oneline_heightand needs no wrapping to compute.Fix
Instead of returning early on
nowrap, measure with(AvailableSpace::MaxContent, AvailableSpace::Definite(ch))and report only the Y axis (leave X tocheck_unwrappable_text), so a single unwrapped line taller than its box is still caught.Evidence the audit read
Part of the September 2026 audit remediation chantier. Refs #220 (RM-32).