Diff
Modified: trunk/LayoutTests/ChangeLog (246277 => 246278)
--- trunk/LayoutTests/ChangeLog 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/LayoutTests/ChangeLog 2019-06-10 20:43:17 UTC (rev 246278)
@@ -1,3 +1,15 @@
+2019-06-10 Antti Koivisto <[email protected]>
+
+ Event region should be set on scrolledContentsLayer if it exists
+ https://bugs.webkit.org/show_bug.cgi?id=198717
+ <rdar://problem/51572169>
+
+ Reviewed by Simon Fraser.
+
+ * pointerevents/ios/touch-action-region-backing-sharing-expected.txt:
+ * pointerevents/ios/touch-action-region-overflow-expected.txt: Added.
+ * pointerevents/ios/touch-action-region-overflow.html: Added.
+
2019-06-10 Daniel Bates <[email protected]>
[CSP] Blob URLs should inherit their CSP policy
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt (246277 => 246278)
--- trunk/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt 2019-06-10 20:43:17 UTC (rev 246278)
@@ -1,7 +1,6 @@
(GraphicsLayer
(anchor 0.00 0.00)
(bounds 800.00 600.00)
- (deep color 1)
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
@@ -9,15 +8,10 @@
(event region
(rect (0,0) width=800 height=600)
)
- (deep color 1)
(children 2
(GraphicsLayer
(position 8.00 13.00)
(bounds 200.00 200.00)
- (event region
- (rect (0,0) width=500 height=500)
- )
- (deep color 1)
(children 1
(GraphicsLayer
(bounds 200.00 200.00)
@@ -26,7 +20,9 @@
(anchor 0.00 0.00)
(bounds 500.00 500.00)
(drawsContent 1)
- (deep color 1)
+ (event region
+ (rect (0,0) width=500 height=500)
+ )
)
)
)
@@ -48,7 +44,6 @@
)
)
)
- (deep color 1)
)
)
)
Added: trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow-expected.txt (0 => 246278)
--- trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow-expected.txt (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow-expected.txt 2019-06-10 20:43:17 UTC (rev 246278)
@@ -0,0 +1,96 @@
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 671.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 671.00)
+ (contentsOpaque 1)
+ (event region
+ (rect (0,0) width=800 height=671)
+ )
+ (children 3
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 200.00 200.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 200.00 200.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 500.00 500.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=500 height=500)
+ (touch-action
+ (none
+ (rect (150,150) width=100 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 208.00)
+ (bounds 200.00 200.00)
+ (children 1
+ (GraphicsLayer
+ (bounds origin 150.00 150.00)
+ (bounds 200.00 200.00)
+ (children 1
+ (GraphicsLayer
+ (scrollOffset (150,150))
+ (anchor 0.00 0.00)
+ (bounds 500.00 500.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=500 height=500)
+ (touch-action
+ (none
+ (rect (150,150) width=100 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 408.00)
+ (bounds 250.00 250.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=25 height=25)
+ (position 25.00 25.00)
+ (bounds origin 150.00 150.00)
+ (bounds 200.00 200.00)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=25 height=25)
+ (scrollOffset (150,150))
+ (anchor 0.00 0.00)
+ (bounds 500.00 500.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=500 height=500)
+ (touch-action
+ (none
+ (rect (150,150) width=100 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow.html (0 => 246278)
--- trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow.html (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-region-overflow.html 2019-06-10 20:43:17 UTC (rev 246278)
@@ -0,0 +1,23 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<style>
+.scroll { position:relative; width:200px; height:200px; overflow:scroll }
+.scrollcontent { position:absolute; width:500px; height:500px; background:green; }
+.none { position:relative; top:150px; left:150px; width:100px; height:100px; background:blue; touch-action: none; }
+</style>
+<body>
+<div class="scroll"><div class="scrollcontent"><div class="none"></div></div></div>
+<div class="scroll target"><div class="scrollcontent"><div class="none"></div></div></div>
+<div class="scroll target" style="border:25px solid yellow"><div class="scrollcontent"><div class="none"></div></div></div>
+<pre id="results"></pre>
+<script>
+for (target of document.querySelectorAll(".target"))
+ target.scrollBy(150,150);
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+if (window.internals)
+ results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (246277 => 246278)
--- trunk/Source/WebCore/ChangeLog 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/Source/WebCore/ChangeLog 2019-06-10 20:43:17 UTC (rev 246278)
@@ -1,3 +1,30 @@
+2019-06-10 Antti Koivisto <[email protected]>
+
+ Event region should be set on scrolledContentsLayer if it exists
+ https://bugs.webkit.org/show_bug.cgi?id=198717
+ <rdar://problem/51572169>
+
+ Reviewed by Simon Fraser.
+
+ Test: pointerevents/ios/touch-action-region-overflow.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateConfiguration):
+
+ Move to updateBackingAndHierarchy.
+
+ (WebCore::RenderLayerBacking::updateEventRegion):
+
+ - Set event region on scrolledContentsLayer if it exists
+ - Translate away the scroll offset
+ - Get the offset from renderer from the GraphicsLayer so scrolling and non-scrolling case can be handled uniformly.
+
+ * rendering/RenderLayerBacking.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
+
+ Invoke updateEventRegion after geometry update so offsets are already available on GraphicsLayer.
+
2019-06-10 Daniel Bates <[email protected]>
[CSP] Blob URLs should inherit their CSP policy
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (246277 => 246278)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-06-10 20:43:17 UTC (rev 246278)
@@ -841,8 +841,6 @@
} else
updateRootLayerConfiguration();
- updateEventRegion();
-
// Requires layout.
if (contentsInfo.isDirectlyCompositedImage())
updateImageContents(contentsInfo);
@@ -1526,10 +1524,12 @@
for (auto& layer : m_backingSharingLayers)
layer->paintLayerWithEffects(nullContext, paintingInfo, paintFlags);
- auto contentOffset = roundedIntSize(contentOffsetInCompositingLayer());
- eventRegion.translate(contentOffset);
- m_graphicsLayer->setEventRegion(WTFMove(eventRegion));
+ GraphicsLayer& layerForEventRegion = m_scrolledContentsLayer ? *m_scrolledContentsLayer : *m_graphicsLayer;
+ auto layerOffset = toIntSize(layerForEventRegion.scrollOffset()) - roundedIntSize(layerForEventRegion.offsetFromRenderer());
+ eventRegion.translate(layerOffset);
+
+ layerForEventRegion.setEventRegion(WTFMove(eventRegion));
#endif
}
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (246277 => 246278)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2019-06-10 20:43:17 UTC (rev 246278)
@@ -216,6 +216,8 @@
bool setCompositedBounds(const LayoutRect&);
// Returns true if changed.
bool updateCompositedBounds();
+
+ void updateEventRegion();
void updateAfterWidgetResize();
void positionOverflowControlsLayers();
@@ -358,7 +360,6 @@
bool paintsContent(RenderLayer::PaintedContentRequest&) const;
void updateDrawsContent(PaintedContentsInfo&);
- void updateEventRegion();
// Returns true if this compositing layer has no visible content.
bool isSimpleContainerCompositingLayer(PaintedContentsInfo&) const;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (246277 => 246278)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-06-10 20:30:50 UTC (rev 246277)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-06-10 20:43:17 UTC (rev 246278)
@@ -1210,6 +1210,11 @@
} else if (layer.needsScrollingTreeUpdate())
scrollingNodeChanges.add(ScrollingNodeChangeFlags::LayerGeometry);
+ // This needs to happen after any geometry update.
+ // FIXME: Use separate bit for event region invalidation.
+ if (layerNeedsUpdate || layer.needsCompositingConfigurationUpdate())
+ layerBacking->updateEventRegion();
+
if (auto* reflection = layer.reflectionLayer()) {
if (auto* reflectionBacking = reflection->backing()) {
reflectionBacking->updateCompositedBounds();