Bug 1387783 - Add lazy browser shims for fullZoom and textZoom. r=kevinjones
authorDão Gottwald <dao@mozilla.com>
Wed, 09 Aug 2017 10:24:31 +0200
changeset 373575 9bbc4ded4bae72ab90962eb24c07310f63e24568
parent 373573 9031387c7ef1fe1db4b68495d1527b56e464c817
child 373576 56872eb4e342150fddb7ae82b5c7156f07642a51
push id32305
push userryanvm@gmail.com
push dateWed, 09 Aug 2017 22:43:53 +0000
treeherdermozilla-central@411fe4772f31 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskevinjones
bugs1387783
milestone57.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 1387783 - Add lazy browser shims for fullZoom and textZoom. r=kevinjones MozReview-Commit-ID: 9AH0KT1BWF5
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2214,92 +2214,78 @@
             let names = this._browserBindingProperties;
 
             for (let i = 0; i < names.length; i++) {
               let name = names[i];
               let getter;
               let setter;
               switch (name) {
                 case "audioMuted":
-                  getter = () => {
-                    return false;
-                  };
+                  getter = () => false;
                   break;
                 case "contentTitle":
-                  getter = () => {
-                    return SessionStore.getLazyTabValue(aTab, "title");
-                  };
+                  getter = () => SessionStore.getLazyTabValue(aTab, "title");
                   break;
                 case "currentURI":
                   getter = () => {
                     let url = SessionStore.getLazyTabValue(aTab, "url");
                     return Services.io.newURI(url);
                   };
                   break;
+                case "fullZoom":
+                case "textZoom":
+                  getter = () => 1;
+                  break;
                 case "getTabBrowser":
-                  getter = () => {
-                    return () => {
-                      return this;
-                    };
-                  };
+                  getter = () => () => this;
                   break;
                 case "isRemoteBrowser":
-                  getter = () => {
-                    return browser.getAttribute("remote") == "true";
-                  };
+                  getter = () => browser.getAttribute("remote") == "true";
                   break;
                 case "permitUnload":
-                  getter = () => {
-                    return () => {
-                      return { permitUnload: true, timedOut: false };
-                    };
-                  };
+                  getter = () => () => ({ permitUnload: true, timedOut: false });
                   break;
                 case "reload":
                 case "reloadWithFlags":
-                  getter = () => {
-                    return (params) => {
+                  getter = () =>
+                    params => {
                       // Wait for load handler to be instantiated before
                       // initializing the reload.
                       aTab.addEventListener("SSTabRestoring", () => {
                         browser[name](params);
                       }, { once: true });
                       gBrowser._insertBrowser(aTab);
                     };
-                  };
                   break;
                 case "resumeMedia":
-                  getter = () => {
-                    return () => {
+                  getter = () =>
+                    () => {
                       // No need to insert a browser, so we just call the browser's
                       // method.
                       aTab.addEventListener("SSTabRestoring", () => {
                         browser[name]();
                       }, { once: true });
                     };
-                  };
                   break;
                 case "userTypedValue":
                 case "userTypedClear":
                 case "mediaBlocked":
-                  getter = () => {
-                    return SessionStore.getLazyTabValue(aTab, name);
-                  };
+                  getter = () => SessionStore.getLazyTabValue(aTab, name);
                   break;
                 default:
                   getter = () => {
                     if (AppConstants.NIGHTLY_BUILD) {
                       let message =
                         `[bug 1345098] Lazy browser prematurely inserted via '${name}' property access:\n`
                       console.log(message + new Error().stack);
                     }
                     this._insertBrowser(aTab);
                     return browser[name];
                   };
-                  setter = (value) => {
+                  setter = value => {
                     if (AppConstants.NIGHTLY_BUILD) {
                       let message =
                         `[bug 1345098] Lazy browser prematurely inserted via '${name}' property access:\n`
                       console.log(message + new Error().stack);
                     }
                     this._insertBrowser(aTab);
                     return browser[name] = value;
                   };