- Revision
- 262437
- Author
- [email protected]
- Date
- 2020-06-02 13:17:13 -0700 (Tue, 02 Jun 2020)
Log Message
Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing
https://bugs.webkit.org/show_bug.cgi?id=212620
Reviewed by Tim Horton.
Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS).
Eventually we'll use this same code for touch event regions, and when we do, we
can rejigger the #ifdefs.
Source/WebCore:
* rendering/EventRegion.cpp:
(WebCore::EventRegion::operator== const):
(WebCore::EventRegion::unite):
(WebCore::EventRegion::containsEditableElementsInRect const):
(WebCore::EventRegion::dump const):
* rendering/EventRegion.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintDebugOverlays):
Source/WTF:
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (262436 => 262437)
--- trunk/Source/WTF/ChangeLog 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WTF/ChangeLog 2020-06-02 20:17:13 UTC (rev 262437)
@@ -1,3 +1,18 @@
+2020-06-01 Simon Fraser <[email protected]>
+
+ Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing
+ https://bugs.webkit.org/show_bug.cgi?id=212620
+
+ Reviewed by Tim Horton.
+
+ Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS).
+
+ Eventually we'll use this same code for touch event regions, and when we do, we
+ can rejigger the #ifdefs.
+
+ * wtf/PlatformEnable.h:
+ * wtf/PlatformEnableCocoa.h:
+
2020-06-02 Mark Lam <[email protected]>
Change Gigacage::Config to use storage in WebConfig::g_config instead of its own.
Modified: trunk/Source/WTF/wtf/PlatformEnable.h (262436 => 262437)
--- trunk/Source/WTF/wtf/PlatformEnable.h 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WTF/wtf/PlatformEnable.h 2020-06-02 20:17:13 UTC (rev 262437)
@@ -490,6 +490,10 @@
#define ENABLE_TOUCH_ACTION_REGIONS 0
#endif
+#if !defined(ENABLE_WHEEL_EVENT_REGIONS)
+#define ENABLE_WHEEL_EVENT_REGIONS 0
+#endif
+
#if !defined(ENABLE_VIDEO)
#define ENABLE_VIDEO 0
#endif
Modified: trunk/Source/WTF/wtf/PlatformEnableCocoa.h (262436 => 262437)
--- trunk/Source/WTF/wtf/PlatformEnableCocoa.h 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WTF/wtf/PlatformEnableCocoa.h 2020-06-02 20:17:13 UTC (rev 262437)
@@ -433,6 +433,10 @@
#define ENABLE_TOUCH_ACTION_REGIONS 1
#endif
+#if !defined(ENABLE_WHEEL_EVENT_REGIONS) && PLATFORM(MAC)
+#define ENABLE_WHEEL_EVENT_REGIONS 1
+#endif
+
#if !defined(ENABLE_UI_SIDE_COMPOSITING)
#define ENABLE_UI_SIDE_COMPOSITING 1
#endif
Modified: trunk/Source/WebCore/ChangeLog (262436 => 262437)
--- trunk/Source/WebCore/ChangeLog 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WebCore/ChangeLog 2020-06-02 20:17:13 UTC (rev 262437)
@@ -1,3 +1,24 @@
+2020-06-01 Simon Fraser <[email protected]>
+
+ Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing
+ https://bugs.webkit.org/show_bug.cgi?id=212620
+
+ Reviewed by Tim Horton.
+
+ Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS).
+
+ Eventually we'll use this same code for touch event regions, and when we do, we
+ can rejigger the #ifdefs.
+
+ * rendering/EventRegion.cpp:
+ (WebCore::EventRegion::operator== const):
+ (WebCore::EventRegion::unite):
+ (WebCore::EventRegion::containsEditableElementsInRect const):
+ (WebCore::EventRegion::dump const):
+ * rendering/EventRegion.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::paintDebugOverlays):
+
2020-06-02 Andres Gonzalez <[email protected]>
Avoid calling axBackingObject multiple times in [WebAccessibilityObjectWrapper roleDescription].
Modified: trunk/Source/WebCore/rendering/EventRegion.cpp (262436 => 262437)
--- trunk/Source/WebCore/rendering/EventRegion.cpp 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WebCore/rendering/EventRegion.cpp 2020-06-02 20:17:13 UTC (rev 262437)
@@ -102,10 +102,14 @@
if (m_touchActionRegions != other.m_touchActionRegions)
return false;
#endif
+
+#if ENABLE(WHEEL_EVENT_REGIONS)
if (m_wheelEventListenerRegion != other.m_wheelEventListenerRegion)
return false;
if (m_nonPassiveWheelEventListenerRegion != other.m_nonPassiveWheelEventListenerRegion)
return false;
+#endif
+
#if ENABLE(EDITABLE_REGION)
if (m_editableRegion != other.m_editableRegion)
return false;
@@ -120,7 +124,10 @@
#if ENABLE(TOUCH_ACTION_REGIONS)
uniteTouchActions(region, style.effectiveTouchActions());
#endif
+
+#if ENABLE(WHEEL_EVENT_REGIONS)
uniteEventListeners(region, style.eventListenerRegionTypes());
+#endif
#if ENABLE(EDITABLE_REGION)
if (overrideUserModifyIsEditable || style.userModify() != UserModify::ReadOnly)
@@ -235,6 +242,7 @@
}
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
void EventRegion::uniteEventListeners(const Region& region, OptionSet<EventListenerRegionType> eventListenerRegionTypes)
{
if (eventListenerRegionTypes.contains(EventListenerRegionType::Wheel))
@@ -265,14 +273,13 @@
ASSERT_NOT_REACHED();
return m_wheelEventListenerRegion;
}
+#endif // ENABLE(WHEEL_EVENT_REGIONS)
#if ENABLE(EDITABLE_REGION)
-
bool EventRegion::containsEditableElementsInRect(const IntRect& rect) const
{
return m_editableRegion.intersects(rect);
}
-
#endif
void EventRegion::dump(TextStream& ts) const
@@ -295,6 +302,7 @@
}
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
if (!m_wheelEventListenerRegion.isEmpty()) {
ts << indent << "(wheel event listener region" << m_wheelEventListenerRegion;
if (!m_nonPassiveWheelEventListenerRegion.isEmpty()) {
@@ -304,6 +312,7 @@
}
ts << indent << ")\n";
}
+#endif
#if ENABLE(EDITABLE_REGION)
if (!m_editableRegion.isEmpty()) {
Modified: trunk/Source/WebCore/rendering/EventRegion.h (262436 => 262437)
--- trunk/Source/WebCore/rendering/EventRegion.h 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WebCore/rendering/EventRegion.h 2020-06-02 20:17:13 UTC (rev 262437)
@@ -81,8 +81,10 @@
const Region* regionForTouchAction(TouchAction) const;
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
OptionSet<EventListenerRegionType> eventListenerRegionTypesForPoint(const IntPoint&) const;
const Region& eventListenerRegionForType(EventListenerRegionType) const;
+#endif
#if ENABLE(EDITABLE_REGION)
WEBCORE_EXPORT bool containsEditableElementsInRect(const IntRect&) const;
@@ -106,8 +108,10 @@
#if ENABLE(TOUCH_ACTION_REGIONS)
Vector<Region> m_touchActionRegions;
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
Region m_wheelEventListenerRegion;
Region m_nonPassiveWheelEventListenerRegion;
+#endif
#if ENABLE(EDITABLE_REGION)
Region m_editableRegion;
#endif
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (262436 => 262437)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2020-06-02 20:05:44 UTC (rev 262436)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2020-06-02 20:17:13 UTC (rev 262437)
@@ -3168,6 +3168,7 @@
}
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
static RefPtr<Pattern> patternForEventListenerRegionType(EventListenerRegionType type, FloatSize contentOffset, GraphicsContext& destContext)
{
constexpr auto fillColor = makeSimpleColor(0, 128, 0, 128);
@@ -3185,6 +3186,7 @@
return patternForDescription(patternAndPhase, contentOffset, destContext);
}
+#endif
void RenderLayerBacking::paintDebugOverlays(const GraphicsLayer* graphicsLayer, GraphicsContext& context)
{
@@ -3233,6 +3235,7 @@
}
#endif
+#if ENABLE(WHEEL_EVENT_REGIONS)
if (visibleDebugOverlayRegions & WheelEventHandlerRegion) {
for (auto type : { EventListenerRegionType::Wheel, EventListenerRegionType::NonPassiveWheel }) {
auto fillPattern = patternForEventListenerRegionType(type, contentOffsetInCompositingLayer(), context);
@@ -3243,6 +3246,7 @@
context.fillRect(rect);
}
}
+#endif
#if ENABLE(EDITABLE_REGION)
// Paint rects for editable elements.