-
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.
Hit testing on element with 180deg flip inside preserve-3d not findin…
…g correct element. https://bugs.webkit.org/show_bug.cgi?id=258565 <rdar://111393557> Reviewed by Simon Fraser. Floating point precision (using double) meant that sin(180deg) wasn't returning exactly 0. When combining multiple transforms together using preserve-3d, this meant that layers that are intended to be coplanar ended up at slightly different depths. This adds rounding for tiny values to make them exactly zero, so that the layers end up coplanar again, and we hit test in DOM order for those. * LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-3-expected.txt: Added. * LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-3.html: Added. * Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::roundEpsilonToZero): (WebCore::TransformationMatrix::rotate3d): (WebCore::TransformationMatrix::rotate): Canonical link: https://commits.webkit.org/266237@main
- Loading branch information
1 parent
2c13e49
commit 1aa517d
Showing
11 changed files
with
78 additions
and
23 deletions.
There are no files selected for viewing
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
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
2 changes: 0 additions & 2 deletions
2
LayoutTests/fast/text/combining-character-sequence-vertical.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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<!-- webkit-test-runner [ useThreadedScrolling=false ] --> | ||
<!-- This test depends on subpixel quantization being disabled, which is the case when threaded scrolling is disabled. --> | ||
<div style="width: 100px; font-family: 'geeza pro'; font-size: 48px; -webkit-writing-mode: vertical-rl;"> | ||
بحٓ | ||
</div> |
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
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
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
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
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
1 change: 1 addition & 0 deletions
1
LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-3-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 @@ | ||
Hit correct target: PASSED |
50 changes: 50 additions & 0 deletions
50
LayoutTests/transforms/3d/hit-testing/hit-preserves-3d-3.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,50 @@ | ||
<html> | ||
<head> | ||
<title>Hit testing on preserves-3d element with 180deg flip</title> | ||
<style> | ||
.rotateX { | ||
transform: rotateX(180deg); | ||
transform-style: preserve-3d; | ||
width: 300px; | ||
height: 200px; | ||
background: cyan; | ||
} | ||
|
||
.rotateY { | ||
width: 200px; | ||
height: 100px; | ||
transform: rotateY(180deg); | ||
background: blue; | ||
} | ||
|
||
#button { | ||
width: 100px; | ||
height: 50px; | ||
background-color: red; | ||
} | ||
</style> | ||
<script type="text/javascript" charset="utf-8"> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
function runTest() | ||
{ | ||
var hit = document.elementFromPoint(120, 180); | ||
var results = document.getElementById('results'); | ||
if (hit == document.getElementById('button')) | ||
results.innerHTML = 'Hit correct target: PASSED'; | ||
else | ||
results.innerHTML = 'Failed to find target: FAIL'; | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<div class="rotateX"> | ||
<div class="rotateY"> | ||
<div id="button"> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div id="results"></div> | ||
</body> | ||
</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