Bug 519974 When we use IME, ASSERTION is printed at each key input (ASSERTION: nsEditor doesn't support wide caret: 'selectionStart == selectionEnd', editor/libeditor/base/IMETextTxn.cpp line 322 r=smichaud
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 23 Jun 2010 15:05:51 +0900
changeset 44169 59a7a98a5a6b940d60af9a9228fd50167448d759
parent 44168 fe16c033cfa77d3d9033284ca7b728559d627bc6
child 44170 38c6287d66820f1121925cf6ef694f53e0d8133c
push id14007
push usermasayuki@d-toybox.com
push dateWed, 23 Jun 2010 06:10:45 +0000
treeherdermozilla-central@59a7a98a5a6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs519974
milestone1.9.3a6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 519974 When we use IME, ASSERTION is printed at each key input (ASSERTION: nsEditor doesn't support wide caret: 'selectionStart == selectionEnd', editor/libeditor/base/IMETextTxn.cpp line 322 r=smichaud
widget/src/cocoa/nsChildView.mm
--- a/widget/src/cocoa/nsChildView.mm
+++ b/widget/src/cocoa/nsChildView.mm
@@ -418,19 +418,18 @@ ConvertAttributeToGeckoRange(NSAttribute
     aRanges[i].mStartOffset = effectiveRange.location;                         
     aRanges[i].mEndOffset = NSMaxRange(effectiveRange);                         
     aRanges[i].mRangeType = UnderlineAttributeToTextRangeType([attributeValue intValue], selRange); 
     limitRange = NSMakeRange(NSMaxRange(effectiveRange), 
                              NSMaxRange(limitRange) - NSMaxRange(effectiveRange));
     i++;
   }
   // Get current caret position.
-  // Caret is indicator of insertion point, so mEndOffset = 0.
   aRanges[i].mStartOffset = selRange.location + selRange.length;                         
-  aRanges[i].mEndOffset = 0;                         
+  aRanges[i].mEndOffset = aRanges[i].mStartOffset;                         
   aRanges[i].mRangeType = NS_TEXTRANGE_CARETPOSITION;
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 static void
 FillTextRangeInTextEvent(nsTextEvent *aTextEvent, NSAttributedString* aString, NSRange markRange, NSRange selRange)
 {