Title: [194186] trunk/Source/WebKit2
Revision
194186
Author
[email protected]
Date
2015-12-16 16:13:27 -0800 (Wed, 16 Dec 2015)

Log Message

REGRESSION (r194125): Crashes in touchesEndedWithEvent on occasion when interacting with the page
https://bugs.webkit.org/show_bug.cgi?id=152366
<rdar://problem/23929672>

Reviewed by Beth Dakin.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::touchesEndedWithEvent):
(WebKit::WebViewImpl::touchesCancelledWithEvent):
NSTouch identifiers aren't pointer-comparable. We need to use isEqual to
compare them and find the ones to remove.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (194185 => 194186)


--- trunk/Source/WebKit2/ChangeLog	2015-12-16 23:59:13 UTC (rev 194185)
+++ trunk/Source/WebKit2/ChangeLog	2015-12-17 00:13:27 UTC (rev 194186)
@@ -1,3 +1,17 @@
+2015-12-16  Tim Horton  <[email protected]>
+
+        REGRESSION (r194125): Crashes in touchesEndedWithEvent on occasion when interacting with the page
+        https://bugs.webkit.org/show_bug.cgi?id=152366
+        <rdar://problem/23929672>
+
+        Reviewed by Beth Dakin.
+
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::touchesEndedWithEvent):
+        (WebKit::WebViewImpl::touchesCancelledWithEvent):
+        NSTouch identifiers aren't pointer-comparable. We need to use isEqual to
+        compare them and find the ones to remove.
+
 2015-12-16  Simon Fraser  <[email protected]>
 
         Simplify isOverlayScrollbar() logic

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (194185 => 194186)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2015-12-16 23:59:13 UTC (rev 194185)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2015-12-17 00:13:27 UTC (rev 194186)
@@ -3173,9 +3173,12 @@
 {
     m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
     for (NSTouch *touch in [event touchesMatchingPhase:NSTouchPhaseEnded inView:m_view]) {
-        size_t identityIndex = m_activeTouchIdentities.find(touch.identity);
-        ASSERT(identityIndex != notFound);
-        m_activeTouchIdentities.remove(identityIndex);
+        for (size_t i = 0; i < m_activeTouchIdentities.size(); i++) {
+            if ([m_activeTouchIdentities[i] isEqual:touch.identity]) {
+                m_activeTouchIdentities.remove(i);
+                break;
+            }
+        }
     }
 }
 
@@ -3183,9 +3186,12 @@
 {
     m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
     for (NSTouch *touch in [event touchesMatchingPhase:NSTouchPhaseCancelled inView:m_view]) {
-        size_t identityIndex = m_activeTouchIdentities.find(touch.identity);
-        ASSERT(identityIndex != notFound);
-        m_activeTouchIdentities.remove(identityIndex);
+        for (size_t i = 0; i < m_activeTouchIdentities.size(); i++) {
+            if ([m_activeTouchIdentities[i] isEqual:touch.identity]) {
+                m_activeTouchIdentities.remove(i);
+                break;
+            }
+        }
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to