haikuwebkit/LayoutTests/fast/box-shadow/hit-test-box-shadow-on-zero...

60 lines
1.3 KiB
HTML
Raw Permalink Normal View History

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. Source/WebCore: 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): LayoutTests: 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. Canonical link: https://commits.webkit.org/231273@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-05 18:36:12 +00:00
<!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>