[iOS WK2] Make view debugging easier
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2014 22:39:02 +0000 (22:39 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2014 22:39:02 +0000 (22:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132892

Reviewed by Tim Horton.

Enhance -[WKCompositingView description] to show WebKit-related information
which is useful when dumping a window's UIView hierarchy.

Also have WKTransformView and WKRemoteView inherit from WKCompositingView,
and thereby get the hitTest:withEvent: override for free, as well as better dumping.

* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(-[WKCompositingView description]):
(-[WKTransformView hitTest:withEvent:]): Deleted.
(-[WKRemoteView hitTest:withEvent:]): Deleted.

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

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

index 5f541a0..b1f3df5 100644 (file)
@@ -1,3 +1,21 @@
+2014-05-13  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Make view debugging easier
+        https://bugs.webkit.org/show_bug.cgi?id=132892
+
+        Reviewed by Tim Horton.
+        
+        Enhance -[WKCompositingView description] to show WebKit-related information
+        which is useful when dumping a window's UIView hierarchy.
+        
+        Also have WKTransformView and WKRemoteView inherit from WKCompositingView,
+        and thereby get the hitTest:withEvent: override for free, as well as better dumping.
+
+        * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
+        (-[WKCompositingView description]):
+        (-[WKTransformView hitTest:withEvent:]): Deleted.
+        (-[WKRemoteView hitTest:withEvent:]): Deleted.
+
 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
 
         [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page
index 3bd91f6..d7da44b 100644 (file)
@@ -84,9 +84,16 @@ using namespace WebCore;
 {
     return [self _findDescendantViewAtPoint:point withEvent:event];
 }
+
+- (NSString *)description
+{
+    NSString *viewDescription = [super description];
+    NSString *webKitDetails = [NSString stringWithFormat:@" layerID = %llu \"%@\"", WebKit::RemoteLayerTreeHost::layerID(self.layer), self.layer.name ? self.layer.name : @""];
+    return [viewDescription stringByAppendingString:webKitDetails];
+}
 @end
 
-@interface WKTransformView : UIView
+@interface WKTransformView : WKCompositingView
 @end
 
 @implementation WKTransformView
@@ -95,13 +102,9 @@ using namespace WebCore;
     return [CATransformLayer self];
 }
 
-- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
-{
-    return [self _findDescendantViewAtPoint:point withEvent:event];
-}
 @end
 
-@interface WKRemoteView : UIView
+@interface WKRemoteView : WKCompositingView
 @end
 
 @implementation WKRemoteView
@@ -119,11 +122,6 @@ using namespace WebCore;
     return NSClassFromString(@"CALayerHost");
 }
 
-- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
-{
-    return [self _findDescendantViewAtPoint:point withEvent:event];
-}
-
 @end
 
 namespace WebKit {