Closed
Bug 1028485
Opened 10 years ago
Closed 10 years ago
Assertion failure: setCaret, "Failed to collapse normal selection"
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: masayuki, Assigned: masayuki)
Details
(Keywords: assertion)
Attachments
(1 file, 1 obsolete file)
8.75 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/base/IMETextTxn.cpp#235
> 235 // NOTE: If the caret position is larger than max length of the editor
> 236 // content, this may fail.
> 237 rv = selection->Collapse(mElement, mOffset + textRange.mStartOffset);
> 238 setCaret = setCaret || NS_SUCCEEDED(rv);
> 239 NS_ASSERTION(setCaret, "Failed to collapse normal selection");
When <input> has specific maxlength value, all of or a part of composition string may be cut at committed. Then, the caret position may be out of text. Then, it hits this assertion.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8444432 -
Attachment is obsolete: true
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8444462 [details] [diff] [review]
Patch
This patch ensures that caret position and range offsets must be in the range of the actual inserted string.
When inserting string is truncated by maxlength attribute, mStringToInsert is truncated by the ranges information which comes from widget are not shrunken by it. Therefore, IMETextTxn needs to check mStringToInsert at setting selection/caret.
Attachment #8444462 -
Flags: review?(ehsan)
Updated•10 years ago
|
Attachment #8444462 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•