Bug 16479 - text selection does not always begin at mouse down point
Summary: text selection does not always begin at mouse down point
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
Keywords: HasReduction, PlatformOnly
Depends on:
Reported: 2007-12-17 13:29 PST by Tony Chang
Modified: 2007-12-20 10:09 PST (History)
3 users (show)

See Also:

test case (3.81 KB, text/html)
2007-12-17 13:37 PST, Tony Chang
no flags Details
clear m_dragSrc on all platforms (10.00 KB, patch)
2007-12-17 17:49 PST, Tony Chang
no flags Details | Formatted Diff | Diff
use dumpAsText (8.21 KB, patch)
2007-12-19 16:27 PST, Tony Chang
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2007-12-17 13:29:00 PST
Sometimes when I try to select text in Safari on Windows, the selection starts a few characters after I start dragging my mouse.  This looks like it's because EventHandler::dragState().m_dragSrc does not get cleared between mouse downs.  In WebCore/page/mac/EventHandlerMac.mm, this gets nulled out in EventHandler::mouseDown.

Since it seems like this value needs to be reset on all platforms, maybe it should be moved into EventHandler::handleMousePressEvent?

Test case coming up...
Comment 1 Tony Chang 2007-12-17 13:37:39 PST
Created attachment 17968 [details]
test case

In the above test case, click on the link then try to select some text.  Sometimes the text selection doesn't start until we're a few lines/characters away from the mouse down.
Comment 2 Tony Chang 2007-12-17 17:49:26 PST
Created attachment 17970 [details]
clear m_dragSrc on all platforms
Comment 3 David Kilzer (:ddkilzer) 2007-12-18 05:07:39 PST
(In reply to comment #2)
> Created an attachment (id=17970) [edit]
> clear m_dragSrc on all platforms

Please set review? flag on patches to make sure they're reviewed!
Comment 4 Alexey Proskuryakov 2007-12-18 13:00:45 PST
The test needs a layoutTestController.dumpAsText() call - otherwise, it will generate platform-dependent pixel results when run-webkit-tests is run with a --pixel option.
Comment 5 Tony Chang 2007-12-19 16:27:05 PST
Created attachment 18000 [details]
use dumpAsText

I updated the test to use dumpAsText instead.  We need to ensure that something is selected.
Comment 6 Alp Toker 2007-12-19 16:29:58 PST
Fix looks good for the GTK+ port.
Comment 7 Darin Adler 2007-12-20 09:32:08 PST
Comment on attachment 18000 [details]
use dumpAsText

Comment 8 Alp Toker 2007-12-20 10:09:56 PST
Landed in r28888.