img-title-only-w-sizing.html (863B)
1 <!doctype html> 2 <title>Images with only title should be treated as a replaced element</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="author" href="mailto:yuzhehan@chromium.org" title="Yu Han"> 6 <link rel="help" href="https://crbug.com/958250"> 7 <link ref="help" href="https://html.spec.whatwg.org/multipage/rendering.html#images-3"> 8 <style> 9 .title-only { 10 width: 100px; 11 height: 150px; 12 } 13 </style> 14 <img class="title-only" title="title"> 15 <img width="100" height="150px" title="title"> 16 <script> 17 async_test(t => { 18 onload = t.step_func_done(function() { 19 for (const img of document.querySelectorAll("img")) { 20 assert_equals(img.offsetWidth, 100, `width: ${img.outerHTML}`); 21 assert_equals(img.offsetHeight, 150, `height: ${img.outerHTML}`); 22 } 23 }); 24 }); 25 </script>