test_viewport_resize.html (1359B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1135812 5 --> 6 <head> 7 <title>Test for Bug 1135812</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1135812">Mozilla Bug 1135812</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 <pre id="test"> 18 19 <iframe style="width: 50px;" 20 srcdoc='<picture><source srcset="data:,a" media="(min-width: 150px)" /><source srcset="data:,b" media="(min-width: 100px)" /><img src="data:,c" /></picture>'></iframe> 21 <script> 22 SimpleTest.waitForExplicitFinish(); 23 addEventListener('load', function() { 24 var iframe = document.querySelector('iframe'); 25 var img = iframe.contentDocument.querySelector('img'); 26 is(img.currentSrc, 'data:,c'); 27 28 img.onload = function() { 29 is(img.currentSrc, 'data:,a'); 30 img.onload = function() { 31 is(img.currentSrc, 'data:,b'); 32 SimpleTest.finish(); 33 } 34 img.onerror = img.onload; 35 iframe.style.width = '120px'; 36 }; 37 img.onerror = img.onload; 38 39 iframe.style.width = '200px'; 40 }, true); 41 </script> 42 </pre> 43 </body> 44 </html>