Add a new wheelEvent method to ScrollView. Platforms that wish
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2006 22:37:28 +0000 (22:37 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2006 22:37:28 +0000 (22:37 +0000)
        to handle the wheel event for the scroll view themselves can then
        do so there.  (Mac lets the underlying NSScrollView do it for now.)

        * page/FrameView.cpp:
        (WebCore::FrameView::handleWheelEvent):
        * platform/ScrollView.h:
        (WebCore::ScrollView::wheelEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16485 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/FrameView.cpp
WebCore/platform/ScrollView.h

index c8fa60a6ffc744d56599c0e3a96fb8827bc5db3e..b5fd394aa8a567bf588bffab636c7d738b1b3925 100644 (file)
@@ -1,3 +1,14 @@
+2006-09-20  David Hyatt  <hyatt@apple.com>
+
+        Add a new wheelEvent method to ScrollView.  Platforms that wish
+        to handle the wheel event for the scroll view themselves can then
+        do so there.  (Mac lets the underlying NSScrollView do it for now.)
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::handleWheelEvent):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::wheelEvent):
+
 2006-09-20  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Tim Omernick
index a6e5446d6343d54c89e151f8f03fb378d7e57949..1425a15d72e0d856e1e9edff9b5cc7e9d9b827b9 100644 (file)
@@ -1199,6 +1199,9 @@ void FrameView::handleWheelEvent(PlatformWheelEvent& e)
                     if (e.deltaY() && node->renderer()->scroll(e.deltaY() < 0 ? ScrollDown : ScrollUp, ScrollByWheel,
                                                                e.deltaY() < 0 ? -e.deltaY() : e.deltaY()))
                         e.accept();
+                        
+                    if (!e.isAccepted())
+                        wheelEvent(e);
                 }
             }
         }
index a3ca611fd74eb52f590d6434bc431452af86489e..fc02ecd03166a362f4053a97cd465cfefe0a969b 100644 (file)
@@ -36,6 +36,7 @@ class QScrollArea;
 
 namespace WebCore {
     class FloatRect;
+    class PlatformWheelEvent;
 
     class ScrollView : public Widget {
     public:
@@ -77,6 +78,11 @@ namespace WebCore {
 
         bool inWindow() const;
 
+        // This method exists for scrollviews that need to handle wheel events manually.
+        // On Mac the underlying NSScrollView just does the scrolling, but on other platforms
+        // (like Windows), we need this method in order to do the scroll ourselves.
+        void wheelEvent(PlatformWheelEvent&) {};
+
 #if __APPLE__
         NSView* getDocumentView() const;
 #endif