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

Side by Side Diff: LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html

Issue 667763004: Srcset resource selection use a geometric mean to determine resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review nits Created 6 years, 2 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script> 3 <script>
4 var jsTestIsAsync = true; 4 var jsTestIsAsync = true;
5 var img; 5 var img;
6 6
7 onload = function() { 7 onload = function() {
8 var iframe = document.getElementById('frame'); 8 var iframe = document.getElementById('frame');
9 var iframeDoc = iframe.contentWindow.document; 9 var iframeDoc = iframe.contentWindow.document;
10 10
11 iframeDoc.body.innerHTML = '<img id="srcset" srcset="resources/blue_rect.jpg 90w, resources/image-set-4x.png 120w">'; 11 iframeDoc.body.innerHTML = '<img id="srcset" srcset="resources/blue_rect.jpg 90w, resources/image-set-4x.png 120w">';
12 12
13 img = iframeDoc.getElementById('srcset'); 13 img = iframeDoc.getElementById('srcset');
14 14
15 var first = true; 15 var first = true;
16 img.onload = function() { 16 img.onload = function() {
17 if (first) { 17 if (first) {
18 first = false; 18 first = false;
19 shouldNotBe('img.currentSrc.indexOf("blue_rect")', '-1'); 19 shouldNotBe('img.currentSrc.indexOf("blue_rect")', '-1');
20 iframe.style.width = '100px'; 20 iframe.style.width = '120px';
21 } else { 21 } else {
22 shouldNotBe('img.currentSrc.indexOf("image-set-4x")', '-1'); 22 shouldNotBe('img.currentSrc.indexOf("image-set-4x")', '-1');
23 finishJSTest(); 23 finishJSTest();
24 } 24 }
25 }; 25 };
26 img.onerror = function() { 26 img.onerror = function() {
27 testFailed('Image should have loaded'); 27 testFailed('Image should have loaded');
28 }; 28 };
29 } 29 }
30 </script> 30 </script>
31 31
32 <iframe id="frame" style="width: 80px;"></iframe> 32 <iframe id="frame" style="width: 80px;"></iframe>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLImageElement/image-sizes-1x.html ('k') | Source/core/html/parser/HTMLSrcsetParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698