Title: [174704] trunk/Source
Revision
174704
Author
[email protected]
Date
2014-10-14 15:23:37 -0700 (Tue, 14 Oct 2014)

Log Message

Improve debug description of WAKViews
https://bugs.webkit.org/show_bug.cgi?id=137716

Reviewed by Simon Fraser.

Source/WebCore:

No new tests because there is no behavior change.

* platform/ios/wak/WAKView.mm:
(-[WAKView description]):
* platform/ios/wak/WKView.h:
* platform/ios/wak/WKView.mm:
(WKViewGetOrigin):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _touchEventRegions]): Adding a comment.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174703 => 174704)


--- trunk/Source/WebCore/ChangeLog	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebCore/ChangeLog	2014-10-14 22:23:37 UTC (rev 174704)
@@ -1,3 +1,18 @@
+2014-10-14  Myles C. Maxfield  <[email protected]>
+
+        Improve debug description of WAKViews
+        https://bugs.webkit.org/show_bug.cgi?id=137716
+
+        Reviewed by Simon Fraser.
+
+        No new tests because there is no behavior change.
+
+        * platform/ios/wak/WAKView.mm:
+        (-[WAKView description]):
+        * platform/ios/wak/WKView.h:
+        * platform/ios/wak/WKView.mm:
+        (WKViewGetOrigin):
+
 2014-10-14  Chris Dumez  <[email protected]>
 
         Introduce an isCSSAnimated flag on RenderElement for performance

Modified: trunk/Source/WebCore/platform/ios/wak/WAKView.mm (174703 => 174704)


--- trunk/Source/WebCore/platform/ios/wak/WAKView.mm	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebCore/platform/ios/wak/WAKView.mm	2014-10-14 22:23:37 UTC (rev 174704)
@@ -754,7 +754,20 @@
 {
     NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: WAK: %p (WK: %p); ", [self class], self, viewRef];
 
+    float scale = [self scale];
+    if (scale != 1)
+        [description appendFormat:@"scale = %g ", scale];
+
+    CGPoint origin = WKViewGetOrigin(viewRef);
+    if (origin.x || origin.y)
+        [description appendFormat:@"origin = (%g %g) ", origin.x, origin.y];
+
+    CGRect bounds = [self bounds];
     CGRect frame = [self frame];
+
+    if (frame.origin.x != bounds.origin.x || frame.origin.y != bounds.origin.y || frame.size.width != bounds.size.width || frame.size.height != bounds.size.height)
+        [description appendFormat:@"bounds = (%g %g; %g %g) ", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height];
+
     [description appendFormat:@"frame = (%g %g; %g %g)>", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height];
 
     return description;

Modified: trunk/Source/WebCore/platform/ios/wak/WKView.h (174703 => 174704)


--- trunk/Source/WebCore/platform/ios/wak/WKView.h	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebCore/platform/ios/wak/WKView.h	2014-10-14 22:23:37 UTC (rev 174704)
@@ -112,6 +112,8 @@
 
 WEBCORE_EXPORT CGRect WKViewGetFrame (WKViewRef view);
 
+CGPoint WKViewGetOrigin(WKViewRef);
+
 WEBCORE_EXPORT void WKViewSetScale (WKViewRef view, float scale);
 WEBCORE_EXPORT float WKViewGetScale (WKViewRef view);
 CGAffineTransform _WKViewGetTransform(WKViewRef view);

Modified: trunk/Source/WebCore/platform/ios/wak/WKView.mm (174703 => 174704)


--- trunk/Source/WebCore/platform/ios/wak/WKView.mm	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebCore/platform/ios/wak/WKView.mm	2014-10-14 22:23:37 UTC (rev 174704)
@@ -143,6 +143,16 @@
     return WKViewConvertRectToSuperview(view, view->bounds);
 }
 
+CGPoint WKViewGetOrigin(WKViewRef view)
+{
+    if (!view) {
+        WKError("invalid parameter");
+        return CGPointZero;
+    }
+
+    return view->origin;
+}
+
 static void _WKViewRecursivelyInvalidateGState(WKViewRef view)
 {
     if (!view) {

Modified: trunk/Source/WebKit/mac/ChangeLog (174703 => 174704)


--- trunk/Source/WebKit/mac/ChangeLog	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-10-14 22:23:37 UTC (rev 174704)
@@ -1,5 +1,15 @@
 2014-10-14  Myles C. Maxfield  <[email protected]>
 
+        Improve debug description of WAKViews
+        https://bugs.webkit.org/show_bug.cgi?id=137716
+
+        Reviewed by Simon Fraser.
+
+        * WebView/WebView.mm:
+        (-[WebView _touchEventRegions]): Adding a comment.
+
+2014-10-14  Myles C. Maxfield  <[email protected]>
+
         Addressing post-review comment.
         https://bugs.webkit.org/show_bug.cgi?id=137550
 

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (174703 => 174704)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2014-10-14 21:50:28 UTC (rev 174703)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2014-10-14 22:23:37 UTC (rev 174704)
@@ -3658,6 +3658,11 @@
         if (rect.isEmpty())
             continue;
 
+        // Note that these rectangles are in the coordinate system of the document (inside the WebHTMLView), which is not
+        // the same as the coordinate system of the WebView. If you want to do comparisons with locations in the WebView,
+        // you must convert between the two using WAKView's convertRect:toView: selector. This will take care of scaling
+        // and translations (which are relevant for right-to-left column layout).
+
         // The event region wants this points in this order:
         //  p2------p3
         //  |       |
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to