Issue 3273: TextInputController::firstRectForCharacterRange not implemented
http://code.google.com/p/chromium/issues/detail?id=3273

New issue report by [EMAIL PROTECTED]:
The implementation of TextInputController::firstRectForCharacterRange in
the test shell does not return an array as expected by the layout test

   LayoutTests\editing\selection\move-left-right.html

TextInputController::firstRectForCharacterRange calls  
WebTextInputImpl::FirstRectForCharacterRange which does nothing.

Also TextInputController::selectedRange returns a string but it looks like
it should return an array as well.

This is the Objective-C implementation from  
http://trac.webkit.org/browser/trunk/WebKitTools/DumpRenderTree/mac/TextInp
utController.m

- (NSArray *)selectedRange
{
     NSObject <NSTextInput> *textInput = [self textInput];

     if (textInput) {
         NSRange range = [textInput selectedRange];
         return [NSArray arrayWithObjects:[NSNumber
numberWithUnsignedInt:range.location], [NSNumber
numberWithUnsignedInt:range.length], nil];
     }

     return nil;
}


- (NSArray *)firstRectForCharactersFrom:(int)from length:(int)length
{
     NSObject <NSTextInput> *textInput = [self textInput];

     if (textInput) {
         NSRect rect = [textInput
firstRectForCharacterRange:NSMakeRange(from, length)];
         if (rect.origin.x || rect.origin.y || rect.size.width ||
rect.size.height) {
             rect.origin = [[webView window]
convertScreenToBase:rect.origin];
             rect = [webView convertRect:rect fromView:nil];
         }
         return [NSArray arrayWithObjects:
                     [NSNumber numberWithFloat:rect.origin.x],
                     [NSNumber numberWithFloat:rect.origin.y],
                     [NSNumber numberWithFloat:rect.size.width],
                     [NSNumber numberWithFloat:rect.size.height],
                     nil];
     }

     return nil;
}



Issue attributes:
        Status: Unconfirmed
        Owner: [EMAIL PROTECTED]
        Labels: Type-Bug Pri-2 OS-All Area-Misc

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/chromium-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to