Bug 1169563 - 1 - Minor ESLint code cleanup; r=ednapiranha
authorPatrick Brosset <pbrosset@mozilla.com>
Thu, 13 Aug 2015 14:07:51 +0200
changeset 258008 4cde80b886d2bd9fbaca9c5e72305791f037bd53
parent 257920 8e42d6f9b45c41221534cf6a13362b208d12ea4e
child 258009 9b980b4f4358c1e15fa08082cdc67c5fea940ae3
push id29240
push userkwierso@gmail.com
push dateMon, 17 Aug 2015 23:54:24 +0000
treeherdermozilla-central@b41e31b71828 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersednapiranha
bugs1169563
milestone43.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 1169563 - 1 - Minor ESLint code cleanup; r=ednapiranha
browser/devtools/animationinspector/animation-controller.js
browser/devtools/animationinspector/components.js
browser/devtools/animationinspector/utils.js
--- a/browser/devtools/animationinspector/animation-controller.js
+++ b/browser/devtools/animationinspector/animation-controller.js
@@ -1,13 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* globals ViewHelpers, Task, AnimationsPanel, promise, EventEmitter,
+   AnimationsFront */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/Task.jsm");
 let { loader, require } = Cu.import("resource://gre/modules/devtools/Loader.jsm");
 Cu.import("resource://gre/modules/devtools/Console.jsm");
@@ -30,17 +32,18 @@ let gToolbox, gInspector;
  * widget when loading/unloading the iframe into the tab.
  */
 let startup = Task.async(function*(inspector) {
   gInspector = inspector;
   gToolbox = inspector.toolbox;
 
   // Don't assume that AnimationsPanel is defined here, it's in another file.
   if (!typeof AnimationsPanel === "undefined") {
-    throw new Error("AnimationsPanel was not loaded in the animationinspector window");
+    throw new Error("AnimationsPanel was not loaded in the " +
+                    "animationinspector window");
   }
 
   // Startup first initalizes the controller and then the panel, in sequence.
   // If you want to know when everything's ready, do:
   // AnimationsPanel.once(AnimationsPanel.PANEL_INITIALIZED)
   yield AnimationsController.initialize();
   yield AnimationsPanel.initialize();
 });
@@ -165,35 +168,36 @@ let AnimationsController = {
   },
 
   isPanelVisible: function() {
     return gToolbox.currentToolId === "inspector" &&
            gInspector.sidebar &&
            gInspector.sidebar.getCurrentTabID() == "animationinspector";
   },
 
-  onPanelVisibilityChange: Task.async(function*(e, id) {
+  onPanelVisibilityChange: Task.async(function*() {
     if (this.isPanelVisible()) {
       this.onNewNodeFront();
       this.startAllAutoRefresh();
     } else {
       this.stopAllAutoRefresh();
     }
   }),
 
   onNewNodeFront: Task.async(function*() {
     // Ignore if the panel isn't visible or the node selection hasn't changed.
-    if (!this.isPanelVisible() || this.nodeFront === gInspector.selection.nodeFront) {
+    if (!this.isPanelVisible() ||
+        this.nodeFront === gInspector.selection.nodeFront) {
       return;
     }
 
     let done = gInspector.updating("animationscontroller");
 
-    if(!gInspector.selection.isConnected() ||
-       !gInspector.selection.isElementNode()) {
+    if (!gInspector.selection.isConnected() ||
+        !gInspector.selection.isElementNode()) {
       yield this.destroyAnimationPlayers();
       this.emit(this.PLAYERS_UPDATED_EVENT);
       done();
       return;
     }
 
     this.nodeFront = gInspector.selection.nodeFront;
     yield this.refreshAnimationPlayers(this.nodeFront);
@@ -202,17 +206,17 @@ let AnimationsController = {
     done();
   }),
 
   /**
    * Toggle (pause/play) all animations in the current target.
    */
   toggleAll: function() {
     if (!this.hasToggleAll) {
-      return promis.resolve();
+      return promise.resolve();
     }
 
     return this.animationsFront.toggleAll().catch(Cu.reportError);
   },
 
   // AnimationPlayerFront objects are managed by this controller. They are
   // retrieved when refreshAnimationPlayers is called, stored in the
   // animationPlayers array, and destroyed when refreshAnimationPlayers is
--- a/browser/devtools/animationinspector/components.js
+++ b/browser/devtools/animationinspector/components.js
@@ -778,17 +778,18 @@ AnimationsTimeline.prototype = {
     // For now, simply re-render the component. The animation front's state has
     // already been updated.
     this.render(this.animations);
   },
 
   drawHeaderAndBackground: function() {
     let width = this.timeHeaderEl.offsetWidth;
     let scale = width / (TimeScale.maxEndTime - TimeScale.minStartTime);
-    drawGraphElementBackground(this.win.document, "time-graduations", width, scale);
+    drawGraphElementBackground(this.win.document, "time-graduations",
+                               width, scale);
 
     // And the time graduation header.
     this.timeHeaderEl.innerHTML = "";
     let interval = findOptimalTimeInterval(scale, TIME_GRADUATION_MIN_SPACING);
     for (let i = 0; i < width; i += interval) {
       createNode({
         parent: this.timeHeaderEl,
         nodeType: "span",
--- a/browser/devtools/animationinspector/utils.js
+++ b/browser/devtools/animationinspector/utils.js
@@ -11,18 +11,20 @@
 const OPTIMAL_TIME_INTERVAL_MAX_ITERS = 100;
 // Background time graduations should be multiple of this number of millis.
 const TIME_INTERVAL_MULTIPLE = 10;
 const TIME_INTERVAL_SCALES = 3;
 // The default minimum spacing between time graduations in px.
 const TIME_GRADUATION_MIN_SPACING = 10;
 // RGB color for the time interval background.
 const TIME_INTERVAL_COLOR = [128, 136, 144];
-const TIME_INTERVAL_OPACITY_MIN = 32; // byte
-const TIME_INTERVAL_OPACITY_ADD = 32; // byte
+// byte
+const TIME_INTERVAL_OPACITY_MIN = 32;
+// byte
+const TIME_INTERVAL_OPACITY_ADD = 32;
 
 /**
  * DOM node creation helper function.
  * @param {Object} Options to customize the node to be created.
  * - nodeType {String} Optional, defaults to "div",
  * - attributes {Object} Optional attributes object like
  *   {attrName1:value1, attrName2: value2, ...}
  * - parent {DOMNode} Mandatory node to append the newly created node to.