| Index: webkit/glue/webview_impl.cc
|
| ===================================================================
|
| --- webkit/glue/webview_impl.cc (revision 12035)
|
| +++ webkit/glue/webview_impl.cc (working copy)
|
| @@ -446,11 +446,7 @@
|
| MakePlatformMouseEvent pme(main_frame()->frameview(), event);
|
|
|
| // Find the right target frame. See issue 1186900.
|
| - IntPoint doc_point(
|
| - page_->mainFrame()->view()->windowToContents(pme.pos()));
|
| - HitTestResult result =
|
| - page_->mainFrame()->eventHandler()->hitTestResultAtPoint(
|
| - doc_point, false);
|
| + HitTestResult result = HitTestResultForWindowPos(pme.pos());
|
| Frame* target_frame;
|
| if (result.innerNonSharedNode())
|
| target_frame = result.innerNonSharedNode()->document()->frame();
|
| @@ -1385,13 +1381,8 @@
|
| if (!page_.get())
|
| return;
|
|
|
| - IntPoint point = IntPoint(x, y);
|
| + HitTestResult result = HitTestResultForWindowPos(IntPoint(x, y));
|
|
|
| - Frame* frame = page_->mainFrame();
|
| -
|
| - HitTestResult result =
|
| - frame->eventHandler()->hitTestResultAtPoint(point, false);
|
| -
|
| if (result.absoluteImageURL().isEmpty()) {
|
| // There isn't actually an image at these coordinates. Might be because
|
| // the window scrolled while the context menu was open or because the page
|
| @@ -1403,7 +1394,7 @@
|
| return;
|
| }
|
|
|
| - frame->editor()->copyImage(result);
|
| + page_->mainFrame()->editor()->copyImage(result);
|
| }
|
|
|
| void WebViewImpl::InspectElement(int x, int y) {
|
| @@ -1413,11 +1404,8 @@
|
| if (x == -1 || y == -1) {
|
| page_->inspectorController()->inspect(NULL);
|
| } else {
|
| - IntPoint point = IntPoint(x, y);
|
| - HitTestResult result(point);
|
| + HitTestResult result = HitTestResultForWindowPos(IntPoint(x, y));
|
|
|
| - result = page_->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
|
| -
|
| if (!result.innerNonSharedNode())
|
| return;
|
|
|
| @@ -1713,3 +1701,10 @@
|
|
|
| return document->focusedNode();
|
| }
|
| +
|
| +HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) {
|
| + IntPoint doc_point(
|
| + page_->mainFrame()->view()->windowToContents(pos));
|
| + return page_->mainFrame()->eventHandler()->
|
| + hitTestResultAtPoint(doc_point, false);
|
| +}
|
|
|