[iOS WK2] Can't scroll on gatesnotes.com
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 17:29:20 +0000 (17:29 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 17:29:20 +0000 (17:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132459
<rdar://problem/16770909>

Reviewed by Benjamin Poulain.

The custom UIView hit-testing code was finding views that were created by
the compositing code for clipping, above the UIScrollViews. We only ever
need to find UIScrollViews here for touch overflow-scrolling, so constrain
the hit-testing code to only return UIScrollViews.

* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]):
(-[UIView _findDescendantViewAtPoint:withEvent:]):
(-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm

index c70cfa4..28d6e14 100644 (file)
@@ -1,3 +1,21 @@
+2014-05-01  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Can't scroll on gatesnotes.com 
+        https://bugs.webkit.org/show_bug.cgi?id=132459
+        <rdar://problem/16770909>
+
+        Reviewed by Benjamin Poulain.
+        
+        The custom UIView hit-testing code was finding views that were created by
+        the compositing code for clipping, above the UIScrollViews. We only ever
+        need to find UIScrollViews here for touch overflow-scrolling, so constrain
+        the hit-testing code to only return UIScrollViews.
+
+        * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
+        (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]):
+        (-[UIView _findDescendantViewAtPoint:withEvent:]):
+        (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted.
+
 2014-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         REGRESSION(r168118): [GTK] build broken due to shouldTrackVisitedLinks
index 44cc000..86b3e7e 100644 (file)
@@ -49,7 +49,8 @@ using namespace WebCore;
 
 // UIView hit testing assumes that views should only hit test subviews that are entirely contained
 // in the view. This is not true of web content.
-- (UIView *)_recursiveFindDescendantViewAtPoint:(CGPoint)point withEvent:(UIEvent *)event
+// We only want to find UIScrollViews here. Other views are ignored.
+- (UIView *)_recursiveFindDescendantScrollViewAtPoint:(CGPoint)point withEvent:(UIEvent *)event
 {
     if (self.clipsToBounds && ![self pointInside:point withEvent:event])
         return nil;
@@ -58,13 +59,13 @@ using namespace WebCore;
     [[self subviews] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {
         CGPoint subviewPoint = [view convertPoint:point fromView:self];
 
-        if ([view pointInside:subviewPoint withEvent:event])
+        if ([view pointInside:subviewPoint withEvent:event] && [view isKindOfClass:[UIScrollView class]])
             foundView = view;
 
         if (![view subviews])
             return;
 
-        if (UIView *hitView = [view _recursiveFindDescendantViewAtPoint:subviewPoint withEvent:event])
+        if (UIView *hitView = [view _recursiveFindDescendantScrollViewAtPoint:subviewPoint withEvent:event])
             foundView = hitView;
     }];
 
@@ -73,7 +74,7 @@ using namespace WebCore;
 
 - (UIView *)_findDescendantViewAtPoint:(CGPoint)point withEvent:(UIEvent *)event
 {
-    return [self _recursiveFindDescendantViewAtPoint:point withEvent:event];
+    return [self _recursiveFindDescendantScrollViewAtPoint:point withEvent:event];
 }
 
 @end