746 } |
746 } |
747 |
747 |
748 //scroll only for the list which is either multiple or single but with more than one lines |
748 //scroll only for the list which is either multiple or single but with more than one lines |
749 if (isScrollList) { |
749 if (isScrollList) { |
750 RenderListBox* render = static_cast<RenderListBox*>(e->renderer()); |
750 RenderListBox* render = static_cast<RenderListBox*>(e->renderer()); |
751 if (render->isScrollable()) { |
751 |
752 HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>( e ); |
752 HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>( e ); |
753 IntRect r = e->getRect(); |
753 IntRect r = e->getRect(); |
754 int curIndex = render->listIndexAtOffset(point.x() - r.x(), point.y() - r.y()); |
754 int curIndex = render->listIndexAtOffset(point.x() - r.x(), point.y() - r.y()); |
755 int topIndex = render->indexOffset(); |
755 int topIndex = render->indexOffset(); |
756 int bottomIndex = topIndex + selectElement->size() - 1; |
756 int bottomIndex = topIndex + render->getSize() - 1; |
757 TPoint curPointInSelectBox(point.x() - r.x(), point.y() - r.y()); |
757 TPoint curPointInSelectBox(point.x() - r.x(), point.y() - r.y()); |
758 IntRect itemRect = render->itemRect(0, 0, curIndex); |
758 IntRect itemRect = render->itemRect(0, 0, curIndex); |
759 int centerOfRect = itemRect.y() + (itemRect.height() * 1) / 4; |
759 int centerOfRect = itemRect.y() + (itemRect.height() * 1) / 4; |
760 if (tb == -1) { |
760 if (tb == -1) { |
761 if (curIndex == topIndex) { |
761 if (curIndex == topIndex) { |