Changeset 85860 in webkit


Ignore:
Timestamp:
May 5, 2011 9:57:50 AM (13 years ago)
Author:
jeffm@apple.com
Message:

2011-05-05 Jeff Miller <jeffm@apple.com>

Reviewed by Darin Adler.

Add didNotHandleWheelEvent callback to WKPageUIClient
https://bugs.webkit.org/show_bug.cgi?id=60203

  • MiniBrowser/gtk/BrowserWindow.c: (browserWindowUIClientInit): Stub out didNotHandleWheelEvent callback.
  • MiniBrowser/mac/BrowserWindowController.m: (-[BrowserWindowController awakeFromNib]): Stub out didNotHandleWheelEvent callback.
  • MiniBrowser/win/BrowserView.cpp: (BrowserView::create): Stub out didNotHandleWheelEvent callback.
  • WebKitTestRunner/TestController.cpp: (WTR::TestController::createOtherPage): Stub out didNotHandleWheelEvent callback. (WTR::TestController::initialize): Stub out didNotHandleWheelEvent callback.

2011-05-05 Jeff Miller <jeffm@apple.com>

Reviewed by Darin Adler.

Add didNotHandleWheelEvent callback to WKPageUIClient
https://bugs.webkit.org/show_bug.cgi?id=60203


Remove Windows-specific WebPageProxy::wheelEventNotHandled() member function and use
didNotHandleWheelEvent callback in WKPageUIClient instead. It turns out that just
resending the wheel event to the parent window doesn't provide the client with enough context
to know that WebKit has already attempted to handle the event.

  • UIProcess/API/C/WKPage.h: Added WKPageDidNotHandleWheelEventCallback typedef and didNotHandleWheelEvent to WKPageUIClient.
  • UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::didNotHandleWheelEvent): Added, but not implemented.
  • UIProcess/API/gtk/PageClientImpl.h: Added didNotHandleWheelEvent().
  • UIProcess/API/qt/qwkpage.cpp: (QWKPage::QWKPage):Stubbed out didNotHandleWheelEvent callback.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Call didNotHandleWheelEvent in WKPageUIClient if wheel event is not handled.
  • UIProcess/WebPageProxy.h: Removed wheelEventNotHandled().


  • UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::implementsDidNotHandleWheelEvent): Added. (WebKit::WebUIClient::didNotHandleWheelEvent): Added.
  • UIProcess/WebUIClient.h: Added implementsDidNotHandleWheelEvent() and didNotHandleWheelEvent().
  • UIProcess/win/WebPageProxyWin.cpp: Removed wheelEventNotHandled().
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85859 r85860  
     12011-05-05  Jeff Miller  <jeffm@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add didNotHandleWheelEvent callback to WKPageUIClient
     6        https://bugs.webkit.org/show_bug.cgi?id=60203
     7       
     8        Remove Windows-specific WebPageProxy::wheelEventNotHandled() member function and use
     9        didNotHandleWheelEvent callback in WKPageUIClient instead.  It turns out that just
     10        resending the wheel event to the parent window doesn't provide the client with enough context
     11        to know that WebKit has already attempted to handle the event.
     12
     13        * UIProcess/API/C/WKPage.h: Added WKPageDidNotHandleWheelEventCallback typedef and didNotHandleWheelEvent to WKPageUIClient.
     14
     15        * UIProcess/API/gtk/PageClientImpl.cpp:
     16        (WebKit::PageClientImpl::didNotHandleWheelEvent): Added, but not implemented.
     17        * UIProcess/API/gtk/PageClientImpl.h: Added didNotHandleWheelEvent().
     18        * UIProcess/API/qt/qwkpage.cpp:
     19        (QWKPage::QWKPage):Stubbed out didNotHandleWheelEvent callback.
     20
     21        * UIProcess/WebPageProxy.cpp:
     22        (WebKit::WebPageProxy::didReceiveEvent): Call didNotHandleWheelEvent in WKPageUIClient if wheel event is not handled.
     23        * UIProcess/WebPageProxy.h: Removed wheelEventNotHandled().
     24       
     25        * UIProcess/WebUIClient.cpp:
     26        (WebKit::WebUIClient::implementsDidNotHandleWheelEvent): Added.
     27        (WebKit::WebUIClient::didNotHandleWheelEvent): Added.
     28        * UIProcess/WebUIClient.h: Added implementsDidNotHandleWheelEvent() and didNotHandleWheelEvent().
     29
     30        * UIProcess/win/WebPageProxyWin.cpp: Removed wheelEventNotHandled().
     31
    1322011-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
    233
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.h

    r85356 r85860  
    164164typedef void (*WKPageMissingPluginButtonClickedCallback)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
    165165typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
     166typedef void (*WKPageDidNotHandleWheelEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
    166167typedef bool (*WKPageGetToolbarsAreVisibleCallback)(WKPageRef page, const void *clientInfo);
    167168typedef void (*WKPageSetToolbarsAreVisibleCallback)(WKPageRef page, bool toolbarsVisible, const void *clientInfo);
     
    203204    WKPageMissingPluginButtonClickedCallback                            missingPluginButtonClicked;
    204205    WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
     206    WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
    205207    WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
    206208    WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp

    r85199 r85860  
    427427}
    428428
     429void PageClientImpl::didNotHandleWheelEvent(const NativeWebWheelEvent&)
     430{
     431    notImplemented();
     432}
     433
    429434PassRefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy*)
    430435{
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h

    r85198 r85860  
    7878    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
    7979    virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&);
     80    virtual void didNotHandleWheelEvent(const NativeWebWhellboardEvent&);
    8081    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
    8182    virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r85808 r85860  
    478478        0,  /* missingPluginButtonClicked */
    479479        0,  /* didNotHandleKeyEvent */
     480        0,  /* didNotHandleWheelEvent */
    480481        0,  /* toolbarsAreVisible */
    481482        0,  /* setToolbarsAreVisible */
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r85808 r85860  
    26282628        ASSERT(m_currentlyProcessedWheelEvent);
    26292629
    2630 #if PLATFORM(WIN)
    2631         if (!handled && m_currentlyProcessedWheelEvent)
    2632             wheelEventNotHandled(*m_currentlyProcessedWheelEvent);
    2633 #endif
     2630        if (!handled && m_currentlyProcessedWheelEvent && m_uiClient.implementsDidNotHandleWheelEvent())
     2631            m_uiClient.didNotHandleWheelEvent(this, *m_currentlyProcessedWheelEvent);
    26342632
    26352633        m_currentlyProcessedWheelEvent = nullptr;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r85808 r85860  
    693693    void stopResponsivenessTimer();
    694694
    695 #if PLATFORM(WIN)
    696     void wheelEventNotHandled(NativeWebWheelEvent&) const;
    697 #endif
    698 
    699695    void voidCallback(uint64_t);
    700696    void dataCallback(const CoreIPC::DataReference&, uint64_t);
  • trunk/Source/WebKit2/UIProcess/WebUIClient.cpp

    r84702 r85860  
    2929#include "ImmutableDictionary.h"
    3030#include "NativeWebKeyboardEvent.h"
     31#include "NativeWebWheelEvent.h"
    3132#include "WKAPICast.h"
    3233#include "WebNumber.h"
     
    176177}
    177178
     179bool WebUIClient::implementsDidNotHandleWheelEvent() const
     180{
     181    return m_client.didNotHandleWheelEvent;
     182}
     183
     184void WebUIClient::didNotHandleWheelEvent(WebPageProxy* page, const NativeWebWheelEvent& event)
     185{
     186    if (!m_client.didNotHandleWheelEvent)
     187        return;
     188    m_client.didNotHandleWheelEvent(toAPI(page), event.nativeEvent(), m_client.clientInfo);
     189}
     190
    178191bool WebUIClient::toolbarsAreVisible(WebPageProxy* page)
    179192{
  • trunk/Source/WebKit2/UIProcess/WebUIClient.h

    r84702 r85860  
    4545class GeolocationPermissionRequestProxy;
    4646class NativeWebKeyboardEvent;
     47class NativeWebWheelEvent;
    4748class WebData;
    4849class WebFrameProxy;
     
    7172    bool implementsDidNotHandleKeyEvent() const;
    7273    void didNotHandleKeyEvent(WebPageProxy*, const NativeWebKeyboardEvent&);
     74
     75    bool implementsDidNotHandleWheelEvent() const;
     76    void didNotHandleWheelEvent(WebPageProxy*, const NativeWebWheelEvent&);
    7377
    7478    bool toolbarsAreVisible(WebPageProxy*);
  • trunk/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp

    r85808 r85860  
    2727#include "WebPageProxy.h"
    2828
    29 #include "NativeWebWheelEvent.h"
    3029#include "PageClient.h"
    3130#include "WebPopupMenuProxyWin.h"
     
    7776}
    7877
    79 void WebPageProxy::wheelEventNotHandled(NativeWebWheelEvent& event) const
    80 {
    81     const MSG* msg = event.nativeEvent();
    82     ::PostMessage(::GetParent(nativeWindow()), msg->message, msg->wParam, msg->lParam);
    83 }
    84 
    8578} // namespace WebKit
  • trunk/Tools/ChangeLog

    r85827 r85860  
     12011-05-05  Jeff Miller  <jeffm@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add didNotHandleWheelEvent callback to WKPageUIClient
     6        https://bugs.webkit.org/show_bug.cgi?id=60203
     7
     8        * MiniBrowser/gtk/BrowserWindow.c:
     9        (browserWindowUIClientInit): Stub out didNotHandleWheelEvent callback.
     10        * MiniBrowser/mac/BrowserWindowController.m:
     11        (-[BrowserWindowController awakeFromNib]): Stub out didNotHandleWheelEvent callback.
     12        * MiniBrowser/win/BrowserView.cpp:
     13        (BrowserView::create): Stub out didNotHandleWheelEvent callback.
     14        * WebKitTestRunner/TestController.cpp:
     15        (WTR::TestController::createOtherPage): Stub out didNotHandleWheelEvent callback.
     16        (WTR::TestController::initialize): Stub out didNotHandleWheelEvent callback.
     17
    1182011-05-04  Eric Seidel  <eric@webkit.org>
    219
  • trunk/Tools/MiniBrowser/gtk/BrowserWindow.c

    r85313 r85860  
    423423        0,      /* missingPluginButtonClicked */
    424424        0,      /* didNotHandleKeyEvent */
     425        0,      /* didNotHandleWheelEvent */
    425426        0,      /* toolbarsAreVisible */
    426427        0,      /* setToolbarsAreVisible */
  • trunk/Tools/MiniBrowser/mac/BrowserWindowController.m

    r85120 r85860  
    630630        0,          /* missingPluginButtonClicked */
    631631        0,          /* didNotHandleKeyEvent */
     632        0,          /* didNotHandleWheelEvent */
    632633        0,          /* toolbarsAreVisible */
    633634        0,          /* setToolbarsAreVisible */
  • trunk/Tools/MiniBrowser/win/BrowserView.cpp

    r84702 r85860  
    108108        mouseDidMoveOverElement,
    109109        0,          /* didNotHandleKeyEvent */
     110        0,          /* didNotHandleWheelEvent */
    110111        0,          /* toolbarsAreVisible */
    111112        0,          /* setToolbarsAreVisible */
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r85120 r85860  
    152152        0, // missingPluginButtonClicked
    153153        0, // didNotHandleKeyEvent
     154        0, // didNotHandleWheelEvent
    154155        0, // toolbarsAreVisible
    155156        0, // setToolbarsAreVisible
     
    294295        0, // missingPluginButtonClicked
    295296        0, // didNotHandleKeyEvent
     297        0, // didNotHandleWheelEvent
    296298        0, // toolbarsAreVisible
    297299        0, // setToolbarsAreVisible
Note: See TracChangeset for help on using the changeset viewer.