OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 .specwidth { width: 400px } |
| 6 .stf { float: left; } |
| 7 .test { display: block; background-color: red } |
| 8 .sizer { width: 200px } |
| 9 .control { /* overlay to hide the red */ |
| 10 position: absolute; |
| 11 width: 200px; |
| 12 height: 200px; |
| 13 background-color: green; |
| 14 } |
| 15 </style> |
| 16 <body> |
| 17 <div class="specwidth"> |
| 18 <div class="stf"> |
| 19 <svg class="test" viewBox="0 0 1 1"> |
| 20 </svg> |
| 21 <div class="sizer"> |
| 22 </div> |
| 23 </div> |
| 24 </div> |
| 25 <div class="control"> |
| 26 </div> |
| 27 <script> |
| 28 test(function() { |
| 29 var bounds = document.querySelector('.test').getBoundingClientRect(); |
| 30 assert_equals(bounds.width, 200); |
| 31 assert_equals(bounds.height, 200); |
| 32 }, "Use available width and use intrinsic ratio to compute height"); |
| 33 </script> |
| 34 </body> |
OLD | NEW |