Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: LayoutTests/fast/dom/HTMLImageElement/image-picture-nested.html

Issue 288033018: Add HTMLPictureElement-based source selection to HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review nits Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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("picture_in_picture").clientWidth', '8 00');
11 shouldBe('document.getElementById("picture_in_picture").currentSrc', '". ./../hidpi/resources/image-set-2x.png?2"');
12 shouldBe('document.getElementById("picture_in_div_in_picture").clientWid th', '800');
13 shouldBe('document.getElementById("picture_in_div_in_picture").currentSr c', '"../../hidpi/resources/image-set-2x.png?2"');
14 shouldBe('document.getElementById("picture_in_div_with_source_above").cl ientWidth', '800');
15 shouldBe('document.getElementById("picture_in_div_with_source_above").cu rrentSrc', '"../../hidpi/resources/image-set-2x.png?2"');
16 shouldBe('document.getElementById("picture_in_the_way").clientWidth', '8 00');
17 shouldBe('document.getElementById("picture_in_the_way").currentSrc', '". ./../hidpi/resources/image-set-2x.png?2"');
18 shouldBe('document.getElementById("picture_in_picture_1").clientWidth', '800');
19 shouldBe('document.getElementById("picture_in_picture_1").currentSrc', ' "../../hidpi/resources/image-set-2x.png?2"');
20 shouldBe('document.getElementById("picture_in_picture_2").clientWidth', '800');
21 shouldBe('document.getElementById("picture_in_picture_2").currentSrc', ' "../../hidpi/resources/image-set-2x.png?2"');
22 shouldBe('document.getElementById("picture_at_end").clientWidth', '75');
23 shouldBe('document.getElementById("picture_at_end").currentSrc', '"resou rces/blue_rect.jpg?52"');
24 shouldBe('document.getElementById("picture_no_source").clientWidth', '75 ');
25 shouldBe('document.getElementById("picture_no_source").currentSrc', '"re sources/blue_rect.jpg?6"');
26 }, false);
27 </script>
28 <!-- A canary image to see that the test is actually working -->
29 <img id="canary" src="resources/blue_rect.jpg?0">
30 <!-- nested element tests -->
31 <picture>
32 <picture>
33 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4 00w, ../../hidpi/resources/image-set-2x.png?2 800w,
34 resources/image-set-4x.png?2 1600w">
35 <img id="picture_in_picture" src="resources/blue_rect.jpg?1">
36 </picture>
37 </picture>
38 <picture>
39 <div>
40 <picture>
41 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png ?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
42 resources/image-set-4x.png?2 1600w">
43 <img id="picture_in_div_in_picture" src="resources/blue_rect.jpg?2">
44 </picture>
45 </div>
46 </picture>
47 <picture>
48 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
49 resources/image-set-4x.png?2 1600w">
50 <div>
51 <picture>
52 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png ?2 400w, ../../hidpi/resources/image-set-2x.png?2 800w,
53 resources/image-set-4x.png?2 1600w">
54 <img id="picture_in_div_with_source_above" src="resources/blue_rect. jpg?4">
55 </picture>
56 </div>
57 <img id="picture_in_the_way" src="resources/blue_rect.jpg?4">
58 </picture>
59 <picture>
60 <picture>
61 <source sizes="800px" srcset="../../hidpi/resources/image-set-1x.png?2 4 00w, ../../hidpi/resources/image-set-2x.png?2 800w,
62 resources/image-set-4x.png?2 1600w">
63 <img id="picture_in_picture_1" src="resources/blue_rect.jpg?5">
64 <img id="picture_in_picture_2" src="resources/blue_rect.jpg?51">
65 </picture>
66 <img id="picture_at_end" src="resources/blue_rect.jpg?52">
67 </picture>
68 <picture>
69 <img id="picture_no_source" src="resources/blue_rect.jpg?6">
70 </picture>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698