[Webkit-unassigned] [Bug 38189] [chromium] clicking a scrollbar in an iframe shouldn't lose the selection
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Apr 27 18:16:12 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=38189
Tony Chang (Google) <tony at chromium.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fishd at chromium.org
--- Comment #6 from Tony Chang (Google) <tony at chromium.org> 2010-04-27 18:16:11 PST ---
Adding Darin as a potential reviewer.
Let me describe the code in EventHandlerMac.mm. When you click in a subframe,
you end up in passSubframeEventToSubframe:
http://trac.webkit.org/browser/trunk/WebCore/page/mac/EventHandlerMac.mm#L354
For a mouse clicks, this calls passWidgetMouseDownEventToWidget:
http://trac.webkit.org/browser/trunk/WebCore/page/mac/EventHandlerMac.mm#L390
Which calls through to passMouseDownEventToWidget:
http://trac.webkit.org/browser/trunk/WebCore/page/mac/EventHandlerMac.mm#L206
A hit test is performed to see which NSView is hit:
http://trac.webkit.org/browser/trunk/WebCore/page/mac/EventHandlerMac.mm#L223
And the view is passed the event directly in line 255. If we're over a
scrollbar, |view| is an NSScroller, otherwise it's a WebHTMLView.
It seems like some of this logic is in EventHandler::handleMousePressEvent,
which is what we used to always call:
http://trac.webkit.org/browser/trunk/WebCore/page/EventHandler.cpp#L1166
However, the logic for passing the event to a scrollbar doesn't happen until
after the page has a chance to handle the event. The page handling the event
is what causes us to lose the selection.
In writing this, I realized that this also means that previously, if you set
mousedown to preventDefault(), you could not scroll the iframe. With this
change, you can still scroll the iframe. This seems to match Safari mac and
Firefox mac (in Firefox, I had to put the preventDefault in keypress to stop
selection).
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list