Closed Bug 1677684 Opened 4 years ago Closed 4 years ago

[Cocoa] Candidate list of Apple Japanese IME may show at wrong position when undoing the last commit

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

Desktop
macOS
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

(Keywords: inputmethod)

Attachments

(2 files)

STR:
0. Activate Apple Japanese Input and disable Live conversion

  1. Go to https://d-toybox.com/studio/lib/input_event_viewer.html
  2. Choose "<div contenteditable>" radio button
  3. Type a word in the HTML editor and commit it
  4. Reconvert it with Ctrl + Shift + R (without changing selection)

Then, you may see candidate list at wrong position.

According to the log, FirstRectForCharacterRange tries to retrieve first character of new composition before starting composition, and fails to get it due to not in ContentCacheInParent. So, we need some hack for this case.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED

Currently, it manages the composition start offset with uint32_t and setting
it to UINT32_MAX when there is no composition. But this is now rewritable
with Maybe<uint32_t> for easier to read.

Usually, IME sets selection and considers candidate list position at starting
new composition. However, Apple Japanese IME sometimes consider the candidate
list position at retrieving the character rects before setting selection.
Therefore, we need to store last commit string's character rects, but don't
need to store it in long time because Kakutei-Undo is supported by Japanese
IMEs and they work only immediately after committing a composition. E.g.,
after moving caret, it won't be available.

Depends on D97838

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/ea83d6666b32
part 1: Make `ContentCache` manage composition start offset with `Maybe` instead of using a magic number r=m_kato
https://hg.mozilla.org/integration/autoland/rev/0e1c1a720ca7
part 2: Make `ContentCache` cache character rects in last commit composition string for undoing the commit r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
QA Whiteboard: [qa-85b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: