Title: [242293] trunk/Source/WebCore
Revision
242293
Author
simon.fra...@apple.com
Date
2019-03-01 16:23:53 -0800 (Fri, 01 Mar 2019)

Log Message

Show mouse event regions in the overlay
https://bugs.webkit.org/show_bug.cgi?id=195227

Reviewed by Tim Horton.

Enhance event region overlays to show more kinds of events.

* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors):
(WebCore::NonFastScrollableRegionOverlay::drawRect):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (242292 => 242293)


--- trunk/Source/WebCore/ChangeLog	2019-03-01 23:30:16 UTC (rev 242292)
+++ trunk/Source/WebCore/ChangeLog	2019-03-02 00:23:53 UTC (rev 242293)
@@ -1,3 +1,16 @@
+2019-03-01  Simon Fraser  <simon.fra...@apple.com>
+
+        Show mouse event regions in the overlay
+        https://bugs.webkit.org/show_bug.cgi?id=195227
+
+        Reviewed by Tim Horton.
+
+        Enhance event region overlays to show more kinds of events.
+
+        * page/DebugPageOverlays.cpp:
+        (WebCore::touchEventRegionColors):
+        (WebCore::NonFastScrollableRegionOverlay::drawRect):
+
 2019-03-01  Zalan Bujtas  <za...@apple.com>
 
         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.

Modified: trunk/Source/WebCore/page/DebugPageOverlays.cpp (242292 => 242293)


--- trunk/Source/WebCore/page/DebugPageOverlays.cpp	2019-03-01 23:30:16 UTC (rev 242292)
+++ trunk/Source/WebCore/page/DebugPageOverlays.cpp	2019-03-02 00:23:53 UTC (rev 242293)
@@ -152,10 +152,13 @@
         };
         static const MapEntry entries[] = {
             { "touchstart"_s, 191, 191, 63 },
-            { "touchmove"_s, 63, 191, 191 },
+            { "touchmove"_s, 80, 204, 245 },
             { "touchend"_s, 191, 63, 127 },
             { "touchforcechange"_s, 63, 63, 191 },
             { "wheel"_s, 255, 128, 0 },
+            { "mousedown"_s, 80, 245, 80 },
+            { "mousemove"_s, 245, 245, 80 },
+            { "mouseup"_s, 80, 245, 176 },
         };
         HashMap<String, Color> map;
         for (auto& entry : entries)
@@ -217,6 +220,21 @@
     context.setFillColor(m_color);
     context.fillRect(legendRect);
     drawRightAlignedText("passive listeners", context, font, legendRect.location());
+
+    legendRect.move(0, 30);
+    context.setFillColor(touchEventRegionColors().get("mousedown"));
+    context.fillRect(legendRect);
+    drawRightAlignedText("mousedown", context, font, legendRect.location());
+
+    legendRect.move(0, 30);
+    context.setFillColor(touchEventRegionColors().get("mousemove"));
+    context.fillRect(legendRect);
+    drawRightAlignedText("mousemove", context, font, legendRect.location());
+
+    legendRect.move(0, 30);
+    context.setFillColor(touchEventRegionColors().get("mouseup"));
+    context.fillRect(legendRect);
+    drawRightAlignedText("mouseup", context, font, legendRect.location());
 #else
     // On desktop platforms, the "wheel" region includes the non-fast scrollable region.
     context.setFillColor(touchEventRegionColors().get("wheel"));
@@ -225,7 +243,10 @@
 #endif
 
     for (const auto& synchronousEventRegion : m_eventTrackingRegions.eventSpecificSynchronousDispatchRegions) {
-        Color regionColor = touchEventRegionColors().get(synchronousEventRegion.key);
+        Color regionColor(0, 0, 0, 64);
+        auto it = touchEventRegionColors().find(synchronousEventRegion.key);
+        if (it != touchEventRegionColors().end())
+            regionColor = it->value;
         drawRegion(context, synchronousEventRegion.value, regionColor, bounds);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to