Bug 16479

Summary: text selection does not always begin at mouse down point
Product: WebKit Reporter: Tony Chang <tony>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alp, ap, aroben
Priority: P2 Keywords: HasReduction, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
test case
none
clear m_dragSrc on all platforms
none
use dumpAsText darin: review+

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

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