Closed Bug 1184533 Opened 7 years ago Closed 6 years ago

[IMM] ASSERTION: offset is less than cursorPosition!: 'offset >= cursorPosition'

Categories

(Core :: Widget: Win32, defect)

x86
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Attachments

(1 file, 2 obsolete files)

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.
Attachment #8635107 - Attachment is obsolete: true
Attachment #8635710 - Flags: review?(VYV03354)
Merged with the latest m-c.
Attachment #8635710 - Attachment is obsolete: true
Attachment #8635710 - Flags: review?(VYV03354)
Attachment #8638406 - Flags: review?(VYV03354)
Attachment #8638406 - Flags: review?(VYV03354) → review+
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/e7549c25cfcd77273abd493fa923183367fbfc40
changeset:  e7549c25cfcd77273abd493fa923183367fbfc40
user:       Masayuki Nakano <masayuki@d-toybox.com>
date:       Sun Jul 26 12:29:47 2015 +0900
description:
Bug 1184533 Rewrite range check in aOffset of nsIMM32Handler::GetCharacterRectOfSelectedTextAt() r=emk
https://hg.mozilla.org/mozilla-central/rev/e7549c25cfcd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.