OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 #console { margin-top: 40px; } | 5 #console { margin-top: 40px; } |
6 </style> | 6 </style> |
7 <script src="../js/resources/js-test-pre.js"></script> | 7 <script src="../../resources/js-test.js"></script> |
8 </head> | 8 </head> |
9 | 9 |
10 <body style="zoom: 1.1"> | 10 <body style="zoom: 1.1"> |
11 <div> | 11 <div> |
12 <canvas style="position: absolute; top: 0px; left: 0px; background-c
olor: black;" width="32" height="32"></canvas> | 12 <canvas style="position: absolute; top: 0px; left: 0px; background-c
olor: black;" width="32" height="32"></canvas> |
13 <canvas style="position: absolute; top: 0px; left: 32px; background-
color: black;" width="32" height="32"></canvas> | 13 <canvas style="position: absolute; top: 0px; left: 32px; background-
color: black;" width="32" height="32"></canvas> |
14 <canvas style="position: absolute; top: 0px; left: 64px; background-
color: black;" width="32" height="32"></canvas> | 14 <canvas style="position: absolute; top: 0px; left: 64px; background-
color: black;" width="32" height="32"></canvas> |
15 <canvas style="position: absolute; top: 0px; left: 96px; background-
color: black;" width="32" height="32"></canvas> | 15 <canvas style="position: absolute; top: 0px; left: 96px; background-
color: black;" width="32" height="32"></canvas> |
16 </div> | 16 </div> |
17 | 17 |
18 <script> | 18 <script> |
19 function r(n) { | 19 function r(n) { |
20 return Math.round(n * 1000) / 1000; | 20 return Math.round(n * 1000) / 1000; |
21 } | 21 } |
22 | 22 |
23 var expected = 0; | 23 var expected = 0; |
24 var elements = document.getElementsByTagName('canvas'); | 24 var elements = document.getElementsByTagName('canvas'); |
25 for (var el, i = 0; el = elements[i]; i++) { | 25 for (var el, i = 0; el = elements[i]; i++) { |
26 var rect = el.getBoundingClientRect(); | 26 var rect = el.getBoundingClientRect(); |
27 if (Math.round(expected) == Math.round(rect.left)) | 27 if (Math.round(expected) == Math.round(rect.left)) |
28 testPassed('Left edge of block lines up with right edge of p
revious block.'); | 28 testPassed('Left edge of block lines up with right edge of p
revious block.'); |
29 else | 29 else |
30 shouldBe('Math.round(rect.left)', String(Math.round(expected
))); | 30 shouldBe('Math.round(rect.left)', String(Math.round(expected
))); |
31 expected += rect.width; | 31 expected += rect.width; |
32 } | 32 } |
33 </script> | 33 </script> |
34 </body> | 34 </body> |
35 </html> | 35 </html> |
OLD | NEW |