OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <script src="resources/currentSrcHelper.js"></script> | 3 <script src="resources/currentSrcHelper.js"></script> |
4 <script> | 4 <script> |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 addEventListener("load", function() { | 8 addEventListener("load", function() { |
9 shouldBe('document.getElementById("canary").clientWidth', '75'); | 9 shouldBe('document.getElementById("canary").clientWidth', '75'); |
10 shouldBe('currentSrcFileName("canary")', '"blue_rect.jpg?0"'); | 10 shouldBe('currentSrcFileName("canary")', '"blue_rect.jpg?0"'); |
11 shouldBe('document.getElementById("simple").clientWidth', '800'); | 11 shouldBe('document.getElementById("simple").clientWidth', '800'); |
12 shouldBe('currentSrcFileName("simple")', '"image-set-2x.png?2"'); | 12 shouldBe('currentSrcFileName("simple")', '"image-set-2x.png?2"'); |
13 shouldBe('document.getElementById("multiple").clientWidth', '800'); | 13 shouldBe('document.getElementById("multiple").clientWidth', '800'); |
14 shouldBe('currentSrcFileName("multiple")', '"image-set-2x.png?2"'); | 14 shouldBe('currentSrcFileName("multiple")', '"image-set-2x.png?2"'); |
15 shouldBe('document.getElementById("other_children").clientWidth', '800')
; | 15 shouldBe('document.getElementById("other_children").clientWidth', '800')
; |
16 shouldBe('currentSrcFileName("other_children")', '"image-set-2x.png?2"')
; | 16 shouldBe('currentSrcFileName("other_children")', '"image-set-2x.png?2"')
; |
17 shouldBe('document.getElementById("img_before_source").clientWidth', '75
'); | 17 shouldBe('document.getElementById("img_before_source").clientWidth', '75
'); |
18 shouldBe('currentSrcFileName("img_before_source")', '"blue_rect.jpg?1"')
; | 18 shouldBe('currentSrcFileName("img_before_source")', '"blue_rect.jpg?1"')
; |
19 shouldBe('document.getElementById("unknown_type").clientWidth', '1600'); | 19 shouldBe('document.getElementById("unknown_type").clientWidth', '1600'); |
20 shouldBe('currentSrcFileName("unknown_type")', '"image-set-4x.png?3"'); | 20 shouldBe('currentSrcFileName("unknown_type")', '"image-set-4x.png?3"'); |
| 21 shouldBe('document.getElementById("svg_type").clientWidth', '800'); |
| 22 shouldBe('currentSrcFileName("svg_type")', '"image-set-2x.png?2"'); |
21 shouldBe('document.getElementById("empty_srcset").clientWidth', '1600'); | 23 shouldBe('document.getElementById("empty_srcset").clientWidth', '1600'); |
22 shouldBe('currentSrcFileName("empty_srcset")', '"image-set-4x.png?3"'); | 24 shouldBe('currentSrcFileName("empty_srcset")', '"image-set-4x.png?3"'); |
23 shouldBe('document.getElementById("no_srcset").clientWidth', '1600'); | 25 shouldBe('document.getElementById("no_srcset").clientWidth', '1600'); |
24 shouldBe('currentSrcFileName("no_srcset")', '"image-set-4x.png?3"'); | 26 shouldBe('currentSrcFileName("no_srcset")', '"image-set-4x.png?3"'); |
25 }, false); | 27 }, false); |
26 </script> | 28 </script> |
27 <!-- A canary image to see that the test is actually working --> | 29 <!-- A canary image to see that the test is actually working --> |
28 <img id="canary" src="resources/blue_rect.jpg?0"> | 30 <img id="canary" src="resources/blue_rect.jpg?0"> |
29 <!-- simple picture construct --> | 31 <!-- simple picture construct --> |
30 <picture> | 32 <picture> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 <!-- source with unknown type - should be ignored --> | 73 <!-- source with unknown type - should be ignored --> |
72 <picture> | 74 <picture> |
73 <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, | 75 <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, |
74 resources/image-set-4x.png?1 1600w"> | 76 resources/image-set-4x.png?1 1600w"> |
75 <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, | 77 <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, |
76 resources/image-set-4x.png?2 1600w"> | 78 resources/image-set-4x.png?2 1600w"> |
77 <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, | 79 <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, |
78 resources/image-set-4x.png?3 1600w"> | 80 resources/image-set-4x.png?3 1600w"> |
79 <img id="unknown_type" src="resources/blue_rect.jpg?1"> | 81 <img id="unknown_type" src="resources/blue_rect.jpg?1"> |
80 </picture> | 82 </picture> |
| 83 <!-- SVG source - should not be ignored --> |
| 84 <picture> |
| 85 <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, |
| 86 resources/image-set-4x.png?1 1600w"> |
| 87 <source media="(max-width: 800px)" type="image/svg+xml" sizes="800px" srcset
="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set
-2x.png?2 800w, |
| 88 resources/image-set-4x.png?2 1600w"> |
| 89 <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, |
| 90 resources/image-set-4x.png?3 1600w"> |
| 91 <img id="svg_type" src="resources/blue_rect.jpg?1"> |
| 92 </picture> |
81 <!-- source with empty srcset - should be ignored --> | 93 <!-- source with empty srcset - should be ignored --> |
82 <picture> | 94 <picture> |
83 <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, | 95 <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, |
84 resources/image-set-4x.png?1 1600w"> | 96 resources/image-set-4x.png?1 1600w"> |
85 <source media="(max-width: 800px)" sizes="800px" srcset=", , "> | 97 <source media="(max-width: 800px)" sizes="800px" srcset=", , "> |
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, | 98 <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"> | 99 resources/image-set-4x.png?3 1600w"> |
88 <img id="empty_srcset" src="resources/blue_rect.jpg?1"> | 100 <img id="empty_srcset" src="resources/blue_rect.jpg?1"> |
89 </picture> | 101 </picture> |
90 <!-- source with no srcset - should be ignored --> | 102 <!-- source with no srcset - should be ignored --> |
91 <picture> | 103 <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, | 104 <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"> | 105 resources/image-set-4x.png?1 1600w"> |
94 <source media="(max-width: 800px)" sizes="800px"> | 106 <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, | 107 <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"> | 108 resources/image-set-4x.png?3 1600w"> |
97 <img id="no_srcset" src="resources/blue_rect.jpg?1"> | 109 <img id="no_srcset" src="resources/blue_rect.jpg?1"> |
98 </picture> | 110 </picture> |
OLD | NEW |