diff options
author | Ben Murdoch <benm@google.com> | 2011-05-16 16:25:10 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-23 18:54:14 +0100 |
commit | ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch) | |
tree | db769fadd053248f85db67434a5b275224defef7 /Source/WebCore/platform/win/PopupMenuWin.cpp | |
parent | 52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff) | |
download | external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2 |
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/platform/win/PopupMenuWin.cpp')
-rw-r--r-- | Source/WebCore/platform/win/PopupMenuWin.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/WebCore/platform/win/PopupMenuWin.cpp b/Source/WebCore/platform/win/PopupMenuWin.cpp index e86aef9..15871e6 100644 --- a/Source/WebCore/platform/win/PopupMenuWin.cpp +++ b/Source/WebCore/platform/win/PopupMenuWin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. * Copyright (C) 2007-2009 Torch Mobile Inc. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * @@ -40,6 +40,7 @@ #include "Scrollbar.h" #include "ScrollbarTheme.h" #include "SimpleFontData.h" +#include "TextRun.h" #include "WebCoreInstanceHandle.h" #include <tchar.h> #include <windows.h> @@ -531,12 +532,12 @@ bool PopupMenuWin::scrollToRevealSelection() int index = focusedIndex(); if (index < m_scrollOffset) { - m_scrollbar->setValue(index, Scrollbar::NotFromScrollAnimator); + ScrollableArea::scrollToYOffsetWithoutAnimation(index); return true; } if (index >= m_scrollOffset + visibleItems()) { - m_scrollbar->setValue(index - visibleItems() + 1, Scrollbar::NotFromScrollAnimator); + ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1); return true; } @@ -669,21 +670,23 @@ int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0; } -void PopupMenuWin::setScrollOffsetFromAnimation(const IntPoint& offset) +int PopupMenuWin::scrollPosition(Scrollbar*) const { - if (m_scrollbar) - m_scrollbar->setValue(offset.y(), Scrollbar::FromScrollAnimator); + return m_scrollOffset; +} + +void PopupMenuWin::setScrollOffset(const IntPoint& offset) +{ + scrollTo(offset.y()); } -void PopupMenuWin::valueChanged(Scrollbar* scrollBar) +void PopupMenuWin::scrollTo(int offset) { ASSERT(m_scrollbar); if (!m_popup) return; - int offset = scrollBar->value(); - if (m_scrollOffset == offset) return; @@ -990,7 +993,8 @@ LRESULT PopupMenuWin::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa else --i; } - scrollbar()->scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i)); + + ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i)); break; } |