OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 <title>Should used styled image dimensions if available.</title> |
Srirama
2016/08/16 14:22:20
s/used/use
sivag
2016/08/16 14:53:12
Done.
| |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
4 | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <style> | 5 <style> |
6 img { | 6 img { |
7 width: 200px; | 7 width: 200px; |
8 height: 200px; | 8 height: 200px; |
9 } | 9 } |
10 </style> | 10 </style> |
11 | |
12 <img id="image" src="resources/test-load.jpg" width="100" height="100"> | 11 <img id="image" src="resources/test-load.jpg" width="100" height="100"> |
13 | |
14 <script> | 12 <script> |
15 description("Should used styled image dimensions if available."); | 13 test(function() { |
16 var image = document.getElementById("image"); | 14 var image = document.getElementById("image"); |
Srirama
2016/08/16 14:22:20
remove id attribute and use document.querySelector
sivag
2016/08/16 14:53:12
Done.
| |
17 shouldBe("image.width", "200"); | 15 assert_equals(image.width, 200); |
18 shouldBe("image.height", "200"); | 16 assert_equals(image.height, 200); |
19 var rect = image.getBoundingClientRect(); | 17 var rect = image.getBoundingClientRect(); |
20 shouldBe("rect.width", "200"); | 18 assert_equals(rect.width, 200); |
21 shouldBe("rect.height", "200"); | 19 assert_equals(rect.height, 200); |
20 }); | |
22 </script> | 21 </script> |
OLD | NEW |