Changeset 23926 in webkit
- Timestamp:
- Jul 2, 2007 12:42:02 AM (17 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r23924 r23926 1 2007-07-02 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Justin. 4 5 Fix for 6 <rdar://problem/5290113> WebKit does not correctly handle replacement ranges from the IM in -[WebHTMLView insertText:] 7 http://bugs.webkit.org/show_bug.cgi?id=13664 8 9 We replicate the logic of -[WebHTMLView setMarkedText:selectedRange:] to handle the Input Method 10 feeding us a replacement string through insertText: so we can handle IMs that use insertText to 11 replace text. 12 13 * WebView/WebHTMLView.mm: 14 (-[WebHTMLView insertText:]): 15 1 16 2007-07-01 Oliver Hunt <oliver@apple.com> 2 17 -
trunk/WebKit/WebView/WebHTMLView.mm
r23924 r23926 5476 5476 // We don't support inserting an attributed string but input methods don't appear to require this. 5477 5477 NSString *text; 5478 if ([string isKindOfClass:[NSAttributedString class]]) 5478 bool isFromInputMethod = [self hasMarkedText]; 5479 if ([string isKindOfClass:[NSAttributedString class]]) { 5479 5480 text = [string string]; 5480 else 5481 // We deal with the NSTextInputReplacementRangeAttributeName attribute from NSAttributedString here 5482 // simply because it is used by at least one Input Method -- it corresonds to the kEventParamTextInputSendReplaceRange 5483 // event in TSM. This behaviour matches that of -[WebHTMLView setMarkedText:selectedRange:] when it receives an 5484 // NSAttributedString 5485 NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:NULL inRange:NSMakeRange(0, [text length])]; 5486 if (rangeString) { 5487 [[self _bridge] selectNSRange:NSRangeFromString(rangeString)]; 5488 isFromInputMethod = YES; 5489 } 5490 } else 5481 5491 text = string; 5482 5492 … … 5492 5502 // another way to determine if the call is from the input method 5493 5503 bool shouldSaveCommand = parameters && parameters->shouldSaveCommand; 5494 bool isFromInputMethod = [self hasMarkedText];5495 5504 if (event && shouldSaveCommand && !isFromInputMethod) { 5496 5505 KeypressCommand command;
Note: See TracChangeset
for help on using the changeset viewer.