Bug 138223

Summary: Long spins under rangeExpandedAroundPosition on Yahoo Mail
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, enrica, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch enrica: review+

Description Tim Horton 2014-10-30 12:29:37 PDT
Long spins under rangeExpandedAroundPosition on Yahoo Mail
Comment 1 Tim Horton 2014-10-30 12:31:32 PDT
Created attachment 240687 [details]
Patch
Comment 2 Enrica Casucci 2014-10-30 12:40:14 PDT
Comment on attachment 240687 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240687&action=review

> Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:517
> +            end = end.previous(Character);

What happens when you reach a null position before the number of characters to expand? I think you should handle that case in both directions.
Comment 3 Tim Horton 2014-10-30 12:46:46 PDT
Comment on attachment 240687 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240687&action=review

>> Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:517
>> +            end = end.previous(Character);
> 
> What happens when you reach a null position before the number of characters to expand? I think you should handle that case in both directions.

Interesting! I'm surprised the telephone number code I stole this from has never been a problem.
Comment 4 Tim Horton 2014-10-30 15:29:56 PDT
It looks like the positions never become null, they just climb the tree and then stick at one end or the other. Works exactly as you'd hope.
Comment 5 Enrica Casucci 2014-10-30 15:32:20 PDT
Comment on attachment 240687 [details]
Patch

Thanks for looking into that!. Looks good to me.
Comment 6 Tim Horton 2014-10-30 15:38:16 PDT
http://trac.webkit.org/changeset/175388