Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: LayoutTests/svg/hittest/svg-small-big-path.html

Issue 1300783005: Scale x/y coordinate of svg path separately for hit-test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/svg/hittest/svg-small-big-path-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..48e63563cb4a72451446cd8baaffa5d2d3a12760
--- /dev/null
+++ b/LayoutTests/svg/hittest/svg-small-big-path.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<style>
+ 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>
« no previous file with comments | « no previous file | LayoutTests/svg/hittest/svg-small-big-path-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698