<!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>[269450] 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/269450">269450</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2020-11-05 10:36:12 -0800 (Thu, 05 Nov 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/263179">r263179</a>): CSS checkbox no longer visible in iOS 14
https://bugs.webkit.org/show_bug.cgi?id=216690
<rdar://problem/69156576>

Reviewed by Simon Fraser.

Source/WebCore:

We revert the changes to RenderBox::addVisualEffectOverflow() introduced in
<a href="http://trac.webkit.org/projects/webkit/changeset/263179">r263179</a> for bug 213260.

Instead of that original change, which affected painting instead of hit-testing,
we now ensure that RenderBlock::nodeAtPoint() will check the hit-test point is
within an element's clipped bounds before considering its children. Whether the
element has a self-painting layer should have no bearing here.

Tests: fast/box-shadow/box-shadow-with-zero-height.html
       fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::addVisualEffectOverflow):

LayoutTests:

Add two new tests: one that identifies the particular regression introduced by <a href="http://trac.webkit.org/projects/webkit/changeset/263179">r263179</a> where
<div style="box-shadow: 0 0 0 10px"> would render nothing at all, and another one that does
further hit-testing on clipped child of an element with height: 0 and box-shadow to set ink
overflow which was failing even after <a href="http://trac.webkit.org/projects/webkit/changeset/263179">r263179</a>.

* fast/box-shadow/box-shadow-with-zero-height-expected.html: Added.
* fast/box-shadow/box-shadow-with-zero-height.html: Added.
* fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt: Added.
* fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastboxshadowboxshadowwithzeroheightexpectedhtml">trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastboxshadowboxshadowwithzeroheighthtml">trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height.html</a></li>
<li><a href="#trunkLayoutTestsfastboxshadowhittestboxshadowonzeroheightclippingcontainer2expectedtxt">trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastboxshadowhittestboxshadowonzeroheightclippingcontainer2html">trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (269449 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2020-11-05 18:29:55 UTC (rev 269449)
+++ trunk/LayoutTests/ChangeLog 2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2020-11-05  Antoine Quint  <graouts@webkit.org>
+
+        REGRESSION (r263179): CSS checkbox no longer visible in iOS 14
+        https://bugs.webkit.org/show_bug.cgi?id=216690
+        <rdar://problem/69156576>
+
+        Reviewed by Simon Fraser.
+
+        Add two new tests: one that identifies the particular regression introduced by r263179 where
+        <div style="box-shadow: 0 0 0 10px"> would render nothing at all, and another one that does
+        further hit-testing on clipped child of an element with height: 0 and box-shadow to set ink
+        overflow which was failing even after r263179.
+
+        * fast/box-shadow/box-shadow-with-zero-height-expected.html: Added.
+        * fast/box-shadow/box-shadow-with-zero-height.html: Added.
+        * fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt: Added.
+        * fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html: Added.
+
</ins><span class="cx"> 2020-11-05  Aditya Keerthi  <akeerthi@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [macOS] Toggling dark mode does not update the scrollbar appearance in overflow: scroll elements
</span></span></pre></div>
<a id="trunkLayoutTestsfastboxshadowboxshadowwithzeroheightexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height-expected.html (0 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height-expected.html                              (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height-expected.html 2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<body style="margin: 0"><div style="height: 10px; background-color: black"></div></body>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastboxshadowboxshadowwithzeroheighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height.html (0 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height.html                               (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/box-shadow-with-zero-height.html  2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<body style="margin: 0"><div style="box-shadow: 0 0 0 10px"></div></body>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastboxshadowhittestboxshadowonzeroheightclippingcontainer2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt (0 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt                           (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2-expected.txt      2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+Hovering over the blue shadow area under the black bar should not make green go to red, for the whole width
+
+PASS: target element class is "first box"
</ins></span></pre></div>
<a id="trunkLayoutTestsfastboxshadowhittestboxshadowonzeroheightclippingcontainer2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html (0 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html                           (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html      2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+
+    .box {
+        position: absolute;
+        top: 100px;
+        left: 100px;
+        width: 500px;
+        height: 500px;
+        max-height: 0;
+        overflow-y: hidden;
+        background-color: red;
+        border: 10px solid black;
+    }
+
+    .first {
+        top: 50px;
+        max-height: 300px;
+        width: 400px;
+    }
+    
+    .second {
+        box-shadow: 0 0 0 20px rgba(0, 0, 128, 0.5);
+    }
+
+    .box:hover {
+        background-color: green;
+    }
+
+    .inner {
+        padding: 24px;
+        width: 400px;
+        margin-left: 200px;
+        background-color: blue;
+        border: 1px solid black;
+    }
+    </style>
+</head>
+<body>
+    <p>Hovering over the blue shadow area under the black bar should not make green go to red, for the whole width</p>
+    <div class="first box"></div>
+    <div class="second box">
+        <div class="inner"></div>
+    </div>
+    <script>
+
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+const result = document.body.appendChild(document.createElement("span"));
+const hitTestElement = document.elementFromPoint(500, 130);
+const pass = hitTestElement.className == "first box";
+result.textContent = `${pass ? "PASS" : "FAIL"}: target element class is "${hitTestElement.className}"`;
+
+    </script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (269449 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-11-05 18:29:55 UTC (rev 269449)
+++ trunk/Source/WebCore/ChangeLog      2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2020-11-05  Antoine Quint  <graouts@webkit.org>
+
+        REGRESSION (r263179): CSS checkbox no longer visible in iOS 14
+        https://bugs.webkit.org/show_bug.cgi?id=216690
+        <rdar://problem/69156576>
+
+        Reviewed by Simon Fraser.
+
+        We revert the changes to RenderBox::addVisualEffectOverflow() introduced in
+        r263179 for bug 213260.
+
+        Instead of that original change, which affected painting instead of hit-testing,
+        we now ensure that RenderBlock::nodeAtPoint() will check the hit-test point is
+        within an element's clipped bounds before considering its children. Whether the
+        element has a self-painting layer should have no bearing here.
+
+        Tests: fast/box-shadow/box-shadow-with-zero-height.html
+               fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::addVisualEffectOverflow):
+
</ins><span class="cx"> 2020-11-03  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove more functions that implicitly use composed tree
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (269449 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp   2020-11-05 18:29:55 UTC (rev 269449)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp      2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -2081,8 +2081,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If we have clipping, then we can't have any spillout.
</span><del>-    bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer();
-    bool useClip = (hasControlClip() || useOverflowClip);
</del><ins>+    bool useClip = (hasControlClip() || hasOverflowClip());
</ins><span class="cx">     bool checkChildren = !useClip || (hasControlClip() ? locationInContainer.intersects(controlClipRect(adjustedLocation)) : locationInContainer.intersects(overflowClipRect(adjustedLocation, nullptr, IncludeOverlayScrollbarSize)));
</span><span class="cx">     if (checkChildren && hitTestChildren(request, result, locationInContainer, adjustedLocation, hitTestAction))
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (269449 => 269450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp     2020-11-05 18:29:55 UTC (rev 269449)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2020-11-05 18:36:12 UTC (rev 269450)
</span><span class="lines">@@ -4596,16 +4596,9 @@
</span><span class="cx">     if (!hasBoxShadow && !hasBorderImageOutsets && !hasOutline)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // If all we have is a box-shadow and the border box has either 0-width or 0-height,
-    // the box-shadow should not extend the visual overflow.
-    auto borderBox = borderBoxRect();
-    if (!hasBorderImageOutsets && !hasOutline && borderBox.isEmpty())
-        return;
</del><ins>+    addVisualOverflow(applyVisualEffectOverflow(borderBoxRect()));
</ins><span class="cx"> 
</span><del>-    addVisualOverflow(applyVisualEffectOverflow(borderBox));
-
-    RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlow();
-    if (fragmentedFlow)
</del><ins>+    if (auto* fragmentedFlow = enclosingFragmentedFlow())
</ins><span class="cx">         fragmentedFlow->addFragmentsVisualEffectOverflow(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>