Fix a few mistakes that landed with r163749.
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Feb 2014 09:08:02 +0000 (09:08 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Feb 2014 09:08:02 +0000 (09:08 +0000)
Rubber-stamped by Carlos Garcia Campos.

Source/WebCore:

* platform/gtk/GtkTouchContextHelper.cpp:
(WebCore::GtkTouchContextHelper::handleEvent): When handling GDK_TOUCH_BEGIN, the assertion
should ensure that the sequence-to-event map doesn't yet contain pairs with the specific
sequence as the key.

Tools:

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::addTouchPoint): Avoid using the GUniquePtr<GdkEvent> after it's been moved
into the event vector since moving it invalidates the variable.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp

index 302559e..a3f790e 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-10  Zan Dobersek  <zdobersek@igalia.com>
+
+        Fix a few mistakes that landed with r163749.
+
+        Rubber-stamped by Carlos Garcia Campos.
+
+        * platform/gtk/GtkTouchContextHelper.cpp:
+        (WebCore::GtkTouchContextHelper::handleEvent): When handling GDK_TOUCH_BEGIN, the assertion
+        should ensure that the sequence-to-event map doesn't yet contain pairs with the specific
+        sequence as the key.
+
 2014-02-10  David Kilzer  <ddkilzer@apple.com>
 
         Add type-safe casts for ContentData subclasses
index 0e1bc9b..da79384 100644 (file)
@@ -37,7 +37,7 @@ bool GtkTouchContextHelper::handleEvent(GdkEvent* touchEvent)
 
     switch (touchEvent->type) {
     case GDK_TOUCH_BEGIN: {
-        ASSERT(m_touchEvents.contains(sequence));
+        ASSERT(!m_touchEvents.contains(sequence));
         GUniquePtr<GdkEvent> event(gdk_event_copy(touchEvent));
         m_touchEvents.add(sequence, std::move(event));
         break;
index 2b36c17..cc99254 100644 (file)
@@ -1,3 +1,13 @@
+2014-02-10  Zan Dobersek  <zdobersek@igalia.com>
+
+        Fix a few mistakes that landed with r163749.
+
+        Rubber-stamped by Carlos Garcia Campos.
+
+        * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
+        (WTR::EventSenderProxy::addTouchPoint): Avoid using the GUniquePtr<GdkEvent> after it's been moved
+        into the event vector since moving it invalidates the variable.
+
 2014-02-09  Carlos Garnacho  <carlosg@gnome.org>
 
         [GTK] Fix modifiers on EventSenderProxy::keyDown
index 42bedff..ef9b93f 100644 (file)
@@ -471,8 +471,8 @@ void EventSenderProxy::addTouchPoint(int x, int y)
     // Touch ID is array index plus one, so 0 is skipped.
     GUniquePtr<GdkEvent> event = createTouchEvent(static_cast<GdkEventType>(GDK_TOUCH_BEGIN), m_touchEvents.size() + 1);
     updateEventCoordinates(event.get(), x, y);
-    m_touchEvents.append(std::move(event));
     m_updatedTouchEvents.add(GPOINTER_TO_INT(event->touch.sequence));
+    m_touchEvents.append(std::move(event));
 }
 
 void EventSenderProxy::updateTouchPoint(int index, int x, int y)