title: How do I find the DOM node that is at a given (X,Y) position? (Hit test)
body: <p>I have the coordinates (X,Y) of a point in an HTML document. How do I determine what DOM node is at those coordinates?</p>
  
  <p>Some ideas:</p>
  
  <ul>
  <li>Is there a DOM hit test function that I missed, that takes a point (X,Y) and returns the DOM element there?</li>
  <li>Is there an efficient way to walk the DOM element tree to find the containing element? This seems like it would be tricky because of absolutely positioned elements.</li>
  <li>Is there a way to simulate an event at a given (X,Y) position such that the browser ends up creating an event object that has a pointer to the element?</li>
  </ul>
  
  <p>(Background: I'm embedding Qt's QWebView in a native application. I'm trying to vary the context menu that the Qt widget provides based on the DOM node that the mouse is over, but Qt 4.5 cannot hit test to a DOM element, though that functionality is coming in 4.6. So I'm hoping I can toss the the coordinate into Javascript and do the hit testing there with DOM APIs.)</p>
  
  <p>Thanks!</p>