Bug 1673785 - Tweak lazy-loading root margin default to be 300px in all directions. r=hiro
☠☠ backed out by 9d4423386444 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 28 Oct 2020 02:53:54 +0000
changeset 554823 9836b528717f4b4bcd776cfab3062e4082c50e02
parent 554822 ae315341bc721084298fd39f6669bc47456a0fc5
child 554824 37a30c6f61c11b18b42f45072b25c68996f5efa8
push id37898
push userabutkovits@mozilla.com
push dateWed, 28 Oct 2020 09:24:21 +0000
treeherdermozilla-central@83bf4fd3b1fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1673785
milestone84.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 1673785 - Tweak lazy-loading root margin default to be 300px in all directions. r=hiro This is better than 0px and such, while we wait for feedback from the perf team. Differential Revision: https://phabricator.services.mozilla.com/D94927
layout/base/tests/chrome/printpreview_helper.xhtml
modules/libpref/init/StaticPrefList.yaml
--- a/layout/base/tests/chrome/printpreview_helper.xhtml
+++ b/layout/base/tests/chrome/printpreview_helper.xhtml
@@ -101,18 +101,27 @@ function exitprintpreview() {
   gPrintPreviewWindow.close();
 }
 
 function finish() {
   SimpleTest.finish();
   window.close();
 }
 
-function runTests()
+async function runTests()
 {
+  // This ensures we actually test the lazy-load of images in printpreview_images.
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      ["dom.image-lazy-loading.root-margin.top", 0],
+      ["dom.image-lazy-loading.root-margin.bottom", 0],
+      ["dom.image-lazy-loading.root-margin.left", 0],
+      ["dom.image-lazy-loading.root-margin.right", 0],
+    ],
+  });
   startTest1();
 }
 
 function compareCanvases(options = {}) {
   const canvas1 = document.getElementsByTagName("canvas")[0];
   const canvas2 = document.getElementsByTagName("canvas")[1];
   let maxDifference = {};
   const differingPixels = window.windowUtils.compareCanvases(canvas1, canvas2, maxDifference);
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -1814,47 +1814,47 @@
 
 # The root margin for image lazy loading, defined as four (value, percentage)
 # pairs.
 #
 # (0px, 0px, 0px, 0px) by default, for now. We could also consider an
 # adaptative version of this.
 - name: dom.image-lazy-loading.root-margin.top
   type: float
-  value: 0
+  value: 300
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.top.percentage
   type: bool
   value: false
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.bottom
   type: float
-  value: 0
+  value: 300
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.bottom.percentage
   type: bool
   value: false
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.left
   type: float
-  value: 0
+  value: 300
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.left.percentage
   type: bool
   value: false
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.right
   type: float
-  value: 0
+  value: 300
   mirror: always
 
 - name: dom.image-lazy-loading.root-margin.right.percentage
   type: bool
   value: false
   mirror: always
 
 # Enable passing the "storage" option to indexedDB.open.