Diff
Modified: trunk/LayoutTests/ChangeLog (261296 => 261297)
--- trunk/LayoutTests/ChangeLog 2020-05-07 16:29:21 UTC (rev 261296)
+++ trunk/LayoutTests/ChangeLog 2020-05-07 16:38:48 UTC (rev 261297)
@@ -1,3 +1,13 @@
+2020-05-07 Antti Koivisto <[email protected]>
+
+ [Wheel event region] Include listeners on Document
+ https://bugs.webkit.org/show_bug.cgi?id=211571
+
+ Reviewed by Simon Fraser.
+
+ * fast/scrolling/mac/wheel-event-listener-region-document-expected.txt: Added.
+ * fast/scrolling/mac/wheel-event-listener-region-document.html: Added.
+
2020-05-07 Ryan Haddad <[email protected]>
Unreviewed, reverting r261251.
Added: trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document-expected.txt (0 => 261297)
--- trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document-expected.txt 2020-05-07 16:38:48 UTC (rev 261297)
@@ -0,0 +1,23 @@
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (backgroundColor #FFFFFF)
+ (event region
+ (rect (0,0) width=800 height=600)
+ (wheel event listener region
+ (rect (0,0) width=800 height=600)
+ (non-passive
+ (rect (8,8) width=250 height=50)
+ (rect (8,58) width=200 height=150)
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document.html (0 => 261297)
--- trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-document.html 2020-05-07 16:38:48 UTC (rev 261297)
@@ -0,0 +1,41 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<style>
+.event {
+ position:relative;
+ background-color:blue;
+ width:200px;
+ height:200px;
+}
+.child {
+ position:relative;
+ background-color:blue;
+ left:200px;
+ width:50px;
+ height:50px;
+}
+.offset {
+ left: 200px;
+}
+
+</style>
+<script>
+window._onload_ = () => {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (window.internals)
+ results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+}
+document.addEventListener('wheel', () => { results.textContent += 'passive wheel\n' }, { passive: true });
+</script>
+<body>
+<div class="event" _onwheel_="results.textContent += 'wheel\n'">
+ <div class="child"></div>
+</div>
+<div class="event offset" id="passive">
+ <div class="child"></div>
+</div>
+<pre id="results"></pre>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (261296 => 261297)
--- trunk/Source/WebCore/ChangeLog 2020-05-07 16:29:21 UTC (rev 261296)
+++ trunk/Source/WebCore/ChangeLog 2020-05-07 16:38:48 UTC (rev 261297)
@@ -1,3 +1,24 @@
+2020-05-07 Antti Koivisto <[email protected]>
+
+ [Wheel event region] Include listeners on Document
+ https://bugs.webkit.org/show_bug.cgi?id=211571
+
+ Reviewed by Simon Fraser.
+
+ Test: fast/scrolling/mac/wheel-event-listener-region-document.html
+
+ * style/StyleAdjuster.cpp:
+ (WebCore::Style::Adjuster::computeEventListenerRegionTypes):
+ (WebCore::Style::computeEventListenerRegionTypes): Deleted.
+
+ Make public and take Node instead of Element.
+
+ * style/StyleAdjuster.h:
+ * style/StyleResolveForDocument.cpp:
+ (WebCore::Style::resolveForDocument):
+
+ Gather event region bits from Document too.
+
2020-05-07 Commit Queue <[email protected]>
Unreviewed, reverting r260769.
Modified: trunk/Source/WebCore/style/StyleAdjuster.cpp (261296 => 261297)
--- trunk/Source/WebCore/style/StyleAdjuster.cpp 2020-05-07 16:29:21 UTC (rev 261296)
+++ trunk/Source/WebCore/style/StyleAdjuster.cpp 2020-05-07 16:38:48 UTC (rev 261297)
@@ -193,16 +193,16 @@
return sharedTouchActions;
}
-static OptionSet<EventListenerRegionType> computeEventListenerRegionTypes(const Element& element, OptionSet<EventListenerRegionType> parentTypes)
+OptionSet<EventListenerRegionType> Adjuster::computeEventListenerRegionTypes(const Node& node, OptionSet<EventListenerRegionType> parentTypes)
{
#if !PLATFORM(IOS_FAMILY)
- if (!element.hasEventListeners())
+ if (!node.hasEventListeners())
return parentTypes;
auto types = parentTypes;
auto findListeners = [&](auto& eventName, auto type, auto nonPassiveType) {
- auto* eventListenerVector = element.eventTargetData()->eventListenerMap.find(eventName);
+ auto* eventListenerVector = node.eventTargetData()->eventListenerMap.find(eventName);
if (!eventListenerVector)
return;
@@ -225,7 +225,7 @@
return types;
#else
- UNUSED_PARAM(element);
+ UNUSED_PARAM(node);
UNUSED_PARAM(parentTypes);
return { };
#endif
Modified: trunk/Source/WebCore/style/StyleAdjuster.h (261296 => 261297)
--- trunk/Source/WebCore/style/StyleAdjuster.h 2020-05-07 16:29:21 UTC (rev 261296)
+++ trunk/Source/WebCore/style/StyleAdjuster.h 2020-05-07 16:38:48 UTC (rev 261297)
@@ -47,6 +47,8 @@
static void adjustSVGElementStyle(RenderStyle&, const SVGElement&);
static void adjustAnimatedStyle(RenderStyle&, const RenderStyle* parentBoxStyle, OptionSet<AnimationImpact>);
+
+ static OptionSet<EventListenerRegionType> computeEventListenerRegionTypes(const Node&, OptionSet<EventListenerRegionType>);
#if ENABLE(TEXT_AUTOSIZING)
struct AdjustmentForTextAutosizing {
Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (261296 => 261297)
--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2020-05-07 16:29:21 UTC (rev 261296)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2020-05-07 16:38:48 UTC (rev 261297)
@@ -42,6 +42,7 @@
#include "RenderStyle.h"
#include "RenderView.h"
#include "Settings.h"
+#include "StyleAdjuster.h"
#include "StyleFontSizeFunctions.h"
#include "StyleResolver.h"
@@ -72,6 +73,8 @@
documentStyle.setTextSizeAdjust(TextSizeAdjustment(NoTextSizeAdjustment));
#endif
+ documentStyle.setEventListenerRegionTypes(Adjuster::computeEventListenerRegionTypes(document, { }));
+
Element* docElement = document.documentElement();
RenderObject* docElementRenderer = docElement ? docElement->renderer() : nullptr;
if (docElementRenderer) {