relayout-image-load.html (1054B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Flexbox: Relayout after loading an image</title> 5 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#resolve-flexible-lengths"> 6 <link rel="help" href="https://drafts.csswg.org/css-images-4/#image-values"> 7 <meta name="assert" content="This test ensures flexbox does a relayout after an image loads."> 8 <link href="support/flexbox.css" rel="stylesheet"> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="/resources/check-layout-th.js"></script> 12 </head> 13 <body> 14 <div id=log></div> 15 <p>Test passes if a green 100x100 image is rendered.</p> 16 <div id="test" class="flexbox"> 17 18 <div class="flexbox"> 19 <img data-expected-width=100 data-expected-height=100 id="image" onload="imageLoaded()"> 20 </div> 21 </div> 22 <script> 23 24 function changeImage() 25 { 26 document.getElementById("image").src = "support/100x100-green.png"; 27 } 28 step_timeout(changeImage, 0); 29 30 function imageLoaded() 31 { 32 checkLayout('#test') 33 } 34 </script> 35 </body> 36 </html>