-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 048b254. rdar://problem/110032480
transform-style:preserve-3d has incorrect hit-testing of negative z-index ::after. https://bugs.webkit.org/show_bug.cgi?id=255028 Reviewed by Simon Fraser. We call hitTestList with the intention of storing the result in the temporary object 'hitLayer', and only mutate the final result 'candidateLayer' if the depth test passes. Unfortunately the 'result' variable is also part of the final output, and this gets mutated on hitTestList calls that don't pass the depth test. This creates a temporary 'tempResult' (like we do for the other sections of this function), and only copies back to 'result' if the depth test passes. * LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-2-expected.txt: Added. * LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-2.html: Added. * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTestLayer): Canonical link: https://commits.webkit.org/262728@main Identifier: 259548.791@safari-7615-branch
- Loading branch information
1 parent
1e61659
commit 9316f6e
Showing
3 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-2-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Hit Me | ||
Hit correct target: PASSED |
53 changes: 53 additions & 0 deletions
53
LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!doctype html> | ||
<title>Hit testing preserve-3d + negative z-index ::after</title> | ||
<style> | ||
* { | ||
position: relative; | ||
} | ||
|
||
#container { | ||
width: 200px; | ||
height: 200px | ||
display: flex; | ||
background: beige; | ||
align-items: center; | ||
transform-style: preserve-3d; | ||
} | ||
|
||
#container::after { | ||
width: 200px; | ||
height: 200px; | ||
content: ""; | ||
display: block; | ||
position: absolute; | ||
background: aliceblue; | ||
top: 0%; | ||
z-index: -1; | ||
} | ||
|
||
#hit { | ||
display: block; | ||
width: 200px; | ||
height: 200px; | ||
} | ||
|
||
</style> | ||
<body> | ||
<div id="container"> | ||
<a id="hit" href="2">Hit Me</a> | ||
</div> | ||
|
||
<div id="results"></div> | ||
|
||
<script type="text/javascript" charset="utf-8"> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
var hit = document.elementFromPoint(100, 100); | ||
var results = document.getElementById('results'); | ||
if (hit == document.getElementById('hit')) | ||
results.innerHTML = 'Hit correct target: PASSED'; | ||
else | ||
results.innerHTML = 'Failed to find correct target: FAIL'; | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters