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("simple").clientWidth', '800'); |
| 11 shouldBe('document.getElementById("simple").currentSrc', '"../../hidpi/r
esources/image-set-2x.png?2"'); |
| 12 shouldBe('document.getElementById("multiple").clientWidth', '800'); |
| 13 shouldBe('document.getElementById("multiple").currentSrc', '"../../hidpi
/resources/image-set-2x.png?2"'); |
| 14 shouldBe('document.getElementById("other_children").clientWidth', '800')
; |
| 15 shouldBe('document.getElementById("other_children").currentSrc', '"../..
/hidpi/resources/image-set-2x.png?2"'); |
| 16 shouldBe('document.getElementById("img_before_source").clientWidth', '75
'); |
| 17 shouldBe('document.getElementById("img_before_source").currentSrc', '"re
sources/blue_rect.jpg?1"'); |
| 18 shouldBe('document.getElementById("unknown_type").clientWidth', '1600'); |
| 19 shouldBe('document.getElementById("unknown_type").currentSrc', '"resourc
es/image-set-4x.png?3"'); |
| 20 shouldBe('document.getElementById("empty_srcset").clientWidth', '1600'); |
| 21 shouldBe('document.getElementById("empty_srcset").currentSrc', '"resourc
es/image-set-4x.png?3"'); |
| 22 shouldBe('document.getElementById("no_srcset").clientWidth', '1600'); |
| 23 shouldBe('document.getElementById("no_srcset").currentSrc', '"resources/
image-set-4x.png?3"'); |
| 24 }, false); |
| 25 </script> |
| 26 <!-- A canary image to see that the test is actually working --> |
| 27 <img id="canary" src="resources/blue_rect.jpg?0"> |
| 28 <!-- simple picture construct --> |
| 29 <picture> |
| 30 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 31 resources/image-set-4x.png?1 1600w"> |
| 32 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resourc
es/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| 33 resources/image-set-4x.png?2 1600w"> |
| 34 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 35 resources/image-set-4x.png?3 1600w"> |
| 36 <img id="simple" src="resources/blue_rect.jpg?1"> |
| 37 </picture> |
| 38 <!-- Multiple img elements --> |
| 39 <picture> |
| 40 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 41 resources/image-set-4x.png?1 1600w"> |
| 42 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resourc
es/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| 43 resources/image-set-4x.png?2 1600w"> |
| 44 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 45 resources/image-set-4x.png?3 1600w"> |
| 46 <img src="resources/blue_rect.jpg?1"> |
| 47 <img id="multiple" src="resources/blue_rect.jpg?1"> |
| 48 </picture> |
| 49 <!-- non-source children - should be ignored--> |
| 50 <picture> |
| 51 <div>some text</div> |
| 52 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 53 resources/image-set-4x.png?1 1600w"> |
| 54 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resourc
es/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| 55 resources/image-set-4x.png?2 1600w"> |
| 56 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 57 resources/image-set-4x.png?3 1600w"> |
| 58 <img id="other_children" src="resources/blue_rect.jpg?1"> |
| 59 </picture> |
| 60 <!-- img before its source siblings - should ignore its siblings --> |
| 61 <picture> |
| 62 <img id="img_before_source" src="resources/blue_rect.jpg?1"> |
| 63 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 64 resources/image-set-4x.png?1 1600w"> |
| 65 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resourc
es/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w, |
| 66 resources/image-set-4x.png?2 1600w"> |
| 67 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 68 resources/image-set-4x.png?3 1600w"> |
| 69 </picture> |
| 70 <!-- source with unknown type - should be ignored --> |
| 71 <picture> |
| 72 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 73 resources/image-set-4x.png?1 1600w"> |
| 74 <source media="(max-width: 800px)" type="image/jp2" sizes="800px" srcset="..
/../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.
png?2 800w, |
| 75 resources/image-set-4x.png?2 1600w"> |
| 76 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 77 resources/image-set-4x.png?3 1600w"> |
| 78 <img id="unknown_type" src="resources/blue_rect.jpg?1"> |
| 79 </picture> |
| 80 <!-- source with empty srcset - should be ignored --> |
| 81 <picture> |
| 82 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 83 resources/image-set-4x.png?1 1600w"> |
| 84 <source media="(max-width: 800px)" sizes="800px" srcset="../../hidpi/resourc
es/image-set-1x.png?2 400r, ../../hidpi/resources/image-set-2x.png?2 800r, |
| 85 resources/image-set-4x.png?2 1600r"> |
| 86 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 87 resources/image-set-4x.png?3 1600w"> |
| 88 <img id="empty_srcset" src="resources/blue_rect.jpg?1"> |
| 89 </picture> |
| 90 <!-- source with no srcset - should be ignored --> |
| 91 <picture> |
| 92 <source media="(max-width: 400px)" sizes="400px" srcset="../../hidpi/resourc
es/image-set-1x.png?1 400w, ../../hidpi/resources/image-set-2x.png?1 800w, |
| 93 resources/image-set-4x.png?1 1600w"> |
| 94 <source media="(max-width: 800px)" sizes="800px"> |
| 95 <source media="(max-width: 1600px)" sizes="1600px" srcset="../../hidpi/resou
rces/image-set-1x.png?3 400w, ../../hidpi/resources/image-set-2x.png?3 800w, |
| 96 resources/image-set-4x.png?3 1600w"> |
| 97 <img id="no_srcset" src="resources/blue_rect.jpg?1"> |
| 98 </picture> |
OLD | NEW |