2 <script src=
"../../../resources/js-test.js"></script>
4 var jsTestIsAsync
= true;
8 var iframe
= document
.getElementById('frame');
9 var iframeDoc
= iframe
.contentWindow
.document
;
11 iframeDoc
.body
.innerHTML
= '<img id="srcset" srcset="resources/blue_rect.jpg 90w, resources/image-set-4x.png 120w">';
13 img
= iframeDoc
.getElementById('srcset');
16 img
.onload = function() {
19 shouldNotBe('img.currentSrc.indexOf("blue_rect")', '-1');
20 iframe
.style
.width
= '120px';
22 shouldNotBe('img.currentSrc.indexOf("image-set-4x")', '-1');
26 img
.onerror = function() {
27 testFailed('Image should have loaded');
32 <iframe id=
"frame" style=
"width: 80px;"></iframe>