[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
jam at chromium.org
jam at chromium.org
Wed Mar 17 18:31:57 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit d5934e79e995956993b8c227e10a12b4df35d1bf
Author: jam at chromium.org <jam at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Mar 10 21:59:44 2010 +0000
2010-03-10 John Abd-El-Malek <jam at chromium.org>
Reviewed by Darin Fisher.
https://bugs.webkit.org/show_bug.cgi?id=35952
Propagate mouse wheel events to Pepper plugins.
* src/WebInputEventConversion.cpp:
(WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
* src/WebInputEventConversion.h:
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::handleEvent):
(WebKit::WebPluginContainerImpl::handleMouseEvent):
(WebKit::WebPluginContainerImpl::handleWheelEvent):
(WebKit::WebPluginContainerImpl::handleKeyboardEvent):
* src/WebPluginContainerImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 79f3f52..e8d8abb 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-10 John Abd-El-Malek <jam at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35952
+ Propagate mouse wheel events to Pepper plugins.
+
+ * src/WebInputEventConversion.cpp:
+ (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
+ * src/WebInputEventConversion.h:
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::handleEvent):
+ (WebKit::WebPluginContainerImpl::handleMouseEvent):
+ (WebKit::WebPluginContainerImpl::handleWheelEvent):
+ (WebKit::WebPluginContainerImpl::handleKeyboardEvent):
+ * src/WebPluginContainerImpl.h:
+
2010-03-10 Garret Kelly <gdk at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp
index 2406e4a..6a990aa 100644
--- a/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -40,6 +40,7 @@
#include "PlatformWheelEvent.h"
#include "ScrollView.h"
#include "WebInputEvent.h"
+#include "WheelEvent.h"
#include "Widget.h"
using namespace WebCore;
@@ -289,6 +290,27 @@ WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEv
clickCount = event.detail();
}
+WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const ScrollView* view, const WheelEvent& event)
+{
+ if (event.type() != eventNames().mousewheelEvent)
+ return;
+ type = WebInputEvent::MouseWheel;
+ timeStampSeconds = event.timeStamp() * 1.0e-3;
+ modifiers = getWebInputModifiers(event);
+ IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY()));
+ globalX = event.screenX();
+ globalY = event.screenY();
+ windowX = p.x();
+ windowY = p.y();
+ x = event.offsetX();
+ y = event.offsetY();
+ deltaX = static_cast<float>(event.wheelDeltaX());
+ deltaY = static_cast<float>(event.wheelDeltaY());
+ wheelTicksX = static_cast<float>(event.rawDeltaX());
+ wheelTicksY = static_cast<float>(event.rawDeltaY());
+ scrollByPage = event.granularity() == WheelEvent::Page;
+}
+
WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
{
if (event.type() == eventNames().keydownEvent)
diff --git a/WebKit/chromium/src/WebInputEventConversion.h b/WebKit/chromium/src/WebInputEventConversion.h
index bf8bb23..3018973 100644
--- a/WebKit/chromium/src/WebInputEventConversion.h
+++ b/WebKit/chromium/src/WebInputEventConversion.h
@@ -44,6 +44,7 @@ namespace WebCore {
class KeyboardEvent;
class MouseEvent;
class ScrollView;
+class WheelEvent;
class Widget;
}
@@ -86,7 +87,7 @@ public:
#endif
// Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. view is
-// the ScrollView corresponding to the event. Returns true if successful.
+// the ScrollView corresponding to the event.
// NOTE: This is only implemented for mousemove, mouseover, mouseout,
// mousedown and mouseup. If the event mapping fails, the event type will
// be set to Undefined.
@@ -95,10 +96,16 @@ public:
WebMouseEventBuilder(const WebCore::ScrollView*, const WebCore::MouseEvent&);
};
+// Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent.
+// If the event mapping fails, the event type will be set to Undefined.
+class WebMouseWheelEventBuilder : public WebMouseWheelEvent {
+public:
+ WebMouseWheelEventBuilder(const WebCore::ScrollView*, const WebCore::WheelEvent&);
+};
+
// Converts a WebCore::KeyboardEvent to a corresponding WebKeyboardEvent.
-// Returns true if successful. NOTE: This is only implemented for keydown
-// and keyup. If the event mapping fails, the event type will be set to
-// Undefined.
+// NOTE: This is only implemented for keydown and keyup. If the event mapping
+// fails, the event type will be set to Undefined.
class WebKeyboardEventBuilder : public WebKeyboardEvent {
public:
WebKeyboardEventBuilder(const WebCore::KeyboardEvent&);
diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp
index dd3fc1a..051979b 100644
--- a/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -60,6 +60,7 @@
#include "MouseEvent.h"
#include "Page.h"
#include "ScrollView.h"
+#include "WheelEvent.h"
#if WEBKIT_USING_SKIA
#include "PlatformContextSkia.h"
@@ -160,6 +161,8 @@ void WebPluginContainerImpl::handleEvent(Event* event)
// where mozilla behaves differently than the spec.
if (event->isMouseEvent())
handleMouseEvent(static_cast<MouseEvent*>(event));
+ else if (event->isWheelEvent())
+ handleWheelEvent(static_cast<WheelEvent*>(event));
else if (event->isKeyboardEvent())
handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
}
@@ -359,8 +362,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
}
WebCursorInfo cursorInfo;
- bool handled = m_webPlugin->handleInputEvent(webEvent, cursorInfo);
- if (handled)
+ if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
event->setDefaultHandled();
// A windowless plugin can change the cursor in response to a mouse move
@@ -374,15 +376,26 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
chromeClient->setCursorForPlugin(cursorInfo);
}
+void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event)
+{
+ FrameView* parentView = static_cast<FrameView*>(parent());
+ WebMouseWheelEventBuilder webEvent(parentView, *event);
+ if (webEvent.type == WebInputEvent::Undefined)
+ return;
+
+ WebCursorInfo cursorInfo;
+ if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+ event->setDefaultHandled();
+}
+
void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event)
{
WebKeyboardEventBuilder webEvent(*event);
if (webEvent.type == WebInputEvent::Undefined)
return;
- WebCursorInfo cursor_info;
- bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info);
- if (handled)
+ WebCursorInfo cursorInfo;
+ if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
event->setDefaultHandled();
}
diff --git a/WebKit/chromium/src/WebPluginContainerImpl.h b/WebKit/chromium/src/WebPluginContainerImpl.h
index 8e1b75a..890098c 100644
--- a/WebKit/chromium/src/WebPluginContainerImpl.h
+++ b/WebKit/chromium/src/WebPluginContainerImpl.h
@@ -48,6 +48,7 @@ class KeyboardEvent;
class MouseEvent;
class ResourceError;
class ResourceResponse;
+class WheelEvent;
}
namespace WebKit {
@@ -104,6 +105,7 @@ private:
~WebPluginContainerImpl();
void handleMouseEvent(WebCore::MouseEvent*);
+ void handleWheelEvent(WebCore::WheelEvent*);
void handleKeyboardEvent(WebCore::KeyboardEvent*);
void calculateGeometry(const WebCore::IntRect& frameRect,
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list