OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body onload="onPageLoad()"> | 3 <body onload="onPageLoad()"> |
4 Check that hit testing on a <rect> with various miterlimits around sqrt(2)
works properly. If the test passes, you will see "PASS" below. | 4 Check that hit testing on a <rect> with various miterlimits around sqrt(2)
works properly. If the test passes, you will see "PASS" below. |
5 <p id="result">Running test...</p> | 5 <p id="result">Running test...</p> |
6 <svg id="svg" width="100" height="100" version="1.1"> | 6 <svg id="svg" width="100" height="100" version="1.1"> |
7 <rect id="rect" fill="none" stroke="black" stroke-width="20" x="10" y="10" w
idth="80" height="80"/> | 7 <rect id="rect" fill="none" stroke="black" stroke-width="20" x="10" y="10" w
idth="80" height="80"/> |
8 </svg> | 8 </svg> |
9 <script type="text/javascript"> | 9 <script type="text/javascript"> |
10 if (window.testRunner) { | 10 if (window.testRunner) { |
11 testRunner.dumpAsText(); | 11 testRunner.dumpAsText(); |
12 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
13 } | 13 } |
14 | 14 |
15 var result = document.getElementById("result"), | 15 var result = document.getElementById("result"), |
16 svg = document.getElementById("svg"), | 16 svg = document.getElementById("svg"), |
17 rect = document.getElementById("rect"); | 17 rect = document.getElementById("rect"); |
18 function onPageLoad() { | 18 function onPageLoad() { |
19 // sqrt(2) = 1.414213562373095... | 19 // sqrt(2) = 1.414213562373095... |
20 var intervals = [ | 20 var intervals = [ |
21 ["1.4", "1.5"], | 21 ["1.4", "1.5"], |
22 ["1.41", "1.42"], | 22 ["1.41", "1.42"], |
23 ["1.414", "1.415"], | 23 ["1.414", "1.415"], |
24 ["1.4142", "1.4143"], | 24 ["1.4142", "1.4143"], |
25 ["1.41421", "1.41422"], | 25 ["1.41421", "1.41422"], |
26 ["1.414213", "1.414214"] | 26 ["1.414213", "1.414220"] |
27 //,["1.4142135", "1.4142136"] | 27 //,["1.4142135", "1.4142136"] |
28 ]; | 28 ]; |
29 | 29 |
30 var bcr = svg.getBoundingClientRect(), | 30 var bcr = svg.getBoundingClientRect(), |
31 x0 = bcr.left, | 31 x0 = bcr.left, |
32 y0 = bcr.top; | 32 y0 = bcr.top; |
33 | 33 |
34 var i = 0; | 34 var i = 0; |
35 requestAnimationFrame(function nextInterval() { | 35 requestAnimationFrame(function nextInterval() { |
36 if (i >= intervals.length) { | 36 if (i >= intervals.length) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 return; | 83 return; |
84 } | 84 } |
85 | 85 |
86 requestAnimationFrame(nextInterval); | 86 requestAnimationFrame(nextInterval); |
87 }); | 87 }); |
88 }); | 88 }); |
89 } | 89 } |
90 </script> | 90 </script> |
91 </body> | 91 </body> |
92 </html> | 92 </html> |
OLD | NEW |