Commit e50f2633 authored by alice.liu@apple.com's avatar alice.liu@apple.com

Reviewed by Adam.

        Fixed <rdar://5566435> window with no scrollbars can be scrolled

        * platform/win/ScrollViewWin.cpp:
        (WebCore::ScrollView::maximumScroll):
        corrected maximumScroll() to account for scrolling not allowed.
        (WebCore::ScrollView::wheelEvent):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d6784b25
2007-12-17 Alice Liu <alice.liu@apple.com>
Reviewed by Adam.
Fixed <rdar://5566435> window with no scrollbars can be scrolled
* platform/win/ScrollViewWin.cpp:
(WebCore::ScrollView::maximumScroll):
corrected maximumScroll() to account for scrolling not allowed.
(WebCore::ScrollView::wheelEvent):
2007-12-14 Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed by Alp Toker.
......
......@@ -347,6 +347,8 @@ IntSize ScrollView::scrollOffset() const
IntSize ScrollView::maximumScroll() const
{
if (!m_data->allowsScrolling())
return IntSize();
IntSize delta = (m_data->m_contentsSize - IntSize(visibleWidth(), visibleHeight())) - scrollOffset();
delta.clampNegativeToZero();
return delta;
......@@ -668,10 +670,10 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e)
if ((e.deltaX() < 0 && maxScrollDelta.width() > 0) ||
(e.deltaX() > 0 && scrollOffset().width() > 0) ||
(e.deltaY() < 0 && maxScrollDelta.height() > 0) ||
(e.deltaY() > 0 && scrollOffset().height() > 0))
(e.deltaY() > 0 && scrollOffset().height() > 0)) {
e.accept();
scrollBy(-e.deltaX() * LINE_STEP, -e.deltaY() * LINE_STEP);
scrollBy(-e.deltaX() * LINE_STEP, -e.deltaY() * LINE_STEP);
}
}
HashSet<Widget*>* ScrollView::children()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment