Bug 286961

Summary: caret positioning is broken in vertical writing modes
Product: WebKit Reporter: fantasai <fantasai.bugs>
Component: HTML EditingAssignee: fantasai <fantasai.bugs>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cp%20style%3D%22height%3A%205em%3B%20border%3A%20solid%20gray%3B%20writing-mode%3A%20vertical-rl%22%20contenteditable%3EThis%20is%20some%20vertical%20text%20that%20you%20can%20select%20and%20edit.
Bug Depends on: 287533    
Bug Blocks: 49408, 286725    

fantasai
Reported 2025-02-03 14:45:32 PST
Overview: Carets aren't drawn correctly in vertical writing modes such as `vertical-rl` and `sideways-rl`. The insertion point seems to be correct, though. Steps to Reproduce: 1. Create or open a testcase with editable vertical text (such as the URL in this bug report). 2. Try to place the caret near the beginning of the 2nd or 3rd line. 3. Try typing some text at that point. Actual Results: Although the insertion point is identified correctly, the caret is drawn further down from the actual insertion point. Expected Results: Caret position and insertion point match, and are as close as possible to the click point.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-02-03 14:46:10 PST
fantasai
Comment 2 2025-02-03 15:29:27 PST
fantasai
Comment 3 2025-02-05 15:53:23 PST
EWS
Comment 4 2025-02-13 20:00:42 PST
Committed 290387@main (12e65d787eb0): <https://commits.webkit.org/290387@main> Reviewed commits have been landed. Closing PR #40087 and removing active labels.
fantasai
Comment 5 2025-02-13 22:19:22 PST
Accidentally tagged this issue in the commit for https://github.com/WebKit/WebKit/pull/40087 instead of tagging the correct issue https://bugs.webkit.org/show_bug.cgi?id=286725 :(((( Reopening. This bug is associated with https://github.com/WebKit/WebKit/pull/39939 only.
fantasai
Comment 6 2025-02-13 22:22:36 PST
And that PR is held up on the fix causing an accessibility regression. It's possible accessibility is hacking around the bug, and this regresses it somehow. (It's pretty obvious the existing code in that function is incorrect, since it's adding x and y coordinates together in vertical writing modes.)
EWS
Comment 7 2025-02-14 12:40:11 PST
Committed 289651.119@safari-7621-branch (d9a4868aa344): <https://commits.webkit.org/289651.119@safari-7621-branch> Reviewed commits have been landed. Closing PR #2604 and removing active labels.
fantasai
Comment 8 2025-03-04 21:04:58 PST
*** This bug has been marked as a duplicate of bug 283620 ***
Note You need to log in before you can comment on or make changes to this bug.