Bug 1503653 - Part 2. Enable WebP by default. r=tnikkel
authorAndrew Osmond <aosmond@mozilla.com>
Tue, 09 Oct 2018 10:01:26 -0400
changeset 446579 f8fefc9626c12c7e3f48bdd82baab9fc4edec345
parent 446578 0fff097ac71669d4f1a48b1d460892d5c5669aa0
child 446580 0e459cfc0d2ade802b05fc2ed591bf3a5cb527f7
push id35045
push userncsoregi@mozilla.com
push dateThu, 15 Nov 2018 22:10:12 +0000
treeherdermozilla-central@0051c8d339a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1503653, 1249474
milestone65.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 1503653 - Part 2. Enable WebP by default. r=tnikkel Bug 1249474 suggested that we add image/webp to the front of the Accept header for images, to indicate to servers that we actually support WebP. Differential Revision: https://phabricator.services.mozilla.com/D8120
image/test/mochitest/bug496292-1.sjs
modules/libpref/init/all.js
--- a/image/test/mochitest/bug496292-1.sjs
+++ b/image/test/mochitest/bug496292-1.sjs
@@ -4,17 +4,17 @@ function handleRequest(request, response
              .getService(Components.interfaces.nsIProperties)
              .get("CurWorkD", Components.interfaces.nsIFile);
 
   file.append("tests");
   file.append("image");
   file.append("test");
   file.append("mochitest");
 
-  if (request.getHeader("Accept") == "*/*") {
+  if (request.getHeader("Accept") == "image/webp,*/*") {
     file.append('blue.png');
   } else {
     file.append('red.png');
   }
   response.setStatusLine(request.httpVersion, 200, "OK");
   response.setHeader("Content-Type", "image/png", false);
   response.setHeader("Cache-Control", "no-cache", false);
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4702,17 +4702,17 @@ pref("image.cache.timeweight", 500);
 
 // Decode all images automatically on load, ignoring our normal heuristics.
 pref("image.decode-immediately.enabled", false);
 
 // Whether we attempt to downscale images during decoding.
 pref("image.downscale-during-decode.enabled", true);
 
 // The default Accept header sent for images loaded over HTTP(S)
-pref("image.http.accept", "*/*");
+pref("image.http.accept", "image/webp,*/*");
 
 // The threshold for inferring that changes to an <img> element's |src|
 // attribute by JavaScript represent an animation, in milliseconds. If the |src|
 // attribute is changing more frequently than this value, then we enter a
 // special "animation mode" which is designed to eliminate flicker. Set to 0 to
 // disable.
 pref("image.infer-src-animation.threshold-ms", 2000);
 
@@ -4785,17 +4785,17 @@ pref("image.mem.volatile.min_threshold_k
 // How many threads we'll use for multithreaded decoding. If < 0, will be
 // automatically determined based on the system's number of cores.
 pref("image.multithreaded_decoding.limit", -1);
 
 // How long in ms before we should start shutting down idle decoder threads.
 pref("image.multithreaded_decoding.idle_timeout", 600000);
 
 // Whether we attempt to decode WebP images or not.
-pref("image.webp.enabled", false);
+pref("image.webp.enabled", true);
 
 // Limit for the canvas image cache. 0 means we don't limit the size of the
 // cache.
 pref("canvas.image.cache.limit", 0);
 
 // WebGL prefs
 #ifdef ANDROID
 // Disable MSAA on mobile.