OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Test reported width of inline in float</title> |
| 5 <style> |
| 6 #outer { |
| 7 float: left; |
| 8 font-size: 15px; |
| 9 } |
| 10 p { |
| 11 clear: left; |
| 12 } |
| 13 </style> |
| 14 <script src="../../resources/testharness.js"></script> |
| 15 <script src="../../resources/testharnessreport.js"></script> |
| 16 </head> |
| 17 <body> |
| 18 <span id="outer"><span id="inner">Customer Supportz</span></span> |
| 19 <p> |
| 20 The reported inner width must be the same as the outer width. |
| 21 </p> |
| 22 <script> |
| 23 test(function() { |
| 24 var outer = document.getElementById('outer'); |
| 25 var inner = document.getElementById('inner'); |
| 26 |
| 27 assert_equals(outer.offsetWidth, inner.offsetWidth, |
| 28 'Inner offsetWidth must match outer offsetWidth.'); |
| 29 |
| 30 assert_equals(outer.offsetWidth, |
| 31 Math.round(outer.getBoundingClientRect().width), |
| 32 'Outer offsetWidth must match rounded width.'); |
| 33 |
| 34 assert_equals(inner.offsetWidth, |
| 35 Math.round(inner.getBoundingClientRect().width), |
| 36 'Inner offsetWidth must match rounded width.'); |
| 37 }); |
| 38 </script> |
| 39 </body> |
| 40 </html> |
OLD | NEW |