Skip to content

fix: measure narrow-field caret before hanging whitespace - #4767

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4755
Oct 30, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4755

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The narrow-field caret check treated a trailing space's DOM Range edge as the painted caret. With pre-wrap, that space can hang outside the line while Chromium pulls its native caret back inside. The CI screenshot shows the caret inside the field despite the −2.421875px Range reading.

The test now moves left across the trailing space before measuring, checking the caret beside the final ink. It keeps both engines, the narrow allocation, the clipping assertion, and the held final-motion frame from #4442. No runtime geometry changes.

The original Chromium case passes immediately before #4714 and fails at that change, which deliberately gives draft words Send's column under a mouse. It also fails on current main with the reported −2.421875px reading. Both Chromium and Firefox cases pass with this correction. This preserves #4714's layout choice rather than reserving extra room to satisfy a Range measurement.

Closes #4755 — automated triage

The Range after a hanging pre-wrap space extends beyond Chromium’s painted native caret. Check the last ink instead, retaining the narrow field and final-motion clipping coverage in both engines. The original case passes before #4714 and fails at that change; preserve its deliberate full-width draft layout.

Closes #4755
@leaf-agent
leaf-agent merged commit ad253a2 into main Oct 30, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4755 branch October 30, 2026 10:49
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.

Browser comment caret extends beyond its clipping edge

1 participant