Bug 13110 - REGRESSION (NativeTextField): Word granularity allows selection of partial words that contain punctuation
Summary: REGRESSION (NativeTextField): Word granularity allows selection of partial wo...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL: data:text/html,Customers don’t ...
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-03-18 11:54 PDT by mitz
Modified: 2007-12-10 06:34 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-03-18 11:54:24 PDT
When expanding a selection with word granularity, it's possible to select only part of a word that contains punctuation if the cursor is positioned over the punctuation.

To reproduce, open the URL, double-click the first word and continue dragging across the text. Notice how "don't", "99.9" and "127.0.0.1" are fully selected as the cursor enters them, but the selection contracts back to only part of the word as the pointer moves over the punctuation.

For form controls, this is a regression from Safari 2.0.
Comment 1 Maciej Stachowiak 2007-03-19 11:51:51 PDT
<rdar://problem/5072348>
Comment 2 Darin Adler 2007-04-23 08:26:29 PDT
<rdar://problem/4002438>
Comment 3 Eric Seidel (no email) 2007-10-21 21:15:57 PDT
Strange that this should be broken, since it looks like WebKit uses AppKit to do its word boundary detection:

void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)

uses:
    NSRange range = [attr doubleClickAtIndex:(position >= len) ? len - 1 : position];

to find the word range.  Someone would have to look at the NSTextField source, maybe it uses a different selection function (or maybe I've missed some other bug in looking at our selection code).
Comment 4 mitz 2007-10-22 07:34:45 PDT
(In reply to comment #3)
> void findWordBoundary(const UChar* chars, int len, int position, int* start,
> int* end)
> 
> uses:
>     NSRange range = [attr doubleClickAtIndex:(position >= len) ? len - 1 :
> position];

It's not passing in enough context.