<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243092] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243092">243092</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2019-03-18 12:42:57 -0700 (Mon, 18 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
       fast/scrolling/ios/overflow-scroll-overlap-4.html

Move collecting event region from paint to compositing update time.
This solves a number of problems including regions for non-painting layers.

* platform/graphics/GraphicsLayer.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):

Use the existing visibleToHitTesting() helper.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):

Use flag for event region collecting, don't paint content.

(WebCore::RenderLayer::paintList):

We can bail out immediately if there is no overflow.

(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::collectEventRegionForFragments):

Move to a separate function.

* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):

Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.

(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::collectDescendantViewsAtPoint):

No need for special WKTiledBackingView, tiled views now have correct event regions.

LayoutTests:

Reorganize the tests a bit and add some new ones.

* fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt:
* fast/scrolling/ios/overflow-scroll-overlap-2.html:
* fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt: Added.
* fast/scrolling/ios/overflow-scroll-overlap-3.html: Added.
* fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt: Added.
* fast/scrolling/ios/overflow-scroll-overlap-4.html: Added.
* fast/scrolling/ios/overflow-scroll-overlap.html:
* fast/scrolling/resources/overflow-scroll-overlap.js: Added.
(sleep):
(async.runTest):
(logScroll):
(outputCase):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap2expectedtxt">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap2html">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlaphtml">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeHostIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap3expectedtxt">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap3html">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap4expectedtxt">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosoverflowscrolloverlap4html">trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingresourcesoverflowscrolloverlapjs">trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/LayoutTests/ChangeLog 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2019-03-18  Antti Koivisto  <antti@apple.com>
+
+        Layer with no backing store should still hit-test over a scroller
+        https://bugs.webkit.org/show_bug.cgi?id=195378
+        <rdar://problem/48652078>
+
+        Reviewed by Simon Fraser.
+
+        Reorganize the tests a bit and add some new ones.
+
+        * fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt:
+        * fast/scrolling/ios/overflow-scroll-overlap-2.html:
+        * fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt: Added.
+        * fast/scrolling/ios/overflow-scroll-overlap-3.html: Added.
+        * fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt: Added.
+        * fast/scrolling/ios/overflow-scroll-overlap-4.html: Added.
+        * fast/scrolling/ios/overflow-scroll-overlap.html:
+        * fast/scrolling/resources/overflow-scroll-overlap.js: Added.
+        (sleep):
+        (async.runTest):
+        (logScroll):
+        (outputCase):
+
</ins><span class="cx"> 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WHLSL] Hook up the compiler to our WebGPU implementation
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt      2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -1,9 +1,8 @@
</span><span class="cx"> Test that scrollable areas with non-trivial overlap are correctly targeted.
</span><span class="cx"> 
</span><del>-case 1: 
-case 2: Scrollable 2 
</del><ins>+case 1: Scrollable 1 
+case 2: 
</ins><span class="cx"> case 3: Scrollable 3 
</span><span class="cx"> case 4: Scrollable 4 
</span><del>-case 5: Scrollable 5 
-case 6: 
</del><ins>+case 5: 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html      2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -33,6 +33,14 @@
</span><span class="cx">     height: 100px;
</span><span class="cx">     background: red;
</span><span class="cx"> }
</span><ins>+.overlapping-empty {
+    position:absolute;
+    left: 25px;
+    top: 25px;
+    width: 100px;
+    height: 100px;
+    background: blue;
+}
</ins><span class="cx"> .clip {
</span><span class="cx">     position:absolute;
</span><span class="cx">     width: 100px;
</span><span class="lines">@@ -49,85 +57,7 @@
</span><span class="cx"> }
</span><span class="cx"> </style>
</span><span class="cx"> <script src="../../../resources/basic-gestures.js"></script>
</span><del>-<script type="text/javascript">
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-    internals.settings.setAsyncFrameScrollingEnabled(true);
-    internals.settings.setAsyncOverflowScrollingEnabled(true);
-}
-
-function sleep(delay)
-{
-    return new Promise((resolve) => { setTimeout(resolve, delay); });
-}
-
-async function runTest() {
-    for (const scrollable of document.querySelectorAll('.overflowscroll')) {
-        scrollable.addEventListener('scroll', function(e) {
-            logScroll(e.target);
-        });
-    }
-
-    {
-        let i = 0;
-        for (const scrollcontent of document.querySelectorAll('.scrollcontent'))
-            scrollcontent.innerText = "Scrollable " + ++i;
-    }
-    {
-        let i = 0;
-        for (const overlapping of document.querySelectorAll('.overlapping'))
-            overlapping.insertBefore(document.createTextNode("Overlapping " + ++i), overlapping.firstChild);
-    }
-
-
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    for (const testcase of document.querySelectorAll('.case'))
-        testcase.style.display = 'none';
-
-    {
-        let i = 0;
-        for (const testcase of document.querySelectorAll('.case')) {
-            ++i;
-            testcase.style.display = 'inline-block';
-            
-            const target = testcase.querySelector('.target');
-            const rect = target.getBoundingClientRect();
-            const centerX = (rect.left + rect.right) / 2;
-            const centerY = (rect.top + rect.bottom) / 2;
-            await touchAndDragFromPointToPoint(centerX, centerY, centerX, centerY - 30);
-            await liftUpAtPoint(centerX, centerY - 30);
-            await sleep(500);
-
-            testcase.style.display = 'none';
-            outputCase(i);
-        }
-   }
-
-    for (const testcase of document.querySelectorAll('.case'))
-        testcase.style.display = 'none';
-
-    testRunner.notifyDone();
-}
-
-const scrolledElements = new Set();
-
-function logScroll(element) {
-    if (scrolledElements.has(element))
-        return;
-    scrolledElements.add(element);
-}
-
-function outputCase(i) {
-    log.innerText += "case " + i + ": ";
-    for (const scrolled of scrolledElements)
-        log.innerText += scrolled.getElementsByClassName("scrollcontent")[0].innerText + " ";
-    log.innerText += "\n";
-    scrolledElements.clear();
-}
-</script>
</del><ins>+<script src="../resources/overflow-scroll-overlap.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body onload="runTest()">
</span><span class="cx"> <p>
</span><span class="lines">@@ -137,8 +67,7 @@
</span><span class="cx">     <div class="overflowscroll target">
</span><span class="cx">         <div class="scrollcontent"></div>
</span><span class="cx">     </div>
</span><del>-    <div class="overlapping" style="left: 80px">
-        <div class="overlapping" style="left: -40px; top: -30px"></div>
</del><ins>+    <div class="overlapping" style="visibility:hidden">
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -146,7 +75,7 @@
</span><span class="cx">     <div class="overflowscroll target">
</span><span class="cx">         <div class="scrollcontent"></div>
</span><span class="cx">     </div>
</span><del>-    <div class="overlapping" style="box-shadow: 0px 0px 32px 32px blue; left: 60px; top: 60px">
</del><ins>+    <div class="overlapping-empty" style="background-color:transparent">
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -154,7 +83,7 @@
</span><span class="cx">     <div class="overflowscroll target">
</span><span class="cx">         <div class="scrollcontent"></div>
</span><span class="cx">     </div>
</span><del>-    <div class="overlapping" style="pointer-events:none">
</del><ins>+    <div class="overlapping" style="box-shadow: 0px 0px 32px 32px blue; left: 60px; top: 60px">
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -162,8 +91,7 @@
</span><span class="cx">     <div class="overflowscroll target">
</span><span class="cx">         <div class="scrollcontent"></div>
</span><span class="cx">     </div>
</span><del>-    <div class="overlapping" style="top:-60px">
-    Text text text text text text text text text text text text text text text text text text text text text text
</del><ins>+    <div class="overlapping" style="pointer-events:none">
</ins><span class="cx">     </div>
</span><span class="cx"> </div>
</span><span class="cx"> 
</span><span class="lines">@@ -171,15 +99,6 @@
</span><span class="cx">     <div class="overflowscroll target">
</span><span class="cx">         <div class="scrollcontent"></div>
</span><span class="cx">     </div>
</span><del>-    <div class="overlapping" style="top:-60px; padding-left:40px">
-    Text text text text text text text text text text text text text text text text text text text text text text
-    </div>
-</div>
-
-<div class="case">
-    <div class="overflowscroll target">
-        <div class="scrollcontent"></div>
-    </div>
</del><span class="cx">     <div class="overlapping" style="top:40px; left:40px; border-radius:50px; line-height:100px">
</span><span class="cx">     </div>
</span><span class="cx"> </div>
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt (0 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt                              (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Test that scrollable areas with text overlap are correctly targeted.
+
+case 1: Scrollable 1 
+case 2: Scrollable 2 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html (0 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html                              (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<style>
+body {
+    touch-action: none;
+}
+.case {
+    width: 200px;
+    height: 200px;
+    display: inline-block;
+    position: relative;
+}
+.scrollcontent {
+    width: 500px;
+    height: 500px;
+    background: green;
+}
+
+.overflowscroll {
+    overflow: scroll;
+    height: 100px;
+    width: 100px;
+    position: absolute;
+    border: 2px solid black;
+}
+.overlapping {
+    position:absolute;
+    left: 25px;
+    top: 25px;
+    width: 100px;
+    height: 100px;
+    background: red;
+}
+.clip {
+    position:absolute;
+    width: 100px;
+    height: 100px;
+    overflow:hidden;
+}
+.large {
+    width: 3000px;
+    height: 150px;
+}
+#log {
+    position:relative;
+    white-space: pre;
+}
+</style>
+<script src="../../../resources/basic-gestures.js"></script>
+<script src="../resources/overflow-scroll-overlap.js"></script>
+</head>
+<body onload="runTest()">
+<p>
+Test that scrollable areas with text overlap are correctly targeted.
+</p>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px">
+    Text text text text text text text text text text text text text text text text text text text text text text
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; padding-left:40px">
+    Text text text text text text text text text text text text text text text text text text text text text text
+    </div>
+</div>
+
+<div id=log></div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt (0 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt                              (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4-expected.txt 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Test that scrollable areas with overflowing overlap are correctly targeted.
+
+case 1: 
+case 2: 
+case 3: 
+case 4: 
+case 5: 
+case 6: Scrollable 6 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlap4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html (0 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html                              (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<style>
+body {
+    touch-action: none;
+}
+.case {
+    width: 200px;
+    height: 200px;
+    display: inline-block;
+    position: relative;
+}
+.scrollcontent {
+    width: 500px;
+    height: 500px;
+    background: green;
+}
+
+.overflowscroll {
+    overflow: scroll;
+    height: 100px;
+    width: 100px;
+    position: absolute;
+    border: 2px solid black;
+}
+.overlapping {
+    position:absolute;
+    left: 25px;
+    top: 25px;
+    width: 100px;
+    height: 100px;
+    background: red;
+}
+.clip {
+    position:absolute;
+    width: 100px;
+    height: 100px;
+    overflow:hidden;
+}
+.large {
+    width: 3000px;
+    height: 150px;
+}
+#log {
+    position:relative;
+    white-space: pre;
+}
+</style>
+<script src="../../../resources/basic-gestures.js"></script>
+<script src="../resources/overflow-scroll-overlap.js"></script>
+</head>
+<body onload="runTest()">
+<p>
+Test that scrollable areas with overflowing overlap are correctly targeted.
+</p>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px">
+        <div class="overlapping" style="left: -40px; top: -30px"></div>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px; z-index:0">
+        <div class="overlapping" style="left: -40px; top: -30px"></div>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px; top: 90px; z-index:0">
+        <div class="overlapping" style="left: -40px; top: -120px"></div>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px; top: 90px; z-index:0">
+        <div class="overlapping" style="left: -40px; top: -120px; z-index:-1"></div>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px; top: 90px; z-index:0">
+        <div class="overlapping" style="left: -40px; top: -120px; z-index:1"></div>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="left: 80px; top: 60px; z-index:0">
+        <div class="overlapping" style="left: -40px; top: -120px"></div>
+    </div>
+</div>
+
+<div id=log></div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosoverflowscrolloverlaphtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html        2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html   2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -49,85 +49,7 @@
</span><span class="cx"> }
</span><span class="cx"> </style>
</span><span class="cx"> <script src="../../../resources/basic-gestures.js"></script>
</span><del>-<script type="text/javascript">
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-    internals.settings.setAsyncFrameScrollingEnabled(true);
-    internals.settings.setAsyncOverflowScrollingEnabled(true);
-}
-
-function sleep(delay)
-{
-    return new Promise((resolve) => { setTimeout(resolve, delay); });
-}
-
-async function runTest() {
-    for (const scrollable of document.querySelectorAll('.overflowscroll')) {
-        scrollable.addEventListener('scroll', function(e) {
-            logScroll(e.target);
-        });
-    }
-
-    {
-        let i = 0;
-        for (const scrollcontent of document.querySelectorAll('.scrollcontent'))
-            scrollcontent.innerText = "Scrollable " + ++i;
-    }
-    {
-        let i = 0;
-        for (const overlapping of document.querySelectorAll('.overlapping'))
-            overlapping.innerText = "Overlapping " + ++i;
-    }
-
-
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    for (const testcase of document.querySelectorAll('.case'))
-        testcase.style.display = 'none';
-
-    {
-        let i = 0;
-        for (const testcase of document.querySelectorAll('.case')) {
-            ++i;
-            testcase.style.display = 'inline-block';
-            
-            const target = testcase.querySelector('.target');
-            const rect = target.getBoundingClientRect();
-            const centerX = (rect.left + rect.right) / 2;
-            const centerY = (rect.top + rect.bottom) / 2;
-            await touchAndDragFromPointToPoint(centerX, centerY, centerX, centerY - 30);
-            await liftUpAtPoint(centerX, centerY - 30);
-            await sleep(500);
-
-            testcase.style.display = 'none';
-            outputCase(i);
-        }
-   }
-
-    for (const testcase of document.querySelectorAll('.case'))
-        testcase.style.display = 'none';
-
-    testRunner.notifyDone();
-}
-
-const scrolledElements = new Set();
-
-function logScroll(element) {
-    if (scrolledElements.has(element))
-        return;
-    scrolledElements.add(element);
-}
-
-function outputCase(i) {
-    log.innerText += "case " + i + ": ";
-    for (const scrolled of scrolledElements)
-        log.innerText += scrolled.getElementsByClassName("scrollcontent")[0].innerText + " ";
-    log.innerText += "\n";
-    scrolledElements.clear();
-}
-</script>
</del><ins>+<script src="../resources/overflow-scroll-overlap.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body onload="runTest()">
</span><span class="cx"> <p>
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingresourcesoverflowscrolloverlapjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js (0 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js                            (rev 0)
+++ trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js       2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    internals.settings.setAsyncFrameScrollingEnabled(true);
+    internals.settings.setAsyncOverflowScrollingEnabled(true);
+}
+
+function sleep(delay)
+{
+    return new Promise((resolve) => { setTimeout(resolve, delay); });
+}
+
+async function runTest() {
+    for (const scrollable of document.querySelectorAll('.overflowscroll')) {
+        scrollable.addEventListener('scroll', function(e) {
+            logScroll(e.target);
+        });
+    }
+
+    {
+        let i = 0;
+        for (const scrollcontent of document.querySelectorAll('.scrollcontent'))
+            scrollcontent.innerText = "Scrollable " + ++i;
+    }
+    {
+        let i = 0;
+        for (const overlapping of document.querySelectorAll('.overlapping'))
+            overlapping.insertBefore(document.createTextNode("Overlapping " + ++i), overlapping.firstChild);
+    }
+
+
+    if (!window.testRunner || !testRunner.runUIScript)
+        return;
+
+    for (const testcase of document.querySelectorAll('.case'))
+        testcase.style.display = 'none';
+
+    {
+        let i = 0;
+        for (const testcase of document.querySelectorAll('.case')) {
+            ++i;
+            testcase.style.display = 'inline-block';
+
+            const target = testcase.querySelector('.target');
+            const rect = target.getBoundingClientRect();
+            const centerX = (rect.left + rect.right) / 2;
+            const centerY = (rect.top + rect.bottom) / 2;
+            await touchAndDragFromPointToPoint(centerX, centerY, centerX, centerY - 30);
+            await liftUpAtPoint(centerX, centerY - 30);
+            await sleep(500);
+
+            testcase.style.display = 'none';
+            outputCase(i);
+        }
+   }
+
+    for (const testcase of document.querySelectorAll('.case'))
+        testcase.style.display = 'none';
+
+    testRunner.notifyDone();
+}
+
+const scrolledElements = new Set();
+
+function logScroll(element) {
+    if (scrolledElements.has(element))
+        return;
+    scrolledElements.add(element);
+}
+
+function outputCase(i) {
+    log.innerText += "case " + i + ": ";
+    for (const scrolled of scrolledElements)
+        log.innerText += scrolled.getElementsByClassName("scrollcontent")[0].innerText + " ";
+    log.innerText += "\n";
+    scrolledElements.clear();
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/ChangeLog      2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2019-03-18  Antti Koivisto  <antti@apple.com>
+
+        Layer with no backing store should still hit-test over a scroller
+        https://bugs.webkit.org/show_bug.cgi?id=195378
+        <rdar://problem/48652078>
+
+        Reviewed by Simon Fraser.
+
+        Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
+               fast/scrolling/ios/overflow-scroll-overlap-4.html
+
+        Move collecting event region from paint to compositing update time.
+        This solves a number of problems including regions for non-painting layers.
+
+        * platform/graphics/GraphicsLayer.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintObject):
+
+        Use the existing visibleToHitTesting() helper.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerContents):
+
+        Use flag for event region collecting, don't paint content.
+
+        (WebCore::RenderLayer::paintList):
+
+        We can bail out immediately if there is no overflow.
+
+        (WebCore::RenderLayer::paintForegroundForFragments):
+        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
+        (WebCore::RenderLayer::collectEventRegionForFragments):
+
+        Move to a separate function.
+
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateConfiguration):
+
+        Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
+
+        (WebCore::RenderLayerBacking::updateEventRegion):
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        * rendering/RenderLayerBacking.h:
+
</ins><span class="cx"> 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WHLSL] Hook up the compiler to our WebGPU implementation
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h   2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h      2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -453,7 +453,6 @@
</span><span class="cx">     WindRule shapeLayerWindRule() const;
</span><span class="cx">     virtual void setShapeLayerWindRule(WindRule);
</span><span class="cx"> 
</span><del>-    // Non-null if the event sensitive region of the layer differs from the layer bounds.
</del><span class="cx">     const Region& eventRegion() const { return m_eventRegion; }
</span><span class="cx">     virtual void setEventRegion(Region&&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp   2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp      2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -1243,7 +1243,7 @@
</span><span class="cx">     if (paintPhase == PaintPhase::EventRegion) {
</span><span class="cx">         // FIXME: Handle inlines, lineboxes, SVG too.
</span><span class="cx">         // FIXME: Transforms?
</span><del>-        if (style().pointerEvents() != PointerEvents::None)
</del><ins>+        if (visibleToHitTesting())
</ins><span class="cx">             paintInfo.eventRegion->unite(enclosingIntRect(LayoutRect(paintOffset, size())));
</span><span class="cx"> 
</span><span class="cx">         // No need to check descendants if we don't have overflow.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp   2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp      2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -4243,6 +4243,7 @@
</span><span class="cx">     bool isPaintingCompositedForeground = paintFlags.contains(PaintLayerPaintingCompositingForegroundPhase);
</span><span class="cx">     bool isPaintingCompositedBackground = paintFlags.contains(PaintLayerPaintingCompositingBackgroundPhase);
</span><span class="cx">     bool isPaintingOverflowContents = paintFlags.contains(PaintLayerPaintingOverflowContents);
</span><ins>+    bool isCollectingEventRegion = paintFlags.contains(PaintLayerCollectingEventRegion);
</ins><span class="cx">     // Outline always needs to be painted even if we have no visible content. Also,
</span><span class="cx">     // the outline is painted in the background phase during composited scrolling.
</span><span class="cx">     // If it were painted in the foreground phase, it would move with the scrolled
</span><span class="lines">@@ -4249,10 +4250,10 @@
</span><span class="cx">     // content. When not composited scrolling, the outline is painted in the
</span><span class="cx">     // foreground phase. Since scrolled contents are moved by repainting in this
</span><span class="cx">     // case, the outline won't get 'dragged along'.
</span><del>-    bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbars
</del><ins>+    bool shouldPaintOutline = isSelfPaintingLayer && !isPaintingOverlayScrollbars && !isCollectingEventRegion
</ins><span class="cx">         && ((isPaintingScrollingContent && isPaintingCompositedBackground)
</span><span class="cx">         || (!isPaintingScrollingContent && isPaintingCompositedForeground));
</span><del>-    bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars;
</del><ins>+    bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars && !isCollectingEventRegion;
</ins><span class="cx"> 
</span><span class="cx">     if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer())
</span><span class="cx">         return;
</span><span class="lines">@@ -4323,7 +4324,7 @@
</span><span class="cx">             paintBehavior.add(PaintBehavior::ExcludeSelection);
</span><span class="cx"> 
</span><span class="cx">         LayoutRect paintDirtyRect = localPaintingInfo.paintDirtyRect;
</span><del>-        if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
</del><ins>+        if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars || isCollectingEventRegion) {
</ins><span class="cx">             // Collect the fragments. This will compute the clip rectangles and paint offsets for each layer fragment, as well as whether or not the content of each
</span><span class="cx">             // fragment should paint. If the parent's filter dictates full repaint to ensure proper filter effect,
</span><span class="cx">             // use the overflow clip as dirty rect, instead of no clipping. It maintains proper clipping for overflow::scroll.
</span><span class="lines">@@ -4357,6 +4358,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (isCollectingEventRegion)
+            collectEventRegionForFragments(layerFragments, currentContext, localPaintingInfo);
+
</ins><span class="cx">         if (shouldPaintOutline)
</span><span class="cx">             paintOutlineForFragments(layerFragments, currentContext, localPaintingInfo, paintBehavior, subtreePaintRootForRenderer);
</span><span class="cx"> 
</span><span class="lines">@@ -4464,6 +4468,9 @@
</span><span class="cx">     if (!hasSelfPaintingLayerDescendant())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (paintFlags.contains(PaintLayerCollectingEventRegion) && renderBox() && !renderBox()->hasRenderOverflow())
+        return;
+
</ins><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx">     LayerListMutationDetector mutationChecker(*this);
</span><span class="cx"> #endif
</span><span class="lines">@@ -4746,8 +4753,6 @@
</span><span class="cx">         paintForegroundForFragmentsWithPhase(PaintPhase::Float, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
</span><span class="cx">         paintForegroundForFragmentsWithPhase(PaintPhase::Foreground, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
</span><span class="cx">         paintForegroundForFragmentsWithPhase(PaintPhase::ChildOutlines, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
</span><del>-        if (localPaintingInfo.eventRegion)
-            paintForegroundForFragmentsWithPhase(PaintPhase::EventRegion, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
</del><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (shouldClip)
</span><span class="lines">@@ -4769,8 +4774,6 @@
</span><span class="cx">         PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &localPaintingInfo.rootLayer->renderer(), this, localPaintingInfo.requireSecurityOriginAccessForWidgets);
</span><span class="cx">         if (phase == PaintPhase::Foreground)
</span><span class="cx">             paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests;
</span><del>-        if (phase == PaintPhase::EventRegion)
-            paintInfo.eventRegion = localPaintingInfo.eventRegion;
</del><span class="cx">         renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset));
</span><span class="cx">         
</span><span class="cx">         if (shouldClip)
</span><span class="lines">@@ -4843,6 +4846,17 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderLayer::collectEventRegionForFragments(const LayerFragments& layerFragments, GraphicsContext& context, const LayerPaintingInfo& localPaintingInfo)
+{
+    ASSERT(localPaintingInfo.eventRegion);
+
+    for (const auto& fragment : layerFragments) {
+        PaintInfo paintInfo(context, fragment.foregroundRect.rect(), PaintPhase::EventRegion, { });
+        paintInfo.eventRegion = localPaintingInfo.eventRegion;
+        renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset));
+    }
+}
+
</ins><span class="cx"> bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result)
</span><span class="cx"> {
</span><span class="cx">     return hitTest(request, result.hitTestLocation(), result);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h     2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -641,8 +641,9 @@
</span><span class="cx">         PaintLayerPaintingRootBackgroundOnly            = 1 << 11,
</span><span class="cx">         PaintLayerPaintingSkipRootBackground            = 1 << 12,
</span><span class="cx">         PaintLayerPaintingChildClippingMaskPhase        = 1 << 13,
</span><ins>+        PaintLayerCollectingEventRegion                 = 1 << 14,
</ins><span class="cx">     };
</span><del>-    static constexpr OptionSet<PaintLayerFlag> paintLayerPaintingCompositingAllPhasesFlags() { return { PaintLayerPaintingCompositingBackgroundPhase,  PaintLayerPaintingCompositingForegroundPhase }; }
</del><ins>+    static constexpr OptionSet<PaintLayerFlag> paintLayerPaintingCompositingAllPhasesFlags() { return { PaintLayerPaintingCompositingBackgroundPhase, PaintLayerPaintingCompositingForegroundPhase }; }
</ins><span class="cx"> 
</span><span class="cx">     enum class SecurityOriginPaintPolicy { AnyOrigin, AccessibleOriginOnly };
</span><span class="cx"> 
</span><span class="lines">@@ -984,6 +985,7 @@
</span><span class="cx">     void paintMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer);
</span><span class="cx">     void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintBehavior>, RenderObject* paintingRootForRenderer);
</span><span class="cx">     void paintTransformedLayerIntoFragments(GraphicsContext&, const LayerPaintingInfo&, OptionSet<PaintLayerFlag>);
</span><ins>+    void collectEventRegionForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&);
</ins><span class="cx"> 
</span><span class="cx">     RenderLayer* transparentPaintingAncestor();
</span><span class="cx">     void beginTransparencyLayers(GraphicsContext&, const LayerPaintingInfo&, const LayoutRect& dirtyRect);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp    2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp       2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -764,6 +764,8 @@
</span><span class="cx">     if (!m_owningLayer.isRenderViewLayer()) {
</span><span class="cx">         bool didUpdateContentsRect = false;
</span><span class="cx">         updateDirectlyCompositedBoxDecorations(contentsInfo, didUpdateContentsRect);
</span><ins>+
+        updateEventRegion();
</ins><span class="cx">     } else
</span><span class="cx">         updateRootLayerConfiguration();
</span><span class="cx">     
</span><span class="lines">@@ -1430,6 +1432,22 @@
</span><span class="cx">         m_backgroundLayer->setDrawsContent(m_backgroundLayerPaintsFixedRootBackground ? hasPaintedContent : contentsInfo.paintsBoxDecorations());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderLayerBacking::updateEventRegion()
+{
+    GraphicsContext nullContext(nullptr);
+    RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, compositedBounds(), { }, LayoutSize());
+
+    Region eventRegion;
+    paintingInfo.eventRegion = &eventRegion;
+
+    auto paintFlags = RenderLayer::paintLayerPaintingCompositingAllPhasesFlags() | RenderLayer::PaintLayerCollectingEventRegion;
+    m_owningLayer.paintLayerContents(nullContext, paintingInfo, paintFlags);
+
+    eventRegion.translate(roundedIntSize(contentOffsetInCompositingLayer()));
+
+    m_graphicsLayer->setEventRegion(WTFMove(eventRegion));
+}
+
</ins><span class="cx"> // Return true if the layer changed.
</span><span class="cx"> bool RenderLayerBacking::updateAncestorClippingLayer(bool needsAncestorClip)
</span><span class="cx"> {
</span><span class="lines">@@ -2585,19 +2603,8 @@
</span><span class="cx"> 
</span><span class="cx">     RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer);
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS_FAMILY)
-    Region eventRegion;
-    paintingInfo.eventRegion = &eventRegion;
-#endif
-
</del><span class="cx">     m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags);
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS_FAMILY)
-    paintingInfo.eventRegion = nullptr;
-    eventRegion.translate(roundedIntSize(contentOffsetInCompositingLayer()));
-    m_graphicsLayer->setEventRegion(WTFMove(eventRegion));
-#endif
-
</del><span class="cx">     if (m_owningLayer.containsDirtyOverlayScrollbars())
</span><span class="cx">         m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h      2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -352,6 +352,7 @@
</span><span class="cx">     bool paintsContent(RenderLayer::PaintedContentRequest&) const;
</span><span class="cx"> 
</span><span class="cx">     void updateDrawsContent(PaintedContentsInfo&);
</span><ins>+    void updateEventRegion();
</ins><span class="cx"> 
</span><span class="cx">     // Returns true if this compositing layer has no visible content.
</span><span class="cx">     bool isSimpleContainerCompositingLayer(PaintedContentsInfo&) const;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebKit/ChangeLog       2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2019-03-18  Antti Koivisto  <antti@apple.com>
+
+        Layer with no backing store should still hit-test over a scroller
+        https://bugs.webkit.org/show_bug.cgi?id=195378
+        <rdar://problem/48652078>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
+        (WebKit::RemoteLayerTreeHost::makeNode):
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+        (WebKit::collectDescendantViewsAtPoint):
+
+        No need for special WKTiledBackingView, tiled views now have correct event regions.
+
</ins><span class="cx"> 2019-03-18  Daniel Bates  <dabates@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] No DOM keypress event emitted for cursor key commands when non-editable element is focused
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeHostIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm      2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm 2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -72,11 +72,9 @@
</span><span class="cx">     case PlatformCALayer::LayerTypeWebLayer:
</span><span class="cx">     case PlatformCALayer::LayerTypeRootLayer:
</span><span class="cx">     case PlatformCALayer::LayerTypeSimpleLayer:
</span><del>-        return makeAdoptingView([[WKCompositingView alloc] init]);
-        
</del><span class="cx">     case PlatformCALayer::LayerTypeTiledBackingLayer:
</span><span class="cx">     case PlatformCALayer::LayerTypePageTiledBackingLayer:
</span><del>-        return makeAdoptingView([[WKTiledBackingView alloc] init]);
</del><ins>+        return makeAdoptingView([[WKCompositingView alloc] init]);
</ins><span class="cx"> 
</span><span class="cx">     case PlatformCALayer::LayerTypeTiledBackingTileLayer:
</span><span class="cx">         return RemoteLayerTreeNode::createWithPlainLayer(properties.layerID);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h 2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h    2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -40,9 +40,6 @@
</span><span class="cx"> @interface WKCompositingView : UIView
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface WKTiledBackingView : WKCompositingView
-@end
-
</del><span class="cx"> @interface WKTransformView : WKCompositingView
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosRemoteLayerTreeViewsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (243091 => 243092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm        2019-03-18 19:23:42 UTC (rev 243091)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm   2019-03-18 19:42:57 UTC (rev 243092)
</span><span class="lines">@@ -49,8 +49,6 @@
</span><span class="cx">         auto handlesEvent = [&] {
</span><span class="cx">             if (![view pointInside:subviewPoint withEvent:event])
</span><span class="cx">                 return false;
</span><del>-            if ([view isKindOfClass:[WKTiledBackingView class]])
-                return true;
</del><span class="cx">             if (![view isKindOfClass:[WKCompositingView class]])
</span><span class="cx">                 return true;
</span><span class="cx">             auto* node = RemoteLayerTreeNode::forCALayer(view.layer);
</span><span class="lines">@@ -115,9 +113,6 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@implementation WKTiledBackingView
-@end
-
</del><span class="cx"> @implementation WKTransformView
</span><span class="cx"> 
</span><span class="cx"> + (Class)layerClass
</span></span></pre>
</div>
</div>

</body>
</html>