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

Side by Side Diff: LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change.html

Issue 236713005: Use SizesAttributeParser to get the right srcset resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sizes_parser8
Patch Set: Fixed nits Created 6 years, 8 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 <html>
2 <head>
3 <script src="../../hidpi/resources/srcset-helper.js"></script>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
8
9 function updateSrc() {
10 var img = document.getElementById("foo");
11 // sizes must be set first, then srcset must be set, the 'src'
12 // This will be fixed when image loading is done is "stable-state"
13 img.sizes = "400px";
14 img.srcset = "../../hidpi/resources/image-set-1x.png 200w, ../../hidpi/r esources/image-set-2x.png 400w, resources/image-set-4x.png 800w";
15 img.src = "resources/blue-100-px-square.png"
16 }
17
18 addEventListener("DOMContentLoaded", function() {
19 if (window.testRunner && sessionStorage.pageReloaded)
20 testRunner.dumpResourceRequestCallbacks();
21 updateSrc();
22 }, false);
23 addEventListener("load", function() {
24 shouldBe('document.getElementById("foo").currentSrc', '"resources/image- set-4x.png"');
25 }, false);
26 </script>
27 </head>
28
29 <body id="body">
30 <img id="foo">
31 </body>
32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698