Title: [208799] trunk/Source/WebKit2
Revision
208799
Author
[email protected]
Date
2016-11-16 11:13:04 -0800 (Wed, 16 Nov 2016)

Log Message

Add logging support to VisibleContentRectUpdateInfo
https://bugs.webkit.org/show_bug.cgi?id=164825

Reviewed by Zalan Bujtas.

Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
stream does single-line output, so also make a convenience dump() function that will
product multiline output. Result look like:

    (VisibleContentRectUpdateInfo
      (lastLayerTreeTransactionID 54)
      (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
      (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
      (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
      (customFixedPositionRect (219.64,935) width=980 height=1225)
      (obscuredInset width=0 height=39.50)
      (scale 1.14)
      (inStableState 0)
      (timestamp 736446.61)
      (verticalVelocity -11.36))

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::dump):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (208798 => 208799)


--- trunk/Source/WebKit2/ChangeLog	2016-11-16 19:03:02 UTC (rev 208798)
+++ trunk/Source/WebKit2/ChangeLog	2016-11-16 19:13:04 UTC (rev 208799)
@@ -1,3 +1,33 @@
+2016-11-16  Simon Fraser  <[email protected]>
+
+        Add logging support to VisibleContentRectUpdateInfo
+        https://bugs.webkit.org/show_bug.cgi?id=164825
+
+        Reviewed by Zalan Bujtas.
+
+        Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
+        stream does single-line output, so also make a convenience dump() function that will
+        product multiline output. Result look like:
+
+            (VisibleContentRectUpdateInfo
+              (lastLayerTreeTransactionID 54)
+              (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
+              (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
+              (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
+              (customFixedPositionRect (219.64,935) width=980 height=1225)
+              (obscuredInset width=0 height=39.50)
+              (scale 1.14)
+              (inStableState 0)
+              (timestamp 736446.61)
+              (verticalVelocity -11.36))
+
+        * Shared/VisibleContentRectUpdateInfo.cpp:
+        (WebKit::VisibleContentRectUpdateInfo::dump):
+        (WebKit::operator<<):
+        * Shared/VisibleContentRectUpdateInfo.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+
 2016-11-15  Simon Fraser  <[email protected]>
 
         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads

Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp (208798 => 208799)


--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp	2016-11-16 19:03:02 UTC (rev 208798)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp	2016-11-16 19:13:04 UTC (rev 208799)
@@ -27,7 +27,10 @@
 #include "VisibleContentRectUpdateInfo.h"
 
 #include "WebCoreArgumentCoders.h"
+#include <WebCore/TextStream.h>
 
+using namespace WebCore;
+
 namespace WebKit {
 
 void VisibleContentRectUpdateInfo::encode(IPC::Encoder& encoder) const
@@ -85,4 +88,43 @@
     return true;
 }
 
+String VisibleContentRectUpdateInfo::dump() const
+{
+    TextStream stream;
+    stream << *this;
+    return stream.release();
+}
+
+TextStream& operator<<(TextStream& ts, const VisibleContentRectUpdateInfo& info)
+{
+    TextStream::GroupScope scope(ts);
+    
+    ts << "VisibleContentRectUpdateInfo";
+
+    ts.dumpProperty("lastLayerTreeTransactionID", info.lastLayerTreeTransactionID());
+
+    ts.dumpProperty("exposedContentRect", info.exposedContentRect());
+    ts.dumpProperty("unobscuredContentRect", info.unobscuredContentRect());
+    ts.dumpProperty("unobscuredRectInScrollViewCoordinates", info.unobscuredRectInScrollViewCoordinates());
+    ts.dumpProperty("customFixedPositionRect", info.customFixedPositionRect());
+    ts.dumpProperty("obscuredInset", info.obscuredInset());
+
+    ts.dumpProperty("scale", info.scale());
+    ts.dumpProperty("inStableState", info.inStableState());
+    if (info.isChangingObscuredInsetsInteractively())
+        ts.dumpProperty("isChangingObscuredInsetsInteractively", info.isChangingObscuredInsetsInteractively());
+    if (info.enclosedInScrollableAncestorView())
+        ts.dumpProperty("enclosedInScrollableAncestorView", info.enclosedInScrollableAncestorView());
+
+    ts.dumpProperty("timestamp", info.timestamp());
+    if (info.horizontalVelocity())
+        ts.dumpProperty("horizontalVelocity", info.horizontalVelocity());
+    if (info.verticalVelocity())
+        ts.dumpProperty("verticalVelocity", info.verticalVelocity());
+    if (info.scaleChangeRate())
+        ts.dumpProperty("scaleChangeRate", info.scaleChangeRate());
+
+    return ts;
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h (208798 => 208799)


--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h	2016-11-16 19:03:02 UTC (rev 208798)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h	2016-11-16 19:13:04 UTC (rev 208799)
@@ -27,6 +27,7 @@
 #define VisibleContentRectUpdateInfo_h
 
 #include <WebCore/FloatRect.h>
+#include <wtf/text/WTFString.h>
 
 namespace IPC {
 class Decoder;
@@ -33,6 +34,10 @@
 class Encoder;
 }
 
+namespace WebCore {
+class TextStream;
+}
+
 namespace WebKit {
 
 class VisibleContentRectUpdateInfo {
@@ -83,6 +88,8 @@
     void encode(IPC::Encoder&) const;
     static bool decode(IPC::Decoder&, VisibleContentRectUpdateInfo&);
 
+    String dump() const;
+
 private:
     WebCore::FloatRect m_exposedContentRect;
     WebCore::FloatRect m_unobscuredContentRect;
@@ -117,6 +124,8 @@
         && a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView();
 }
 
+WebCore::TextStream& operator<<(WebCore::TextStream&, const VisibleContentRectUpdateInfo&);
+
 } // namespace WebKit
 
 #endif // VisibleContentRectUpdateInfo_h

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (208798 => 208799)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2016-11-16 19:03:02 UTC (rev 208798)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2016-11-16 19:13:04 UTC (rev 208799)
@@ -380,8 +380,6 @@
     RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
     FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, _page->customFixedPositionRect(), zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect, scrollingCoordinator->visualViewportEnabled());
 
-    LOG_WITH_STREAM(VisibleRects, stream << "didUpdateVisibleRect: visibleRect:" << visibleRect << " unobscuredRect:" << unobscuredRect << " fixedPositionRectForLayout:" << fixedPositionRectForLayout << " stable: " << isStableState);
-
     VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(
         visibleRect,
         unobscuredRect,
@@ -399,6 +397,8 @@
         velocityData.scaleChangeRate,
         downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID());
 
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKContentView didUpdateVisibleRect]" << visibleContentRectUpdateInfo.dump());
+
     _page->updateVisibleContentRects(visibleContentRectUpdateInfo);
 
     FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->customFixedPositionRect(), zoomScale, WebPageProxy::UnobscuredRectConstraint::Unconstrained, scrollingCoordinator->visualViewportEnabled());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to