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

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

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html
diff --git a/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html b/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html
new file mode 100644
index 0000000000000000000000000000000000000000..35c872d582f0a9aaac537da7ccb84a1be1c85ab9
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script>
+var jsTestIsAsync = true;
+var img;
+
+onload = function() {
+ var iframe = document.getElementById('frame');
+ var iframeDoc = iframe.contentWindow.document;
+
+ iframeDoc.body.innerHTML = '<img id="srcset" srcset="resources/blue_rect.jpg 90w, resources/image-set-4x.png 120w">';
+
+ img = iframeDoc.getElementById('srcset');
+
+ var first = true;
+ img.onload = function() {
+ if (first) {
+ first = false;
+ shouldNotBe('img.currentSrc.indexOf("blue_rect")', '-1');
+ iframe.style.width = '100px';
+ } else {
+ shouldNotBe('img.currentSrc.indexOf("image-set-4x")', '-1');
+ finishJSTest();
+ }
+ };
+ img.onerror = function() {
+ testFailed('Image should have loaded');
+ };
+}
+</script>
+
+<iframe id="frame" style="width: 80px;"></iframe>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698