Bug 1023516 - Basic image srcset reftests r=jst
authorJohn Schoenick <jschoenick@mozilla.com>
Tue, 30 Sep 2014 15:34:58 -0700
changeset 238738 60ce1e142f90447d72f6455899f953b05198132d
parent 238737 9b7fce122203cfc5335ef009fdb22d389f3e282b
child 238739 bf4e259a4609cfd2e46ee8895e18c8b12cccad59
push id660
push userraliiev@mozilla.com
push dateWed, 18 Feb 2015 20:30:48 +0000
treeherdermozilla-release@49e493494178 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1023516
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1023516 - Basic image srcset reftests r=jst
layout/reftests/image/100.png
layout/reftests/image/200.png
layout/reftests/image/300.png
layout/reftests/image/400.png
layout/reftests/image/50.png
layout/reftests/image/500.svg
layout/reftests/image/image-srcset-basic-selection-0.1x-ref.html
layout/reftests/image/image-srcset-basic-selection-0.1x.html
layout/reftests/image/image-srcset-basic-selection-0.5x-ref.html
layout/reftests/image/image-srcset-basic-selection-0.5x.html
layout/reftests/image/image-srcset-basic-selection-0.6x-ref.html
layout/reftests/image/image-srcset-basic-selection-0.6x.html
layout/reftests/image/image-srcset-basic-selection-1.5x-ref.html
layout/reftests/image/image-srcset-basic-selection-1.5x.html
layout/reftests/image/image-srcset-basic-selection-1x-ref.html
layout/reftests/image/image-srcset-basic-selection-1x.html
layout/reftests/image/image-srcset-basic-selection-2x-ref.html
layout/reftests/image/image-srcset-basic-selection-2x.html
layout/reftests/image/image-srcset-basic-selection-width-0.5x-ref.html
layout/reftests/image/image-srcset-basic-selection-width-0.5x.html
layout/reftests/image/image-srcset-basic-selection-width-10x-ref.html
layout/reftests/image/image-srcset-basic-selection-width-10x.html
layout/reftests/image/image-srcset-basic-selection-width-1x-ref.html
layout/reftests/image/image-srcset-basic-selection-width-1x.html
layout/reftests/image/image-srcset-basic-selection-width-2x-ref.html
layout/reftests/image/image-srcset-basic-selection-width-2x.html
layout/reftests/image/image-srcset-default-1x-ref.html
layout/reftests/image/image-srcset-default-1x.html
layout/reftests/image/image-srcset-default-2x-ref.html
layout/reftests/image/image-srcset-default-2x.html
layout/reftests/image/image-srcset-default-src-1x-ref.html
layout/reftests/image/image-srcset-default-src-1x.html
layout/reftests/image/image-srcset-default-src-2x-ref.html
layout/reftests/image/image-srcset-default-src-2x.html
layout/reftests/image/image-srcset-orientation-1x-ref.html
layout/reftests/image/image-srcset-orientation-1x.html
layout/reftests/image/image-srcset-orientation-2x-ref.html
layout/reftests/image/image-srcset-orientation-2x.html
layout/reftests/image/image-srcset-svg-1x-ref.html
layout/reftests/image/image-srcset-svg-1x.html
layout/reftests/image/image-srcset-svg-2x-ref.html
layout/reftests/image/image-srcset-svg-2x.html
layout/reftests/image/image-srcset-svg-3x-ref.html
layout/reftests/image/image-srcset-svg-3x.html
layout/reftests/image/image-srcset-svg-default-1x-ref.html
layout/reftests/image/image-srcset-svg-default-1x.html
layout/reftests/image/image-srcset-svg-default-2x-ref.html
layout/reftests/image/image-srcset-svg-default-2x.html
layout/reftests/image/no-intrinsic-size.svg
layout/reftests/image/reftest.list
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..df421453c25631353cfe86bde5973fdca15b1ea9
GIT binary patch
literal 91
zc%17D@N?(olHy`uVBq!ia0vp^DIm<q3?#jD*u{YqbAV5XtC5k>QX|f*K(4T-i(`m{
lWU>V7;slYNra*^q1_ss&2F5$COwvGU22WQ%mvv4FO#rqO5n=!U
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6f76d4438724111983a11860f13568361b52d9bc
GIT binary patch
literal 100
zc%17D@N?(olHy`uVBq!ia0vp^CqS5y8Awi_W^)%vF$egBxTd6}EPfSw1jv=~ba4!k
rkbHZv5y)XUyx@1R|3ikWAU1;^qeuV)<1IPC3=q%L)z4*}Q$iB}r??p{
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c12b7ceea1ccd4d2f9bf6458f1f030a31db303fa
GIT binary patch
literal 106
zc%17D@N?(olHy`uVBq!ia0y~yVAKI&MrNRh^JW<{AjKTu6XH5;+O&kpk4k}DB~KT}
s5DCe*2Mrm4yh94Vm&bA0Comwu9Twd!42+XI+gw0APgg&ebxsLQ0AmIhLI3~&
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8855fc6d46684e8235c18be11183ea7f4b0e8e05
GIT binary patch
literal 114
zc%17D@N?(olHy`uVBq!ia0y~yV4MKLjLblhU4={fffRFqPl)S@6DQV1y?qAcYI(Xi
thDb=hJ=h53FdSa+JDC3g*Hs2g&>-x;fq{|9sA(mL=jrO_vd$@?2>=U%8r%Q?
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..144a2f0b93c5913872f30056999da000ae6049cd
GIT binary patch
literal 85
zc%17D@N?(olHy`uVBq!ia0vp^Mj*_{3?x-PN__%S%mF?ju9A|H-p`i&1*>y$43Usb
dmSAlLYGa(hz<BW6Dm$PAgQu&X%Q~loCIF<=5=;O9
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/500.svg
@@ -0,0 +1,9 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg" width="500px" height="500px">
+
+<title>Simple SVG with 500x500 intrinsic size</title>
+  <rect x1="0" y1="0" width="100%" height="100%" fill="lime"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.1">
+<head>
+
+</head>
+<body>
+  <img src="50.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.5x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.5">
+<head>
+
+</head>
+<body>
+  <img src="50.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.5x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.5" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.6x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.6">
+<head>
+
+</head>
+<body>
+  <img src="100.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-0.6x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.6" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-1.5x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1.5">
+<head>
+
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-1.5x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1.5" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+
+</head>
+<body>
+  <img src="100.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png">
+  <p>Test basic loading of sourceset at different resolutions, including proper intrinsic size selection</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-0.5x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.5">
+<head>
+    <style>img { width: 50px; }</style>
+</head>
+<body>
+  <img src="50.png" width="50">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-0.5x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="0.5" class="reftest-wait">
+<head>
+    <style>img { width: 50px; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png" width="1000">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-10x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="10">
+<head>
+    <style>img { width: 50px; }</style>
+</head>
+<body>
+  <img src="300.png" width="50">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-10x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="10" class="reftest-wait">
+<head>
+    <style>img { width: 50px; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png" width="1000">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+    <style>img { width: 50px; }</style>
+</head>
+<body>
+  <img src="100.png" width="50">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+    <style>img { width: 50px; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png" width="1000">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+    <style>img { width: 50px; }</style>
+</head>
+<body>
+  <img src="200.png" width="50">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-basic-selection-width-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+    <style>img { width: 50px; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png" width="1000">
+  <p>Ensure that width is honored and does not affect selection process</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+
+</head>
+<body>
+  <img src="100.png" width="100">
+  <p>Test default source in sourceset, src should be ignored</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x, 100.png" src="50.png">
+  <p>Test default source in sourceset, src should be ignored</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Test default source in sourceset, src should be ignored</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x, 100.png" src="50.png">
+  <p>Test default source in sourceset, src should be ignored</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-src-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+
+</head>
+<body>
+  <img src="50.png" width="50">
+  <p>Test default source provided in src, with no default/1x in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-src-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="50.png">
+  <p>Test default source provided in src, with no default/1x in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-src-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Test default source provided in src, with no default/1x in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-default-src-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="50.png">
+  <p>Test default source provided in src, with no default/1x in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-orientation-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+    <style>img { image-orientation: 90deg flip; }</style>
+</head>
+<body>
+  <img src="100.png" width="100">
+  <p>Make sure orientation is respected when using both srcset and fallback-src selections</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-orientation-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+    <style>img { image-orientation: 90deg flip; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="100.png">
+  <p>Make sure orientation is respected when using both srcset and fallback-src selections</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-orientation-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+    <style>img { image-orientation: 90deg flip; }</style>
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Make sure orientation is respected when using both srcset and fallback-src selections</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-orientation-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+    <style>img { image-orientation: 90deg flip; }</style>
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="100.png">
+  <p>Make sure orientation is respected when using both srcset and fallback-src selections</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+
+</head>
+<body>
+  <img src="50.png" width="50">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="500.svg 2x, no-intrinsic-size.svg 3x" src="50.png">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+
+</head>
+<body>
+  <img src="500.svg" width="250">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="500.svg 2x, no-intrinsic-size.svg 3x" src="50.png">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-3x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="3">
+<head>
+
+</head>
+<body>
+  <img src="no-intrinsic-size.svg">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-3x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="3" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="500.svg 2x, no-intrinsic-size.svg 3x" src="50.png">
+  <p>Test that svgs work as expected in srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-default-1x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1">
+<head>
+
+</head>
+<body>
+  <img src="no-intrinsic-size.svg">
+  <p>Test that svgs work as expected as the fallback from a srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-default-1x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="1" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="no-intrinsic-size.svg">
+  <p>Test that svgs work as expected as the fallback from a srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-default-2x-ref.html
@@ -0,0 +1,11 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2">
+<head>
+
+</head>
+<body>
+  <img src="200.png" width="100">
+  <p>Test that svgs work as expected as the fallback from a srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/image-srcset-svg-default-2x.html
@@ -0,0 +1,26 @@
+
+<!DOCTYPE html>
+<html reftest-zoom="2" class="reftest-wait">
+<head>
+
+    <script type="application/javascript">
+    // reftest-zoom is only applied at onload, so ensure the source-selection
+    // has happened after that
+    function clearWait() {
+      document.documentElement.classList.remove("reftest-wait");
+    }
+    window.addEventListener("load", function() {
+      setTimeout(function() {
+        var img = document.querySelector("img");
+        img.onload = clearWait;
+        img.onerror = clearWait;
+        img.src = img.src;
+      }, 0);
+    });
+  </script>
+</head>
+<body>
+  <img srcset="200.png 2x" src="no-intrinsic-size.svg">
+  <p>Test that svgs work as expected as the fallback from a srcset</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/image/no-intrinsic-size.svg
@@ -0,0 +1,9 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg" >
+
+<title>Simple SVG with no intrinsic size</title>
+  <rect x1="0" y1="0" width="100%" height="100%" fill="lime"/>
+</svg>
--- a/layout/reftests/image/reftest.list
+++ b/layout/reftests/image/reftest.list
@@ -87,8 +87,31 @@ fuzzy(1,1) == image-orientation-backgrou
 != image-orientation-generated-content-ref.html?90   image-orientation-generated-content-ref.html?180
 != image-orientation-generated-content-ref.html?90   image-orientation-generated-content-ref.html?270
 != image-orientation-generated-content-ref.html?180  image-orientation-generated-content-ref.html?270
 != image-orientation-generated-content-ref.html?0    image-orientation-generated-content-ref.html?0&flip
 != image-orientation-generated-content-ref.html?90   image-orientation-generated-content-ref.html?90&flip
 != image-orientation-generated-content-ref.html?180  image-orientation-generated-content-ref.html?180&flip
 != image-orientation-generated-content-ref.html?270  image-orientation-generated-content-ref.html?270&flip
 == image-orientation-dynamic.html image-orientation-dynamic-ref.html
+
+# <img srcset> tests
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-0.1x.html image-srcset-basic-selection-0.1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-2x.html image-srcset-basic-selection-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-0.5x.html image-srcset-basic-selection-0.5x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-0.6x.html image-srcset-basic-selection-0.6x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-1.5x.html image-srcset-basic-selection-1.5x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-1x.html image-srcset-basic-selection-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-width-0.5x.html image-srcset-basic-selection-width-0.5x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-width-10x.html image-srcset-basic-selection-width-10x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-width-2x.html image-srcset-basic-selection-width-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-basic-selection-width-1x.html image-srcset-basic-selection-width-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-default-2x.html image-srcset-default-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-default-1x.html image-srcset-default-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-default-src-2x.html image-srcset-default-src-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-default-src-1x.html image-srcset-default-src-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-orientation-2x.html image-srcset-orientation-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-orientation-1x.html image-srcset-orientation-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-svg-3x.html image-srcset-svg-3x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-svg-2x.html image-srcset-svg-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-svg-1x.html image-srcset-svg-1x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-svg-default-2x.html image-srcset-svg-default-2x-ref.html
+pref(dom.image.srcset.enabled,true) == image-srcset-svg-default-1x.html image-srcset-svg-default-1x-ref.html