Bug 134808 - Phone numbers that span two lines are not detected
Summary: Phone numbers that span two lines are not detected
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-10 12:07 PDT by Brady Eidson
Modified: 2014-07-11 16:56 PDT (History)
2 users (show)

See Also:


Attachments
Patch v1 (4.73 KB, patch)
2014-07-10 12:13 PDT, Brady Eidson
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-07-10 12:07:07 PDT
Phone numbers that span two lines are not detected.

<rdar://problem/17601146>
Comment 1 Brady Eidson 2014-07-10 12:13:03 PDT
Created attachment 234716 [details]
Patch v1
Comment 2 Tim Horton 2014-07-10 17:35:29 PDT
Comment on attachment 234716 [details]
Patch v1 

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

> Source/WebCore/editing/Editor.cpp:3397
> +        // If this text iterator range's end position is before the end of the full range,
> +        // then scan a window that is a bit before and a bit after this text iterator range.

Why do we not search backwards a bit if we end at the end of the range?
Comment 3 Brady Eidson 2014-07-10 17:53:09 PDT
(In reply to comment #2)
> (From update of attachment 234716 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=234716&action=review
> 
> > Source/WebCore/editing/Editor.cpp:3397
> > +        // If this text iterator range's end position is before the end of the full range,
> > +        // then scan a window that is a bit before and a bit after this text iterator range.
> 
> Why do we not search backwards a bit if we end at the end of the range?

Currently when we extend a range to search it, we extend it 15 characters in both directions.

So if we did what you suggest, we would be expanding the end of the end range to 15 previous.

Quite often in practice, the final chunk of text from the iterator will already have been 15 characters long, so doing this extension would be re-scanning those 15 characters.

But if the final chunk was shorter than 15 characters - say it was 1 character - then we already would've scanned that range by extending the end of the previous chunk 15 characters *forward*

Combine this with the fact that the original input range is extended 15 in each direction from the actual selection, and I don't see how stopping at the end would miss anything we want to scan.
Comment 4 Brady Eidson 2014-07-11 16:56:42 PDT
http://trac.webkit.org/changeset/171016