Title: [124633] trunk/Source/WebCore
- Revision
- 124633
- Author
- [email protected]
- Date
- 2012-08-03 11:39:31 -0700 (Fri, 03 Aug 2012)
Log Message
Avoid dispatching gesture events of unknown types
https://bugs.webkit.org/show_bug.cgi?id=93060
Patch by Sadrul Habib Chowdhury <[email protected]> on 2012-08-03
Reviewed by Adam Barth.
WebCore gesture events do not always correspond 1-to-1 to the Platform gesture events. So
avoid dispatching the unknown gesture events to nodes.
* dom/GestureEvent.cpp:
(WebCore::GestureEvent::create):
* dom/Node.cpp:
(WebCore::Node::dispatchGestureEvent):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (124632 => 124633)
--- trunk/Source/WebCore/ChangeLog 2012-08-03 18:36:30 UTC (rev 124632)
+++ trunk/Source/WebCore/ChangeLog 2012-08-03 18:39:31 UTC (rev 124633)
@@ -1,3 +1,18 @@
+2012-08-03 Sadrul Habib Chowdhury <[email protected]>
+
+ Avoid dispatching gesture events of unknown types
+ https://bugs.webkit.org/show_bug.cgi?id=93060
+
+ Reviewed by Adam Barth.
+
+ WebCore gesture events do not always correspond 1-to-1 to the Platform gesture events. So
+ avoid dispatching the unknown gesture events to nodes.
+
+ * dom/GestureEvent.cpp:
+ (WebCore::GestureEvent::create):
+ * dom/Node.cpp:
+ (WebCore::Node::dispatchGestureEvent):
+
2012-08-03 Stephen Chenney <[email protected]>
Crash when a clip path referencing a clip path changes documents
Modified: trunk/Source/WebCore/dom/GestureEvent.cpp (124632 => 124633)
--- trunk/Source/WebCore/dom/GestureEvent.cpp 2012-08-03 18:36:30 UTC (rev 124632)
+++ trunk/Source/WebCore/dom/GestureEvent.cpp 2012-08-03 18:39:31 UTC (rev 124633)
@@ -59,7 +59,7 @@
case PlatformEvent::GesturePinchEnd:
case PlatformEvent::GesturePinchUpdate:
default:
- ASSERT_NOT_REACHED();
+ return 0;
}
return adoptRef(new GestureEvent(eventType, view, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.deltaX(), event.deltaY()));
}
Modified: trunk/Source/WebCore/dom/Node.cpp (124632 => 124633)
--- trunk/Source/WebCore/dom/Node.cpp 2012-08-03 18:36:30 UTC (rev 124632)
+++ trunk/Source/WebCore/dom/Node.cpp 2012-08-03 18:39:31 UTC (rev 124633)
@@ -2631,7 +2631,10 @@
#if ENABLE(GESTURE_EVENTS)
bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
{
- return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::create(GestureEvent::create(document()->defaultView(), event)));
+ RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document()->defaultView(), event);
+ if (!gestureEvent.get())
+ return false;
+ return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::create(gestureEvent));
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes