Bug 35066

Summary: keyboard selection sometimes moves the wrong end of the selection for Win/Linux
Product: WebKit Reporter: Ojan Vafai <ojan>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eric, evan, tonikitoo, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Patch abarth: review+

Description Ojan Vafai 2010-02-17 18:19:59 PST
Given the following text:
line one
line two
line three

1. Put the cursor in the middle of line one.
2. Shift+down
3. Shift+home
4. Shift+end

On Win/Linux, you should see the word "one" selected after 3. And the words "one" and "line two" selected after 4. Instead "line " (in line 1) is selected after 3 and "one" is selected after 4.
Comment 1 Ojan Vafai 2010-02-17 18:24:11 PST
Created attachment 48957 [details]
Patch
Comment 2 Adam Barth 2010-02-18 00:54:13 PST
Comment on attachment 48957 [details]
Patch

I applaud your thorough testing.

Everyone seems really excited about this patch and the mechanics seem straightforward enough.

I'm not an editing expert, so please let me know if you'd rather I didn't review editing patches in the future.
Comment 3 Evan Martin 2010-02-18 00:59:00 PST
+// FIXME: Expose settings->editingBehavior() and use that here instead.
+var onMacPlatform = navigator.userAgent.search(/\bMac OS X\b/) != -1;

I wonder if this will fail on iPhone.
I wonder if iPhones use Mac editing behavior.
I guess there's no shift-home on iPhones.  :)
I wonder if we run tests on iPhones?
Comment 4 Tony Chang 2010-02-18 01:11:03 PST
(In reply to comment #3)
> +// FIXME: Expose settings->editingBehavior() and use that here instead.
> +var onMacPlatform = navigator.userAgent.search(/\bMac OS X\b/) != -1;
> 
> I wonder if this will fail on iPhone.
> I wonder if iPhones use Mac editing behavior.
> I guess there's no shift-home on iPhones.  :)
> I wonder if we run tests on iPhones?

The iPhone user agent has Mac OS X in it so this should be fine.  This would matter for an iPad with a keyboard.
Comment 5 Ojan Vafai 2010-02-18 11:38:22 PST
Committed r54980: <http://trac.webkit.org/changeset/54980>