Diff
Modified: trunk/Source/WebCore/ChangeLog (106802 => 106803)
--- trunk/Source/WebCore/ChangeLog 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebCore/ChangeLog 2012-02-06 14:07:27 UTC (rev 106803)
@@ -1,3 +1,16 @@
+2012-02-06 Allan Sandfeld Jensen <[email protected]>
+
+ WebGestureEvent can not encode delta and area.
+ https://bugs.webkit.org/show_bug.cgi?id=77728
+
+ Add area field to PlatformGestureEvent.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * platform/PlatformGestureEvent.h:
+ (WebCore::PlatformGestureEvent::PlatformGestureEvent):
+ (WebCore::PlatformGestureEvent::area):
+
2012-02-06 Charles Wei <[email protected]>
[BlackBerry]Use extension for a mimetype as the suggested extension
Modified: trunk/Source/WebCore/platform/PlatformGestureEvent.h (106802 => 106803)
--- trunk/Source/WebCore/platform/PlatformGestureEvent.h 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebCore/platform/PlatformGestureEvent.h 2012-02-06 14:07:27 UTC (rev 106803)
@@ -28,7 +28,9 @@
#if ENABLE(GESTURE_EVENTS)
+#include "FloatPoint.h"
#include "IntPoint.h"
+#include "IntSize.h"
#include "PlatformEvent.h"
namespace WebCore {
@@ -51,15 +53,28 @@
{
}
+ PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, const IntSize& area, const FloatPoint& delta, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
+ : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
+ , m_position(position)
+ , m_globalPosition(globalPosition)
+ , m_area(area)
+ , m_deltaX(delta.x())
+ , m_deltaY(delta.y())
+ {
+ }
+
const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
+ const IntSize& area() const { return m_area; }
+
float deltaX() const { return m_deltaX; }
float deltaY() const { return m_deltaY; }
protected:
IntPoint m_position;
IntPoint m_globalPosition;
+ IntSize m_area;
float m_deltaX;
float m_deltaY;
};
Modified: trunk/Source/WebKit2/ChangeLog (106802 => 106803)
--- trunk/Source/WebKit2/ChangeLog 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-06 14:07:27 UTC (rev 106803)
@@ -1,3 +1,24 @@
+2012-02-06 Allan Sandfeld Jensen <[email protected]>
+
+ WebGestureEvent can not encode delta and area.
+ https://bugs.webkit.org/show_bug.cgi?id=77728
+
+ Support delta and area fields in WebGestureEvent, and send area with Qt tap gesture.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Shared/WebEvent.h:
+ (WebKit::WebGestureEvent::area):
+ (WebKit::WebGestureEvent::delta):
+ * Shared/WebEventConversion.cpp:
+ (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
+ * Shared/WebGestureEvent.cpp:
+ (WebKit::WebGestureEvent::WebGestureEvent):
+ (WebKit::WebGestureEvent::encode):
+ (WebKit::WebGestureEvent::decode):
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (QtWebPageEventHandler::handleSingleTapEvent):
+
2012-02-03 Zalan Bujtas <[email protected]> and Jocelyn Turcotte <[email protected]>
[Qt][WK2] Remove TiledDrawingArea and dependencies.
Modified: trunk/Source/WebKit2/Shared/WebEvent.h (106802 => 106803)
--- trunk/Source/WebKit2/Shared/WebEvent.h 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebKit2/Shared/WebEvent.h 2012-02-06 14:07:27 UTC (rev 106803)
@@ -29,8 +29,10 @@
// FIXME: We should probably move to makeing the WebCore/PlatformFooEvents trivial classes so that
// we can use them as the event type.
+#include <WebCore/FloatPoint.h>
#include <WebCore/FloatSize.h>
#include <WebCore/IntPoint.h>
+#include <WebCore/IntSize.h>
#include <wtf/text/WTFString.h>
namespace CoreIPC {
@@ -254,9 +256,12 @@
public:
WebGestureEvent() { }
WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp);
+ WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp, const WebCore::IntSize& area, const WebCore::FloatPoint& delta);
const WebCore::IntPoint position() const { return m_position; }
const WebCore::IntPoint globalPosition() const { return m_globalPosition; }
+ const WebCore::IntSize area() const { return m_area; }
+ const WebCore::FloatPoint delta() const { return m_delta; }
void encode(CoreIPC::ArgumentEncoder*) const;
static bool decode(CoreIPC::ArgumentDecoder*, WebGestureEvent&);
@@ -266,6 +271,8 @@
WebCore::IntPoint m_position;
WebCore::IntPoint m_globalPosition;
+ WebCore::IntSize m_area;
+ WebCore::FloatPoint m_delta;
};
#endif // ENABLE(GESTURE_EVENTS)
Modified: trunk/Source/WebKit2/Shared/WebEventConversion.cpp (106802 => 106803)
--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp 2012-02-06 14:07:27 UTC (rev 106803)
@@ -232,6 +232,10 @@
// PlatformGestureEvent
m_position = webEvent.position();
m_globalPosition = webEvent.globalPosition();
+
+ m_area = webEvent.area();
+ m_deltaX = webEvent.delta().x();
+ m_deltaY = webEvent.delta().y();
}
};
Modified: trunk/Source/WebKit2/Shared/WebGestureEvent.cpp (106802 => 106803)
--- trunk/Source/WebKit2/Shared/WebGestureEvent.cpp 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebKit2/Shared/WebGestureEvent.cpp 2012-02-06 14:07:27 UTC (rev 106803)
@@ -43,12 +43,24 @@
ASSERT(isGestureEventType(type));
}
+WebGestureEvent::WebGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, Modifiers modifiers, double timestamp, const IntSize& area, const FloatPoint& delta)
+ : WebEvent(type, modifiers, timestamp)
+ , m_position(position)
+ , m_globalPosition(globalPosition)
+ , m_area(area)
+ , m_delta(delta)
+{
+ ASSERT(isGestureEventType(type));
+}
+
void WebGestureEvent::encode(CoreIPC::ArgumentEncoder* encoder) const
{
WebEvent::encode(encoder);
encoder->encode(m_position);
encoder->encode(m_globalPosition);
+ encoder->encode(m_area);
+ encoder->encode(m_delta);
}
bool WebGestureEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebGestureEvent& t)
@@ -59,6 +71,10 @@
return false;
if (!decoder->decode(t.m_globalPosition))
return false;
+ if (!decoder->decode(t.m_area))
+ return false;
+ if (!decoder->decode(t.m_delta))
+ return false;
return true;
}
Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp (106802 => 106803)
--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp 2012-02-06 13:55:14 UTC (rev 106802)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp 2012-02-06 14:07:27 UTC (rev 106803)
@@ -298,7 +298,7 @@
m_postponeTextInputStateChanged = true;
QTransform fromItemTransform = m_webPage->transformFromItem();
- WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0);
+ WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0));
m_webPageProxy->handleGestureEvent(gesture);
}