Bug 64047 - Page flashes when dragging a div on google.ro
Summary: Page flashes when dragging a div on google.ro
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.google.ro
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 18:19 PDT by fengyuan
Modified: 2011-07-14 16:45 PDT (History)
2 users (show)

See Also:


Attachments
This is the video recording how to reproduce the bug. (85.33 KB, video/3gpp)
2011-07-06 18:32 PDT, fengyuan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description fengyuan 2011-07-06 18:19:35 PDT
What steps will reproduce the problem?
1. Goto http://www.google.ro;
2. Click on the keyboard icon inside the search box, wait for the keyboard to be shown. 
3. Mouse down on the title of the keyboard;
4. Starting dragging the keyboard;
5. The page started to flash intensily.

What is the expected result?
The page shouldn't flash.

What happens instead?
The page flashed.

Please provide any additional information below. Attach a screenshot if
possible.

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30
Comment 1 fengyuan 2011-07-06 18:32:45 PDT
Created attachment 99911 [details]
This is the video recording how to reproduce the bug.
Comment 2 Alexey Proskuryakov 2011-07-06 21:51:49 PDT
I also see this with WebKit nightly r90503.

Looks like a selection temporarily appears.
Comment 3 Kulanthaivel Palanichamy 2011-07-14 16:45:27 PDT
(In reply to comment #2)
> I also see this with WebKit nightly r90503.
> Looks like a selection temporarily appears.

The same issue is reproducible in Opera as well. But surprisingly Firefox and IE handle this scenario well.
Basically, when mousepress event is sent to the virtual keyboard's event handler, it suppose to set preventDefault on that event to make sure that default action is not handled on that event.

In EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) { 
...
    bool swallowEvent = dispatchMouseEvent(eventNames().mousedownEvent, targetNode(mev), true, m_clickCount, mouseEvent, true);
    m_capturesDragging = !swallowEvent;
...
}
- Here m_capturesDragging is set to true incase of cancelled events to prevent selection on subsequent mousemove events.

I'm not sure whether we need a specific workaround where selection should not get triggered when the corresponding events are handled by drag target's JS event handlers.