Switch over the Mac-specific uses of viewportToContents/contentsToViewport.
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Sep 2006 00:39:48 +0000 (00:39 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Sep 2006 00:39:48 +0000 (00:39 +0000)
        * 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: https://svn.webkit.org/repository/webkit/trunk@16631 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm

index 0a96ddf2a5e3316c915e6c82ac2057d38d9a80d6..d69c350a0e01eeb695c7025a8e422351c8842eaa 100644 (file)
@@ -1,3 +1,16 @@
+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.
index 13624c21a405a6a2e70a387c7b3f7ec282bbab18..2d7c594a1f458b0653616e36c1d89de3b7a79021 100644 (file)
@@ -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);
index ef9e18533b0fa7ce953975ee64e67874e2e7aa18..17774f7d24d2988f16778433b5eb74435a08f8b5 100644 (file)
@@ -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());
 }