Skip to content

fix: preserve caret paint room during field motion - #4442

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-4428
Oct 27, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-4428

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Field motion was replacing the editor's normal 2px caret margin with its travel distance, including zero. That cut off Firefox's line-end caret while the comment box grew. The shared motion now preserves at least 2px in the overflow clip and leaves the same inline room in its moving content clip, preserving the box and word motion from #4326 and #4379.

The regression now holds the last moving frame and measures both clips, so animation cleanup cannot conceal the failure. It fails against the old motion code and passes with this change in Firefox and Chromium. The panel's word/mark growth-and-shrink and below-cap deletion checks pass, as do all 682 runtime tests and the browser build check. The kernel is regenerated.

Closes #4428 — automated triage

Keep the field caret margin in both the overflow clip and the moving content clip. Hold the regression at the last moving frame so animation cleanup cannot hide the failure. Preserve the shared growth and shrink motion from #4379 and #4326.

Closes #4428
@leaf-agent
leaf-agent merged commit b6e25be into main Oct 27, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4428 branch October 27, 2026 10:56
leaf-agent added a commit that referenced this pull request Oct 30, 2026
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

Co-authored-by: leaf-agent <[email protected]>
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.

Firefox field caret has no reserved space at the line end

1 participant