OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script> |
| 4 window.targetScaleFactor = 1; |
| 5 </script> |
| 6 <script src="resources/srcset-helper.js"></script> |
| 7 <script src="../js/resources/js-test-pre.js"></script> |
| 8 <script> |
| 9 if (window.testRunner) { |
| 10 testRunner.dumpAsText(); |
| 11 } |
| 12 |
| 13 function updateSrc() { |
| 14 var img = document.getElementById("foo"); |
| 15 // srcset must be set first, otherwise 'src' is loaded as well |
| 16 img.src = ""; |
| 17 } |
| 18 |
| 19 addEventListener("DOMContentLoaded", function() { |
| 20 updateSrc(); |
| 21 }, false); |
| 22 addEventListener("load", function() { |
| 23 shouldBeTrue('document.getElementById("foo").clientWidth==200'); |
| 24 }, false); |
| 25 </script> |
| 26 </head> |
| 27 <body id="body"> |
| 28 <div>This test passes if this img tag below is a green square. It ensures th
at attributes can be removed dynamically from javascript</div> |
| 29 <img id="foo" src="resources/blue-100-px-square.png" srcset="resources/green
-200-px-square.png 2x"> |
| 30 </body> |
| 31 </html> |
OLD | NEW |