Chromium Code Reviews| Index: LayoutTests/svg/hittest/svg-small-big-path.html |
| diff --git a/LayoutTests/svg/hittest/svg-small-big-path.html b/LayoutTests/svg/hittest/svg-small-big-path.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ebe30358cfbd0bb3158f1470118f3ad3e822eac9 |
| --- /dev/null |
| +++ b/LayoutTests/svg/hittest/svg-small-big-path.html |
| @@ -0,0 +1,48 @@ |
| +<style> |
|
pdr.
2015/08/20 21:25:13
<DOCTYPE HTML> please, as this prevents quirky beh
jbroman
2015/08/20 21:28:20
nit: <!DOCTYPE html> is the correct HTML5 doctype
Yufeng Shen (Slow to review)
2015/08/24 20:13:07
Done.
|
| + svg { |
| + margin: 0px; |
| + padding: 0px; |
| + position: absolute; |
| + top: 0px; |
| + left: 0px; |
| + } |
| +</style> |
| +<body> |
| + <svg x="0" y="0"> |
| + <svg x="-250000" width="500000" height="500"> |
| + <path id="path" d="M 250005 104 l 19 0 l 3 3 l -3 3 l -19 0 z"></path> |
| + </svg> |
| + </svg> |
| + |
| +<script src="../../resources/js-test.js"></script> |
| +<script> |
| + description("Test that hit-test works for a path whose x/y ranges have different magnitude."); |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + var resultString = ""; |
| + var pathElement = document.getElementById("path"); |
| + |
| + var pointsInPath = [ |
| + {x: 5, y: 104}, |
| + {x: 5, y: 107}, |
| + {x: 5, y: 110} |
| + ]; |
| + |
| + var pointsNotInPath = [ |
| + {x: 5, y: 103}, |
| + {x: 5, y: 111} |
| + ]; |
| + |
| + pointsInPath.forEach( function(point) { |
| + var pass = (pathElement == document.elementFromPoint(point.x, point.y)); |
| + resultString += ((pass) ? "PASS" : "FAIL") + " path contains point at (" + point.x + ", " + point.y + ")\n"; |
| + }); |
| + pointsNotInPath.forEach( function(point) { |
| + var pass = (pathElement != document.elementFromPoint(point.x, point.y)); |
| + resultString += ((pass) ? "PASS" : "FAIL") + " path does not contain point at (" + point.x + ", " + point.y + ")\n"; |
| + }); |
| + |
| + debug(resultString); |
| +</script> |
| +</body> |