Closed Bug 1184533 Opened 7 years ago Closed 6 years ago
[IMM] ASSERTION: offset is less than cursor
Position!: 'offset >= cursor Position'
When I type first character in empty editor in IMM mode, I see this assertion: ASSERTION: offset is less than cursorPosition!: 'offset >= cursorPosition' Looks like that this assertion and following code ensure that the offset is in composition string. However, this must be a simple mistake.
Comment on attachment 8635107 [details] [diff] [review] Rewrite range check in aOffset of nsIMM32Handler::GetCharacterRectOfSelectedTextAt() Let's check if the querying offset is in composition string or selected string with clearer code. We can return any character's rect (without e10s), the caller (or active IME) must be buggy if the offset is out of the composition/selected string.
Attachment #8635107 - Flags: review?(VYV03354)
Comment on attachment 8635107 [details] [diff] [review] Rewrite range check in aOffset of nsIMM32Handler::GetCharacterRectOfSelectedTextAt() Oops, I realized that this could be simpler. if aOffset is 0, we don't need complicated check.
Attachment #8635107 - Flags: review?(VYV03354) → review-
When there is a composition, normal selection is the caret in the composition string. So, the method's base offset should be computed with mIsComposing. If the selected length (or composition string when mIsComposing == true) is collapsed and the offset is same as the caret offset, we should return caret rect. Otherwise, the character rect at the offset.
Merged with the latest m-c.
Attachment #8638406 - Flags: review?(VYV03354) → review+
url: https://hg.mozilla.org/integration/mozilla-inbound/rev/e7549c25cfcd77273abd493fa923183367fbfc40 changeset: e7549c25cfcd77273abd493fa923183367fbfc40 user: Masayuki Nakano <firstname.lastname@example.org> date: Sun Jul 26 12:29:47 2015 +0900 description: Bug 1184533 Rewrite range check in aOffset of nsIMM32Handler::GetCharacterRectOfSelectedTextAt() r=emk
You need to log in before you can comment on or make changes to this bug.