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

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

Issue 287163010: Notify <picture> elements when a media query (potentially) changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/hidpi/image-srcset-react-to-media-changes-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
Yoav Weiss 2014/07/02 18:46:05 Can you change the file name into saying "picture"
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 var jsTestIsAsync = true;
5 var img;
6
7 function runTest() {
8 var iframe = document.getElementById("f");
Yoav Weiss 2014/07/02 18:46:05 I think most layout tests have a 4 space indent.
9 var iframeDoc = iframe.contentWindow.document;
10
11 iframeDoc.body.innerHTML = '<picture id="pic">' +
12 '<source media="(max-width: 90px)" srcset="resources/blue-100-px-square.png" ></source>' +
13 '<source media="(max-width: 120px)" srcset="resources/green-400-px-square.pn g"></source>' +
14 '</picture>';
15
16 img = iframeDoc.createElement('img');
17
18 var first = true;
19 img.onload = function() {
20 if (first) {
21 shouldNotBe('-1', 'img.currentSrc.indexOf("green-400")');
22 iframe.style.width = "80px";
23 } else {
24 shouldNotBe('-1', 'img.currentSrc.indexOf("blue-100")');
25 finishJSTest();
26 }
27 first = false;
Yoav Weiss 2014/07/02 18:46:05 A nit, but the assignment to first can move up int
28 };
29 img.onerror = function() {
30 testFailed('Image should have loaded');
31 };
32 iframeDoc.getElementById('pic').appendChild(img);
33 }
34 </script>
35
36 <body onload="runTest()">
37 <iframe id="f" style="width: 100px;"></iframe>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/hidpi/image-srcset-react-to-media-changes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698