Bug 35066 - keyboard selection sometimes moves the wrong end of the selection for Win/Linux
Summary: keyboard selection sometimes moves the wrong end of the selection for Win/Linux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-17 18:19 PST by Ojan Vafai
Modified: 2010-10-10 23:10 PDT (History)
5 users (show)

See Also:


Attachments
Patch (65.18 KB, patch)
2010-02-17 18:24 PST, Ojan Vafai
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>