[webkit-dev] How WebCore receives Mouse events?

David Hyatt hyatt at apple.com
Sun Sep 21 12:06:00 PDT 2008

Events are delivered to the top level Widget, which then does a hit  
test using RenderLayer.  RenderLayer will then hit test the  
RenderObjects.  See RenderLayer::hitTest and RenderObject::hitTest.   
The actual RenderObject hit testing is implemented by a virtual  
function on RenderObject called nodeAtPoint.  If the RenderObject hit  
is a RenderWidget, then the event will be passed down to that child  
widget by the EventHandler class, and the process repeats.


On Sep 21, 2008, at 5:34 AM, Tau After wrote:

> Mark,
> Thanks a lot. I'm still wondering how the Mouse/Key events are  
> associated with the Render Tree? i.e, how thoses events are routed  
> to every render node?
> I saw there is a "Widget" class implemented for different platforms,  
> and also RenderWidget. seems there is something (specific to mouse  
> events) happening while building up the render tree?
> Thnaks!
> -Tau
> ----- Original Message ----
> From: Mark Rowe <mrowe at apple.com>
> To: Tau After <aftertau at yahoo.com>
> Cc: webkit-dev at lists.webkit.org
> Sent: Sunday, September 21, 2008 1:16:28 PM
> Subject: Re: [webkit-dev] How WebCore receives Mouse events?
> On Sep 20, 2008, at 9:18 PM, Tau After wrote:
> > Hello,
> > Could anybody point me the source code where the WebCore register
> > itself with the low layer system to receive the Mouse events? (maybe
> > also key events for elements like buttons)
> WebCore doesn't register for mouse events, the WebKit layer takes care
> of passing mouse events down to WebCore when needed.  For example,
> when a button is pressed WebKit on Mac (<http://trac.webkit.org/browser/trunk/WebKit/mac/WebView/WebHTMLView.mm?rev=36685#L3132
> >) calls into EventHandler::mouseDown (<http://trac.webkit.org/browser/trunk/WebCore/page/mac/EventHandlerMac.mm?rev=36685#L474
> >), which then calls into the cross-platform
> EventHandler::handleMousePressEvent (<http://trac.webkit.org/browser/trunk/WebCore/page/EventHandler.cpp?rev=36685#L317
> >).  EventHandler then takes care of the necessary text selection,
> dispatch of DOM events, etc.
> Hope this helps,
> - Mark
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080921/6991f35d/attachment.html 

More information about the webkit-dev mailing list