OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>HTMLImageElement.width/height returns styled dimensions.</title> | 2 <title>HTMLImageElement.width/height returns styled dimensions.</title> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 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 <img src="resources/test-load.jpg" width="100" height="100"> | 11 <img src="resources/test-load.jpg" width="100" height="100"> |
12 <script> | 12 <script> |
13 test(function() { | 13 test(function() { |
14 var image = document.querySelector("img"); | 14 var image = document.querySelector("img"); |
15 assert_equals(image.width, 200); | 15 assert_equals(image.width, 200); |
16 assert_equals(image.height, 200); | 16 assert_equals(image.height, 200); |
17 var rect = image.getBoundingClientRect(); | 17 var rect = image.getBoundingClientRect(); |
18 assert_equals(rect.width, 200); | 18 assert_equals(rect.width, 200); |
19 assert_equals(rect.height, 200); | 19 assert_equals(rect.height, 200); |
20 }); | 20 }); |
21 </script> | 21 </script> |
OLD | NEW |