summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp70
1 files changed, 64 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
index 83c569ece9..e6c28f710e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
@@ -370,7 +370,7 @@ bool RenderListBox::isPointInOverflowControl(HitTestResult& result, int _x, int
return false;
IntRect vertRect(_tx + width() - borderRight() - m_vBar->width(),
- _ty,
+ _ty + borderTop(),
m_vBar->width(),
height() - borderTop() - borderBottom());
@@ -416,22 +416,22 @@ void RenderListBox::panScroll(const IntPoint& panStartMousePosition)
int yDelta = currentMousePosition.y() - panStartMousePosition.y();
- // If the point is too far from the center we limit the speed
+ // If the point is too far from the center we limit the speed
yDelta = max(min(yDelta, maxSpeed), -maxSpeed);
- if(abs(yDelta) < iconRadius) // at the center we let the space for the icon
+ if (abs(yDelta) < iconRadius) // at the center we let the space for the icon
return;
if (yDelta > 0)
//offsetY = view()->viewHeight();
absOffset.move(0, listHeight());
- else if (yDelta < 0)
- yDelta--;
+ else if (yDelta < 0)
+ yDelta--;
// Let's attenuate the speed
yDelta /= speedReducer;
- IntPoint scrollPoint(0,0);
+ IntPoint scrollPoint(0, 0);
scrollPoint.setY(absOffset.y() + yDelta);
int newOffset = scrollToward(scrollPoint);
if (newOffset < 0)
@@ -623,6 +623,64 @@ void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect&
repaintRectangle(scrollRect);
}
+IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
+{
+ RenderView* view = this->view();
+ if (!view)
+ return scrollbarRect;
+
+ IntRect rect = scrollbarRect;
+
+ int scrollbarLeft = width() - borderRight() - scrollbar->width();
+ int scrollbarTop = borderTop();
+ rect.move(scrollbarLeft, scrollbarTop);
+
+ return view->frameView()->convertFromRenderer(this, rect);
+}
+
+IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
+{
+ RenderView* view = this->view();
+ if (!view)
+ return parentRect;
+
+ IntRect rect = view->frameView()->convertToRenderer(this, parentRect);
+
+ int scrollbarLeft = width() - borderRight() - scrollbar->width();
+ int scrollbarTop = borderTop();
+ rect.move(-scrollbarLeft, -scrollbarTop);
+ return rect;
+}
+
+IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
+{
+ RenderView* view = this->view();
+ if (!view)
+ return scrollbarPoint;
+
+ IntPoint point = scrollbarPoint;
+
+ int scrollbarLeft = width() - borderRight() - scrollbar->width();
+ int scrollbarTop = borderTop();
+ point.move(scrollbarLeft, scrollbarTop);
+
+ return view->frameView()->convertFromRenderer(this, point);
+}
+
+IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
+{
+ RenderView* view = this->view();
+ if (!view)
+ return parentPoint;
+
+ IntPoint point = view->frameView()->convertToRenderer(this, parentPoint);
+
+ int scrollbarLeft = width() - borderRight() - scrollbar->width();
+ int scrollbarTop = borderTop();
+ point.move(-scrollbarLeft, -scrollbarTop);
+ return point;
+}
+
PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
{
RefPtr<Scrollbar> widget;