Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-picture-nested.html
blob5e9b7d4ab823cc7f684ee3cab992e0135a51b7d2
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/currentSrcHelper.js"></script>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 addEventListener("load", function() {
9 shouldBe('document.getElementById("canary").clientWidth', '75');
10 shouldBe('currentSrcFileName("canary")', '"blue_rect.jpg?0"');
11 shouldBe('document.getElementById("picture_in_picture").clientWidth', '800');
12 shouldBe('currentSrcFileName("picture_in_picture")', '"image-set-2x.png?2"');
13 shouldBe('document.getElementById("picture_in_div_in_picture").clientWidth', '800');
14 shouldBe('currentSrcFileName("picture_in_div_in_picture")', '"image-set-2x.png?2"');
15 shouldBe('document.getElementById("picture_in_div_with_source_above").clientWidth', '800');
16 shouldBe('currentSrcFileName("picture_in_div_with_source_above")', '"image-set-2x.png?2"');
17 shouldBe('document.getElementById("picture_in_the_way").clientWidth', '800');
18 shouldBe('currentSrcFileName("picture_in_the_way")', '"image-set-2x.png?2"');
19 shouldBe('document.getElementById("picture_in_picture_1").clientWidth', '800');
20 shouldBe('currentSrcFileName("picture_in_picture_1")', '"image-set-2x.png?2"');
21 shouldBe('document.getElementById("picture_in_picture_2").clientWidth', '800');
22 shouldBe('currentSrcFileName("picture_in_picture_2")', '"image-set-2x.png?2"');
23 shouldBe('document.getElementById("picture_at_end").clientWidth', '75');
24 shouldBe('currentSrcFileName("picture_at_end")', '"blue_rect.jpg?52"');
25 shouldBe('document.getElementById("picture_no_source").clientWidth', '75');
26 shouldBe('currentSrcFileName("picture_no_source")', '"blue_rect.jpg?6"');
27 }, false);
28 </script>
29 <!-- A canary image to see that the test is actually working -->
30 <img id="canary" src="resources/blue_rect.jpg?0">
31 <!-- nested element tests -->
32 <picture>
33 <picture>
34 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
35 resources/image-set-4x.png?2 1600w">
36 <img id="picture_in_picture" src="resources/blue_rect.jpg?1">
37 </picture>
38 </picture>
39 <picture>
40 <div>
41 <picture>
42 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
43 resources/image-set-4x.png?2 1600w">
44 <img id="picture_in_div_in_picture" src="resources/blue_rect.jpg?2">
45 </picture>
46 </div>
47 </picture>
48 <picture>
49 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
50 resources/image-set-4x.png?2 1600w">
51 <div>
52 <picture>
53 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
54 resources/image-set-4x.png?2 1600w">
55 <img id="picture_in_div_with_source_above" src="resources/blue_rect.jpg?4">
56 </picture>
57 </div>
58 <img id="picture_in_the_way" src="resources/blue_rect.jpg?4">
59 </picture>
60 <picture>
61 <picture>
62 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
63 resources/image-set-4x.png?2 1600w">
64 <img id="picture_in_picture_1" src="resources/blue_rect.jpg?5">
65 <img id="picture_in_picture_2" src="resources/blue_rect.jpg?51">
66 </picture>
67 <img id="picture_at_end" src="resources/blue_rect.jpg?52">
68 </picture>
69 <picture>
70 <img id="picture_no_source" src="resources/blue_rect.jpg?6">
71 </picture>