Commit a4f200e8 authored by andersca@apple.com's avatar andersca@apple.com

DragClient::dragSourceActionMaskForPoint should use root view coordinates

https://bugs.webkit.org/show_bug.cgi?id=72409

Reviewed by Sam Weinig.

Source/WebCore:

* page/DragClient.h:
Rename parameter and remove obsolete comment.

* page/DragController.cpp:
(WebCore::DragController::delegateDragSourceAction):
* page/DragController.h:
Rename parameter.

* page/EventHandler.cpp:
(WebCore::EventHandler::updateDragSourceActionsAllowed):
Use contentsToRootView instead of contentsToWindow.

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::dragSourceActionMaskForPoint):
Use -[WebView _convertPointFromRootView:] to convert the point to the web view coordinate system.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5602eb99
2011-11-15 Anders Carlsson <andersca@apple.com>
DragClient::dragSourceActionMaskForPoint should use root view coordinates
https://bugs.webkit.org/show_bug.cgi?id=72409
Reviewed by Sam Weinig.
* page/DragClient.h:
Rename parameter and remove obsolete comment.
* page/DragController.cpp:
(WebCore::DragController::delegateDragSourceAction):
* page/DragController.h:
Rename parameter.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateDragSourceActionsAllowed):
Use contentsToRootView instead of contentsToWindow.
2011-11-15 Anders Carlsson <andersca@apple.com>
EditorClient::showCorrectionPanel should pass the string bounding box in root view coordinates
......@@ -59,8 +59,7 @@ namespace WebCore {
virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) = 0;
virtual DragDestinationAction actionMaskForDrag(DragData*) = 0;
// We work in window rather than view coordinates here.
virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint& windowPoint) = 0;
virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint& rootViewPoint) = 0;
virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false) = 0;
......
......@@ -375,9 +375,9 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a
return false;
}
DragSourceAction DragController::delegateDragSourceAction(const IntPoint& windowPoint)
DragSourceAction DragController::delegateDragSourceAction(const IntPoint& rootViewPoint)
{
m_dragSourceAction = m_client->dragSourceActionMaskForPoint(windowPoint);
m_dragSourceAction = m_client->dragSourceActionMaskForPoint(rootViewPoint);
return m_dragSourceAction;
}
......
......@@ -76,7 +76,7 @@ namespace WebCore {
Document* documentUnderMouse() const { return m_documentUnderMouse.get(); }
DragDestinationAction dragDestinationAction() const { return m_dragDestinationAction; }
DragSourceAction delegateDragSourceAction(const IntPoint& pagePoint);
DragSourceAction delegateDragSourceAction(const IntPoint& rootViewPoint);
Node* draggableNode(const Frame*, Node*, const IntPoint&, DragState&) const;
void dragEnded();
......
......@@ -928,7 +928,7 @@ DragSourceAction EventHandler::updateDragSourceActionsAllowed() const
if (!view)
return DragSourceActionNone;
return page->dragController()->delegateDragSourceAction(view->contentsToWindow(m_mouseDownPos));
return page->dragController()->delegateDragSourceAction(view->contentsToRootView(m_mouseDownPos));
}
#endif // ENABLE(DRAG_SUPPORT)
......
2011-11-15 Anders Carlsson <andersca@apple.com>
DragClient::dragSourceActionMaskForPoint should use root view coordinates
https://bugs.webkit.org/show_bug.cgi?id=72409
Reviewed by Sam Weinig.
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::dragSourceActionMaskForPoint):
Use -[WebView _convertPointFromRootView:] to convert the point to the web view coordinate system.
2011-11-15 Anders Carlsson <andersca@apple.com>
EditorClient::showCorrectionPanel should pass the string bounding box in root view coordinates
......
......@@ -74,9 +74,9 @@ void WebDragClient::willPerformDragDestinationAction(WebCore::DragDestinationAct
}
WebCore::DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& windowPoint)
WebCore::DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& rootViewPoint)
{
NSPoint viewPoint = [m_webView convertPoint:windowPoint fromView:nil];
NSPoint viewPoint = [m_webView _convertPointFromRootView:rootViewPoint];
return (DragSourceAction)[[m_webView _UIDelegateForwarder] webView:m_webView dragSourceActionMaskForPoint:viewPoint];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment