Reviewed by Maciej.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Mar 2005 02:09:02 +0000 (02:09 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Mar 2005 02:09:02 +0000 (02:09 +0000)
        <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        Add in the view's contentsX and contentsY to the point.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8907 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQAccObject.mm

index 22ce225713dfb5b4dde992522d5f7c612e55a2da..2cd71648fa2180b993553f9b3cdd8f0a83ea2c3b 100644 (file)
@@ -1,3 +1,13 @@
+2005-03-16  David Harrison  <harrison@apple.com>
+
+        Reviewed by Maciej.
+
+        <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
+
+        * kwq/KWQAccObject.mm:
+        (-[KWQAccObject doAXTextMarkerForPosition:]):
+        Add in the view's contentsX and contentsY to the point.
+
 2005-03-16  David Harrison  <harrison@apple.com>
 
         Reviewed by Maciej.
 2005-03-16  David Harrison  <harrison@apple.com>
 
         Reviewed by Maciej.
index 213ff89b1d4ba07c287ab4e40a745f0951aec314..6fd9a00bb9060ccbf1160fcf8cd26f5dee748005 100644 (file)
@@ -1094,7 +1094,8 @@ static QRect boundingBoxRect(RenderObject* obj)
 - (id)doAXTextMarkerForPosition: (NSPoint) point
 {
     // convert absolute point to view coordinates
 - (id)doAXTextMarkerForPosition: (NSPoint) point
 {
     // convert absolute point to view coordinates
-    NSView *view = [self topView]->getView();
+    KHTMLView *docView = [self topView];
+    NSView *view = docView->getView();
     RenderObject *renderer = [self topRenderer];
     NodeImpl *innerNode = NULL;
     NSPoint ourpoint;
     RenderObject *renderer = [self topRenderer];
     NodeImpl *innerNode = NULL;
     NSPoint ourpoint;
@@ -1104,6 +1105,9 @@ static QRect boundingBoxRect(RenderObject* obj)
         // ask the document layer to hitTest
         NSPoint windowCoord = [[view window] convertScreenToBase: point];
         ourpoint = [view convertPoint:windowCoord fromView:nil];
         // ask the document layer to hitTest
         NSPoint windowCoord = [[view window] convertScreenToBase: point];
         ourpoint = [view convertPoint:windowCoord fromView:nil];
+        ourpoint.x += docView->contentsX();
+        ourpoint.y += docView->contentsY();
+        
         RenderObject::NodeInfo nodeInfo(true, true);
         renderer->layer()->hitTest(nodeInfo, (int)ourpoint.x, (int)ourpoint.y);
         innerNode = nodeInfo.innerNode();
         RenderObject::NodeInfo nodeInfo(true, true);
         renderer->layer()->hitTest(nodeInfo, (int)ourpoint.x, (int)ourpoint.y);
         innerNode = nodeInfo.innerNode();
@@ -1126,7 +1130,8 @@ static QRect boundingBoxRect(RenderObject* obj)
         if (!document)
             break;
         renderer = document->renderer();
         if (!document)
             break;
         renderer = document->renderer();
-        view = static_cast<KHTMLView *>(widget)->getDocumentView();
+        docView = static_cast<KHTMLView *>(widget);
+        view = docView->getDocumentView();
     }
     
     // get position within the node
     }
     
     // get position within the node