equal
deleted
inserted
replaced
547 { |
547 { |
548 IntPoint pt = m_view->viewCoordsInFrameCoords(viewPt); |
548 IntPoint pt = m_view->viewCoordsInFrameCoords(viewPt); |
549 |
549 |
550 Frame* coreFrame = core(this); |
550 Frame* coreFrame = core(this); |
551 |
551 |
552 int dist = 99999999; |
552 unsigned int dist = 0xFFFFFFFF; |
553 Node* result = 0; |
553 Node* result = 0; |
554 //for (Node* n=links->firstItem(); n; n=links->nextItem()) { |
554 //for (Node* n=links->firstItem(); n; n=links->nextItem()) { |
555 for(Node* n = coreFrame->document(); n != 0; n = n->traverseNextNode()) { |
555 for(Node* n = coreFrame->document(); n != 0; n = n->traverseNextNode()) { |
556 if(n->isFocusable() || n->hasTagName(areaTag)) { |
556 if(n->isFocusable() || n->hasTagName(areaTag)) { |
557 IntRect r = n->getRect(); |
557 IntRect r = n->getRect(); |
561 break; |
561 break; |
562 } |
562 } |
563 |
563 |
564 int x = xInRect(r, pt.x()); |
564 int x = xInRect(r, pt.x()); |
565 int y = yInRect(r, pt.y()); |
565 int y = yInRect(r, pt.y()); |
566 int d = (pt.x() - x) * (pt.x() - x) + (pt.y() - y) * (pt.y() - y); |
566 unsigned int d = (pt.x() - x) * (pt.x() - x) + (pt.y() - y) * (pt.y() - y); |
567 if (dist > d) { |
567 if (dist > d) { |
568 dist = d; |
568 dist = d; |
569 result = n; |
569 result = n; |
570 } |
570 } |
571 } |
571 } |