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

54 lines
996 B
HTML
Raw Permalink Normal View History

quikr.com: unable to select item from dropdown https://bugs.webkit.org/show_bug.cgi?id=213260 <rdar://problem/58106011> Reviewed by Zalan Bujtas. Source/WebCore: Only account for box-shadow when computing the background rect if the clipping element itself has non-zero used width and height. Tests: fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-height-clipping-container.html fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-width-clipping-container.html fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container.html fast/box-shadow/hit-test-box-shadow-on-zero-width-clipping-container.html * rendering/RenderBox.cpp: (WebCore::RenderBox::addVisualEffectOverflow): LayoutTests: Add two new tests that check that we correctly do not consider content within a clipping container that has 0-width or 0-height and box-shadow, with or without empty margins. * fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-height-clipping-container-expected.txt: Added. * fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-height-clipping-container.html: Added. * fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-width-clipping-container-expected.txt: Added. * fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-width-clipping-container.html: Added. * fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-expected.txt: Added. * fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container.html: Added. * fast/box-shadow/hit-test-box-shadow-on-zero-width-clipping-container-expected.txt: Added. * fast/box-shadow/hit-test-box-shadow-on-zero-width-clipping-container.html: Added. Canonical link: https://commits.webkit.org/226108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-17 20:09:26 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
}
body > div {
position: absolute;
width: 0;
height: 500px;
/* box-shadow should not be accounted for to specify the clipping bounds */
box-shadow: 100px 100px 0px blue;
overflow-x: hidden;
}
#container-with-width {
width: 300px;
background-color: red;
}
#container-with-width:hover {
background-color: green;
}
#clipped-child {
width: 100px;
height: 100%;
}
</style>
</head>
<body>
<div id="container-with-width"></div>
<div id="container-without-width">
<div id="clipped-child"></div>
</div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
const result = document.body.appendChild(document.createElement("span"));
const hitTestElement = document.elementFromPoint(50, 50);
const pass = hitTestElement.id == "container-with-width";
result.textContent = `${pass ? "PASS" : "FAIL"}: target element is #${hitTestElement.id}`;
</script>
</body>
</html>