Title: [204886] trunk/Source
Revision
204886
Author
[email protected]
Date
2016-08-23 23:15:01 -0700 (Tue, 23 Aug 2016)

Log Message

Add some logging for WKSelectionDrawingInfo
https://bugs.webkit.org/show_bug.cgi?id=161055

Reviewed by Tim Horton.

Source/WebCore:

Add TextStream dumping for SelectionRect.

* platform/ios/SelectionRect.cpp:
(WebCore::operator<<):
* platform/ios/SelectionRect.h:

Source/WebKit2:

Add a Selection logging channel for WK2, and dump WKSelectionDrawingInfo when it changes.

* Platform/Logging.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(WebKit::operator<<):
(-[WKContentView _updateChangedSelection:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (204885 => 204886)


--- trunk/Source/WebCore/ChangeLog	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebCore/ChangeLog	2016-08-24 06:15:01 UTC (rev 204886)
@@ -1,3 +1,16 @@
+2016-08-23  Simon Fraser  <[email protected]>
+
+        Add some logging for WKSelectionDrawingInfo
+        https://bugs.webkit.org/show_bug.cgi?id=161055
+
+        Reviewed by Tim Horton.
+
+        Add TextStream dumping for SelectionRect.
+
+        * platform/ios/SelectionRect.cpp:
+        (WebCore::operator<<):
+        * platform/ios/SelectionRect.h:
+
 2016-08-23  Frederic Wang  <[email protected]>
 
         More consistent header inclusions in the MathML module

Modified: trunk/Source/WebCore/platform/ios/SelectionRect.cpp (204885 => 204886)


--- trunk/Source/WebCore/platform/ios/SelectionRect.cpp	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebCore/platform/ios/SelectionRect.cpp	2016-08-24 06:15:01 UTC (rev 204886)
@@ -25,6 +25,7 @@
 
 #include "config.h"
 #include "SelectionRect.h"
+#include "TextStream.h"
 
 namespace WebCore {
 
@@ -87,4 +88,43 @@
 {
 }
 
+TextStream& operator<<(TextStream& stream, SelectionRect rect)
+{
+    TextStream::GroupScope group(stream);
+    stream << "selection rect";
+
+    stream.dumpProperty("rect", rect.rect());
+    stream.dumpProperty("direction", isLeftToRightDirection(rect.direction()) ? "ltr" : "rtl");
+
+    stream.dumpProperty("min-x", rect.minX());
+    stream.dumpProperty("max-x", rect.maxX());
+    stream.dumpProperty("max-y", rect.maxY());
+
+    stream.dumpProperty("line number", rect.lineNumber());
+    if (rect.isLineBreak())
+        stream.dumpProperty("is line break", true);
+    if (rect.isFirstOnLine())
+        stream.dumpProperty("is first on line", true);
+    if (rect.isLastOnLine())
+        stream.dumpProperty("is last on line", true);
+
+    if (rect.containsStart())
+        stream.dumpProperty("contains start", true);
+
+    if (rect.containsEnd())
+        stream.dumpProperty("contains end", true);
+
+    if (rect.isHorizontal())
+        stream.dumpProperty("is horizontal", true);
+    
+    if (rect.isInFixedPosition())
+        stream.dumpProperty("is in fixed position", true);
+
+    if (rect.isRubyText())
+        stream.dumpProperty("is ruby text", true);
+
+    stream.dumpProperty("page number", rect.pageNumber());
+    return stream;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/ios/SelectionRect.h (204885 => 204886)


--- trunk/Source/WebCore/platform/ios/SelectionRect.h	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebCore/platform/ios/SelectionRect.h	2016-08-24 06:15:01 UTC (rev 204886)
@@ -128,6 +128,8 @@
     int m_pageNumber;
 };
 
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, SelectionRect);
+
 } // namespace WebCore
 
 #endif // SelectionRect_h

Modified: trunk/Source/WebKit2/ChangeLog (204885 => 204886)


--- trunk/Source/WebKit2/ChangeLog	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebKit2/ChangeLog	2016-08-24 06:15:01 UTC (rev 204886)
@@ -1,3 +1,18 @@
+2016-08-23  Simon Fraser  <[email protected]>
+
+        Add some logging for WKSelectionDrawingInfo
+        https://bugs.webkit.org/show_bug.cgi?id=161055
+
+        Reviewed by Tim Horton.
+
+        Add a Selection logging channel for WK2, and dump WKSelectionDrawingInfo when it changes.
+
+        * Platform/Logging.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (WebKit::operator<<):
+        (-[WKContentView _updateChangedSelection:]):
+
 2016-08-23  Ryosuke Niwa  <[email protected]>
 
         Another CMake build fix attempt after r204852.

Modified: trunk/Source/WebKit2/Platform/Logging.h (204885 => 204886)


--- trunk/Source/WebKit2/Platform/Logging.h	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebKit2/Platform/Logging.h	2016-08-24 06:15:01 UTC (rev 204886)
@@ -59,6 +59,7 @@
     M(Printing) \
     M(RemoteLayerTree) \
     M(Resize) \
+    M(Selection) \
     M(SessionState) \
     M(StorageAPI) \
     M(TextInput) \

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (204885 => 204886)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2016-08-24 06:15:01 UTC (rev 204886)
@@ -52,6 +52,7 @@
 class Color;
 class FloatQuad;
 class IntSize;
+class TextStream;
 }
 
 namespace WebKit {
@@ -76,6 +77,7 @@
 typedef void (^UIWKKeyWebEventCompletionHandler)(WebIOSEvent *theEvent, BOOL wasHandled);
 
 namespace WebKit {
+
 struct WKSelectionDrawingInfo {
     enum class SelectionType { None, Plugin, Range };
     WKSelectionDrawingInfo();
@@ -84,6 +86,9 @@
     WebCore::IntRect caretRect;
     Vector<WebCore::SelectionRect> selectionRects;
 };
+
+WebCore::TextStream& operator<<(WebCore::TextStream&, const WKSelectionDrawingInfo&);
+
 struct WKAutoCorrectionData {
     String fontName;
     CGFloat fontSize;

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (204885 => 204886)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-08-24 05:56:08 UTC (rev 204885)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-08-24 06:15:01 UTC (rev 204886)
@@ -30,6 +30,7 @@
 
 #import "APIUIClient.h"
 #import "EditingRange.h"
+#import "Logging.h"
 #import "ManagedConfigurationSPI.h"
 #import "NativeWebKeyboardEvent.h"
 #import "NativeWebTouchEvent.h"
@@ -73,6 +74,7 @@
 #import <WebCore/Scrollbar.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextIndicator.h>
+#import <WebCore/TextStream.h>
 #import <WebCore/WebCoreNSURLExtras.h>
 #import <WebCore/WebEvent.h>
 #import <WebKit/WebSelectionRect.h> // FIXME: WK2 should not include WebKit headers!
@@ -150,6 +152,26 @@
     return !(a == b);
 }
 
+static WebCore::TextStream& operator<<(WebCore::TextStream& stream, WKSelectionDrawingInfo::SelectionType type)
+{
+    switch (type) {
+    case WKSelectionDrawingInfo::SelectionType::None: stream << "none"; break;
+    case WKSelectionDrawingInfo::SelectionType::Plugin: stream << "plugin"; break;
+    case WKSelectionDrawingInfo::SelectionType::Range: stream << "range"; break;
+    }
+    
+    return stream;
+}
+
+WebCore::TextStream& operator<<(WebCore::TextStream& stream, const WKSelectionDrawingInfo& info)
+{
+    TextStream::GroupScope group(stream);
+    stream.dumpProperty("type", info.type);
+    stream.dumpProperty("caret rect", info.caretRect);
+    stream.dumpProperty("selection rects", info.selectionRects);
+    return stream;
+}
+
 } // namespace WebKit
 
 static const float highlightDelay = 0.12;
@@ -3678,6 +3700,8 @@
     if (!force && selectionDrawingInfo == _lastSelectionDrawingInfo)
         return;
 
+    LOG_WITH_STREAM(Selection, stream << "_updateChangedSelection " << selectionDrawingInfo);
+
     _lastSelectionDrawingInfo = selectionDrawingInfo;
 
     // FIXME: We need to figure out what to do if the selection is changed by _javascript_.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to