Commit 80a6a30d authored by hyatt's avatar hyatt

Switch over the Mac-specific uses of viewportToContents/contentsToViewport.

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::eventMayStartDrag):
        (WebCore::FrameMac::dragHysteresisExceeded):
        (WebCore::FrameMac::mouseDown):
        (WebCore::FrameMac::shouldDragAutoNode):
        (WebCore::FrameMac::sendContextMenuEvent):
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge _visiblePositionForPoint:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 97c694f0
2006-09-28 David Hyatt <hyatt@apple.com>
Switch over the Mac-specific uses of viewportToContents/contentsToViewport.
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::eventMayStartDrag):
(WebCore::FrameMac::dragHysteresisExceeded):
(WebCore::FrameMac::mouseDown):
(WebCore::FrameMac::shouldDragAutoNode):
(WebCore::FrameMac::sendContextMenuEvent):
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge _visiblePositionForPoint:]):
2006-09-28 Dave Hyatt <hyatt@apple.com>
This patch eliminates viewportToContents/contentsToViewport in favor of convertTo/FromContainingWindow.
......@@ -1549,7 +1549,7 @@ bool FrameMac::eventMayStartDrag(NSEvent *event) const
}
NSPoint loc = [event locationInWindow];
IntPoint mouseDownPos = d->m_view->viewportToContents(IntPoint(loc));
IntPoint mouseDownPos = d->m_view->convertFromContainingWindow(IntPoint(loc));
RenderObject::NodeInfo nodeInfo(true, false);
renderer()->layer()->hitTest(nodeInfo, mouseDownPos);
bool srcIsDHTML;
......@@ -1568,7 +1568,7 @@ const float TextDragDelay = 0.15;
bool FrameMac::dragHysteresisExceeded(float dragLocationX, float dragLocationY) const
{
IntPoint dragViewportLocation((int)dragLocationX, (int)dragLocationY);
IntPoint dragLocation = d->m_view->viewportToContents(dragViewportLocation);
IntPoint dragLocation = d->m_view->convertFromContainingWindow(dragViewportLocation);
IntSize delta = dragLocation - m_mouseDownPos;
float threshold = GeneralDragHysteresis;
......@@ -1960,7 +1960,7 @@ void FrameMac::mouseDown(NSEvent *event)
_currentEvent = HardRetain(event);
m_mouseDown = PlatformMouseEvent(event);
NSPoint loc = [event locationInWindow];
m_mouseDownPos = d->m_view->viewportToContents(IntPoint(loc));
m_mouseDownPos = d->m_view->convertFromContainingWindow(IntPoint(loc));
_mouseDownTimestamp = [event timestamp];
_mouseDownMayStartDrag = false;
......@@ -2120,7 +2120,7 @@ bool FrameMac::shouldDragAutoNode(Node* node, const IntPoint& point) const
// the node hierarchy, and we also don't have to cook up a way to ask WK about non-leaf nodes
// (since right now WK just hit-tests using a cached lastMouseDown).
if (!node->hasChildNodes() && d->m_view) {
NSPoint eventLoc = d->m_view->contentsToViewport(point);
NSPoint eventLoc = d->m_view->convertToContainingWindow(point);
return [_bridge mayStartDragAtEventLocation:eventLoc];
} else
return NO;
......@@ -2141,7 +2141,7 @@ bool FrameMac::sendContextMenuEvent(NSEvent *event)
PlatformMouseEvent mouseEvent(event);
IntPoint viewportPos = v->viewportToContents(mouseEvent.pos());
IntPoint viewportPos = v->convertFromContainingWindow(mouseEvent.pos());
MouseEventWithHitTestResults mev = doc->prepareMouseEvent(false, true, false, viewportPos, mouseEvent);
swallowEvent = v->dispatchMouseEvent(contextmenuEvent, mev.targetNode(), true, 0, mouseEvent, true);
......
......@@ -2071,7 +2071,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
return VisiblePosition();
FrameView* outerView = m_frame->view();
FrameView* innerView = node->document()->view();
IntPoint innerPoint = innerView->viewportToContents(outerView->contentsToViewport(outerPoint));
IntPoint innerPoint = innerView->convertFromContainingWindow(outerView->convertToContainingWindow(outerPoint));
return renderer->positionForCoordinates(innerPoint.x(), innerPoint.y());
}
......
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