* Follow the EventHandlerWin.cpp and always return true in the handlers.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2008 09:55:50 +0000 (09:55 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2008 09:55:50 +0000 (09:55 +0000)
* Match the windows implementation more closely as well.
* This is fixing "selection" bugs with the Web Inspector

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

WebCore/ChangeLog
WebCore/page/qt/EventHandlerQt.cpp

index 122103a60c3de03dd0f07e6fb1862d33cba8fce3..b886711f2da7059ba0a1856933295d54e21e2fa9 100644 (file)
@@ -1,3 +1,18 @@
+2008-01-16  Holger Freyther  <holger.freyther@trolltech.com>
+
+        Reviewed by Simon.
+
+        * Follow the EventHandlerWin.cpp and always return true in the handlers.
+        * Match the windows implementation more closely as well.
+        * This is fixing "selection" bugs with the Web Inspector
+
+        * page/qt/EventHandlerQt.cpp:
+        (WebCore::EventHandler::focusDocumentView):
+        (WebCore::EventHandler::passMousePressEventToSubframe):
+        (WebCore::EventHandler::passMouseMoveEventToSubframe):
+        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+        (WebCore::EventHandler::passMousePressEventToScrollbar):
+
 2008-01-16  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed by Lars Knoll <lars@trolltech.com>.
index b55e90ad3e7a9a31a717bfb806348095579f90fc..ce16f5b99346794fd56800ee2215ef28da68993a 100644 (file)
@@ -1,5 +1,7 @@
 /*
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007 Trolltech ASA
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -75,26 +77,12 @@ bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
 void EventHandler::focusDocumentView()
 {
     Page* page = m_frame->page();
-    if (page)
-        page->focusController()->setFocusedFrame(m_frame);
+    if (!page)
+        return;
+    page->focusController()->setFocusedFrame(m_frame);
 }
 
-bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
-{
-    // Figure out which view to send the event to.
-    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
-    if (!target || !target->isWidget())
-        return false;
-
-    return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget());
-}
-
-bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
-{
-    return passMouseDownEventToWidget(renderWidget->widget());
-}
-
-bool EventHandler::passMouseDownEventToWidget(Widget* widget)
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&)
 {
     notImplemented();
     return false;
@@ -108,24 +96,6 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
     return false;
 }
 
-bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe, HitTestResult*)
-{
-    Q_ASSERT(subframe);
-    PlatformMouseEvent ev = event.event();
-    switch(ev.eventType()) {
-    case MouseEventMoved:
-        return subframe->eventHandler()->handleMouseMoveEvent(ev);
-    case MouseEventPressed:
-        return subframe->eventHandler()->handleMousePressEvent(ev);
-    case MouseEventReleased:
-        return subframe->eventHandler()->handleMouseReleaseEvent(ev);
-    case MouseEventScroll:
-        return subframe->eventHandler()->handleMouseMoveEvent(ev);
-    default:
-      return false;
-    }
-}
-
 bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
 {
     Q_ASSERT(widget);
@@ -142,23 +112,27 @@ Clipboard* EventHandler::createDraggingClipboard() const
 
 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
 {
-    return passSubframeEventToSubframe(mev, subframe);
+    subframe->eventHandler()->handleMousePressEvent(mev.event());
+    return true;
 }
 
 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
 {
-    return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+    subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode);
+    return true;
 }
 
 bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
 {
-    return passSubframeEventToSubframe(mev, subframe);
+    subframe->eventHandler()->handleMouseReleaseEvent(mev.event());
+    return true;
 }
 
-bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults& event, PlatformScrollbar* scrollbar)
+bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, PlatformScrollbar* scrollbar)
 {
-    Q_ASSERT(scrollbar);
-    return scrollbar->handleMousePressEvent(event.event());
+    if (!scrollbar || !scrollbar->isEnabled())
+        return false;
+    return scrollbar->handleMousePressEvent(mev.event());
 }
 
 }