OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script> |
| 4 if (window.testRunner) |
| 5 testRunner.dumpAsText(); |
| 6 |
| 7 addEventListener("load", function() { |
| 8 shouldBe('document.getElementById("canary").clientWidth', '75'); |
| 9 shouldBe('document.getElementById("canary").currentSrc', '"resources/blu
e_rect.jpg?0"'); |
| 10 shouldBe('document.getElementById("div_end_picture").clientWidth', '800'
); |
| 11 shouldBe('document.getElementById("div_end_picture").currentSrc', '"../.
./hidpi/resources/image-set-2x.png?2"'); |
| 12 shouldBe('document.getElementById("div_multiple_end").clientWidth', '800
'); |
| 13 shouldBe('document.getElementById("div_multiple_end").currentSrc', '"../
../hidpi/resources/image-set-2x.png?2"'); |
| 14 shouldBe('document.getElementById("source_in_div").clientWidth', '75'); |
| 15 shouldBe('document.getElementById("source_in_div").currentSrc', '"resour
ces/blue_rect.jpg"'); |
| 16 shouldBe('document.getElementById("not_in_picture").clientWidth', '75'); |
| 17 shouldBe('document.getElementById("not_in_picture").currentSrc', '"resou
rces/blue_rect.jpg"'); |
| 18 }, false); |
| 19 </script> |
| 20 <!-- A canary image to see that the test is actually working --> |
| 21 <img id="canary" src="resources/blue_rect.jpg?0"> |
| 22 <!-- Invalid nesting tests --> |
| 23 <!-- In the following tests, nesting shouldn't mess up the selection algorithm -
-> |
| 24 <picture> |
| 25 <picture> |
| 26 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4
00w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| 27 resources/image-set-4x.png?2 1600w"> |
| 28 <div> |
| 29 </picture> |
| 30 </div> |
| 31 <img id="div_end_picture" src="resources/blue_rect.jpg"> |
| 32 </picture> |
| 33 </picture> |
| 34 <picture> |
| 35 <div> |
| 36 </picture> |
| 37 </picture> |
| 38 </picture> |
| 39 </div> |
| 40 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w,
../../hidpi/resources/image-set-2x.png?2 800w, |
| 41 resources/image-set-4x.png?2 1600w"> |
| 42 <img id="div_multiple_end" src="resources/blue_rect.jpg"> |
| 43 </picture> |
| 44 <!-- In the following tests, nesting messes up the selection algorithm --> |
| 45 <picture> |
| 46 <div> |
| 47 <picture> |
| 48 <div> |
| 49 <source sizes="400px" srcset="resources/base-image1.png?4 200w,
resources/base-image3.png?4 400w, resources/base-image2.png?4 800w"> |
| 50 </div> |
| 51 <img id="source_in_div" src="resources/blue_rect.jpg"> |
| 52 </picture> |
| 53 </div> |
| 54 </picture> |
| 55 <picture> |
| 56 <div> |
| 57 <picture> |
| 58 <div> |
| 59 <source sizes="400px" srcset="resources/base-image1.png?5 200w,
resources/base-image3.png?5 400w, resources/base-image2.png?5 800w"> |
| 60 <img id="not_in_picture" src="resources/blue_rect.jpg"> |
| 61 </div> |
| 62 </picture> |
| 63 </div> |
| 64 </picture> |
OLD | NEW |