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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 svg {
4 margin: 0px;
5 padding: 0px;
6 position: absolute;
7 top: 0px;
8 left: 0px;
9 }
10 </style>
11 <body>
12 <svg x="0" y="0">
13 <svg x="-250000" width="500000" height="500">
14 <path id="path" d="M 250005 104 l 19 0 l 3 3 l -3 3 l -19 0 z"></path>
15 </svg>
16 </svg>
17
18 <script src="../../resources/js-test.js"></script>
19 <script>
20 description("Test that hit-test works for a path whose x/y ranges have diffe rent magnitude.");
21 if (window.testRunner)
22 testRunner.dumpAsText();
23
24 var resultString = "";
25 var pathElement = document.getElementById("path");
26
27 var pointsInPath = [
28 {x: 5, y: 104},
29 {x: 5, y: 107},
30 {x: 5, y: 110}
31 ];
32
33 var pointsNotInPath = [
34 {x: 5, y: 103},
35 {x: 5, y: 111}
36 ];
37
38 pointsInPath.forEach( function(point) {
39 var pass = (pathElement == document.elementFromPoint(point.x, point.y));
40 resultString += ((pass) ? "PASS" : "FAIL") + " path contains point at (" + point.x + ", " + point.y + ")\n";
41 });
42 pointsNotInPath.forEach( function(point) {
43 var pass = (pathElement != document.elementFromPoint(point.x, point.y));
44 resultString += ((pass) ? "PASS" : "FAIL") + " path does not contain poi nt at (" + point.x + ", " + point.y + ")\n";
45 });
46
47 debug(resultString);
48 </script>
49 </body>
OLDNEW
« 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