content-visibility-input-image.html (1121B)
1 <!DOCTYPE html> 2 <link rel="author" href="mailto:jarhar@chromium.org"> 3 <link rel="help" href="http://crbug.com/1247417"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <div style="content-visibility:hidden" id=container1></div> 8 <div style="content-visibility:hidden" id=container2></div> 9 10 <script> 11 promise_test(async () => { 12 const image1 = document.createElement('input'); 13 image1.type = 'image'; 14 const image1Load = new Promise(resolve => { 15 image1.addEventListener('load', resolve); 16 }); 17 image1.src = 'resources/dice.png'; 18 container1.appendChild(image1); 19 await image1Load; 20 assert_not_equals(image1.width, 0, 'width'); 21 22 const image2 = document.createElement('input'); 23 image2.type = 'image'; 24 const image2Load = new Promise(resolve => { 25 image2.addEventListener('load', resolve); 26 }); 27 image2.src = 'resources/dice.png'; 28 container2.appendChild(image2); 29 await image2Load; 30 assert_not_equals(image2.height, 0, 'height'); 31 32 }, `<input type=image> should return nonzero values for width and height in a c-v:hidden subtree.`); 33 </script>