Title: [125981] trunk/Source/WebKit/chromium
- Revision
- 125981
- Author
- [email protected]
- Date
- 2012-08-19 12:49:17 -0700 (Sun, 19 Aug 2012)
Log Message
[chromium] Add additional fields to WebGestureEvent
https://bugs.webkit.org/show_bug.cgi?id=94238
Patch by Rick Byers <[email protected]> on 2012-08-19
Reviewed by James Robinson.
Add a union to WebGestureEvent with per-event-type data, as a first
step to eliminating the overloaded delta fields.
* public/WebInputEvent.h:
(WebGestureEvent):
(WebKit::WebGestureEvent::WebGestureEvent):
* src/WebInputEvent.cpp:
(SameSizeAsWebGestureEvent):
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (125980 => 125981)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-19 19:34:18 UTC (rev 125980)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-19 19:49:17 UTC (rev 125981)
@@ -1,3 +1,19 @@
+2012-08-19 Rick Byers <[email protected]>
+
+ [chromium] Add additional fields to WebGestureEvent
+ https://bugs.webkit.org/show_bug.cgi?id=94238
+
+ Reviewed by James Robinson.
+
+ Add a union to WebGestureEvent with per-event-type data, as a first
+ step to eliminating the overloaded delta fields.
+
+ * public/WebInputEvent.h:
+ (WebGestureEvent):
+ (WebKit::WebGestureEvent::WebGestureEvent):
+ * src/WebInputEvent.cpp:
+ (SameSizeAsWebGestureEvent):
+
2012-08-19 Pavel Feldman <[email protected]>
Web Inspector: load network panel lazily
Modified: trunk/Source/WebKit/chromium/public/WebInputEvent.h (125980 => 125981)
--- trunk/Source/WebKit/chromium/public/WebInputEvent.h 2012-08-19 19:34:18 UTC (rev 125980)
+++ trunk/Source/WebKit/chromium/public/WebInputEvent.h 2012-08-19 19:49:17 UTC (rev 125981)
@@ -370,15 +370,41 @@
int globalX;
int globalY;
- // NOTE: |deltaX| and |deltaY| represents the amount to scroll for Scroll gesture events.
- // For Pinch gesture events, |deltaX| represents the scaling/magnification factor.
- // For a GestureTap event, |deltaX| represents the tap count.
- // For a FlingStart event, |deltaX| and |deltaY| represent the velocity.
- // FIXME: Avoid overloading 'delta' in this way. http://wkb.ug/93123
+ // FIXME: These are currently overloaded. We're in the process of moving
+ // to the union below. http://wkb.ug/93123
float deltaX;
float deltaY;
WebRect boundingBox;
+ union {
+ struct {
+ int tapCount;
+ int width;
+ int height;
+ } tap;
+
+ struct {
+ int width;
+ int height;
+ } longPress;
+
+ struct {
+ float deltaX;
+ float deltaY;
+ float velocityX;
+ float velocityY;
+ } scrollUpdate;
+
+ struct {
+ float velocityX;
+ float velocityY;
+ } flingStart;
+
+ struct {
+ float scale;
+ } pinchUpdate;
+ } data;
+
WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent))
: WebInputEvent(sizeParam)
, x(0)
@@ -388,6 +414,7 @@
, deltaX(0.0f)
, deltaY(0.0f)
{
+ memset(&data, 0, sizeof(data));
}
};
Modified: trunk/Source/WebKit/chromium/src/WebInputEvent.cpp (125980 => 125981)
--- trunk/Source/WebKit/chromium/src/WebInputEvent.cpp 2012-08-19 19:34:18 UTC (rev 125980)
+++ trunk/Source/WebKit/chromium/src/WebInputEvent.cpp 2012-08-19 19:49:17 UTC (rev 125981)
@@ -60,7 +60,7 @@
};
struct SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent {
- int gestureData[10];
+ int gestureData[14];
};
struct SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes