Commit 8bfcdaaa authored by bweinstein@apple.com's avatar bweinstein@apple.com

2009-08-12 Brian Weinstein <bweinstein@apple.com>

        Reviewed Adam Roben.

        Fix of <rdar://6728361> Mouse wheel scrolling on a page with expanded drop down
        list detaches drop down.

        Added a check in mouseWheel to see if our focus is currently in a popup, if so, close
        the popup (matches other browser behavior).

        * WebView.cpp:
        (WebView::mouseWheel):

2009-08-12  Brian Weinstein  <bweinstein@apple.com>

        Reviewed by Adam Roben.

        Fix of <rdar://6728361> Mouse wheel scrolling on a page with expanded drop down
        list detaches drop down.

        Added a function for Windows PopupMenu's to return their class name.

         * platform/PopupMenu.h:
         * platform/win/PopupMenuWin.cpp:
         (WebCore::PopupMenu::popupClassName):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 826691b6
2009-08-12 Brian Weinstein <bweinstein@apple.com>
Reviewed by Adam Roben.
Fix of <rdar://6728361> Mouse wheel scrolling on a page with expanded drop down
list detaches drop down.
Added a function for Windows PopupMenu's to return their class name.
* platform/PopupMenu.h:
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::popupClassName):
2009-08-12 Shinichiro Hamaji <hamaji@chromium.org>
Reviewed by Dan Bernstein.
......@@ -94,6 +94,8 @@ public:
#if PLATFORM(WIN)
Scrollbar* scrollbar() const { return m_scrollbar.get(); }
static LPCTSTR popupClassName();
bool up(unsigned lines = 1);
bool down(unsigned lines = 1);
......
......@@ -94,6 +94,11 @@ PopupMenu::~PopupMenu()
::DestroyWindow(m_popup);
}
LPCTSTR PopupMenu::popupClassName()
{
return kPopupWindowClassName;
}
void PopupMenu::show(const IntRect& r, FrameView* v, int index)
{
calculatePositionAndSize(r, v);
......
2009-08-12 Brian Weinstein <bweinstein@apple.com>
Reviewed Adam Roben.
Fix of <rdar://6728361> Mouse wheel scrolling on a page with expanded drop down
list detaches drop down.
Added a check in mouseWheel to see if our focus is currently in a popup, if so, close
the popup (matches other browser behavior).
* WebView.cpp:
(WebView::mouseWheel):
2009-08-12 Adam Roben <aroben@apple.com>
Make WebPreferenceKeysPrivate.h available for client use
......
......@@ -94,6 +94,7 @@
#include <WebCore/PluginDatabase.h>
#include <WebCore/PluginInfoStore.h>
#include <WebCore/PluginView.h>
#include <WebCore/PopupMenu.h>
#include <WebCore/ProgressTracker.h>
#include <WebCore/RenderTheme.h>
#include <WebCore/RenderView.h>
......@@ -1454,6 +1455,23 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel)
makeTextLarger(0);
return true;
}
// FIXME: This doesn't fix https://bugs.webkit.org/show_bug.cgi?id=28217. This only fixes https://bugs.webkit.org/show_bug.cgi?id=28203.
HWND focusedWindow = GetFocus();
if (focusedWindow && focusedWindow != m_viewWindow) {
// Our focus is on a different hwnd, see if it's a PopupMenu and if so, set the focus back on us (which will hide the popup).
TCHAR className[256];
// Make sure truncation won't affect the comparison.
ASSERT(ARRAYSIZE(className) > _tcslen(PopupMenu::popupClassName));
if (GetClassName(focusedWindow, className, ARRAYSIZE(className)) && !_tcscmp(className, PopupMenu::popupClassName())) {
// We don't let the WebView scroll here for two reasons - 1) To match Firefox behavior, 2) If we do scroll, we lose the
// focus ring around the select menu.
SetFocus(m_viewWindow);
return true;
}
}
PlatformWheelEvent wheelEvent(m_viewWindow, wParam, lParam, isMouseHWheel);
Frame* coreFrame = core(m_mainFrame);
......
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