Skip to content

Commit

Permalink
Bug 1382576 - Switch over from the old-event-emitter to event-emitter…
Browse files Browse the repository at this point in the history
… in the animation inspector; r=jdescottes

MozReview-Commit-ID: ftItsTkomw

--HG--
extra : rebase_source : eb2facf35130f8b3805fafdb16087cf807471ae7
  • Loading branch information
Patrick Brosset committed Sep 6, 2017
1 parent 1b2e4f9 commit 2d31297
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion devtools/client/animationinspector/animation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {})
var { Task } = require("devtools/shared/task");

loader.lazyRequireGetter(this, "promise");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/old-event-emitter");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "AnimationsFront", "devtools/shared/fronts/animation", true);

const { LocalizationHelper } = require("devtools/shared/l10n");
Expand Down
4 changes: 2 additions & 2 deletions devtools/client/animationinspector/animation-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ var AnimationsPanel = {
* Set the playback rate of all current animations shown in the timeline to
* the value of this.rateSelectorEl.
*/
onRateChanged: function (e, rate) {
onRateChanged: function (rate) {
AnimationsController.setPlaybackRateAll(rate)
.then(() => this.refreshAnimationsStateAndUI())
.catch(console.error);
Expand All @@ -270,7 +270,7 @@ var AnimationsPanel = {
this.toggleAllButtonEl.classList.remove("paused");
},

onTimelineDataChanged: function (e, data) {
onTimelineDataChanged: function (data) {
this.timelineData = data;
let {isMoving, isUserDrag, time} = data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"use strict";

const {Task} = require("devtools/shared/task");
const EventEmitter = require("devtools/shared/old-event-emitter");
const {createNode, getCssPropertyName} =
require("devtools/client/animationinspector/utils");
const {Keyframes} = require("devtools/client/animationinspector/components/keyframes");
Expand All @@ -25,8 +24,6 @@ const L10N =
* @param {Object} serverTraits The list of server-side capabilities.
*/
function AnimationDetails(serverTraits) {
EventEmitter.decorate(this);

this.keyframeComponents = [];
this.serverTraits = serverTraits;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"use strict";

const {Task} = require("devtools/shared/task");
const EventEmitter = require("devtools/shared/old-event-emitter");
const EventEmitter = require("devtools/shared/event-emitter");
const {DomNodePreview} = require("devtools/client/inspector/shared/dom-node-preview");

// Map dom node fronts by animation fronts so we don't have to get them from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"use strict";

const EventEmitter = require("devtools/shared/old-event-emitter");
const EventEmitter = require("devtools/shared/event-emitter");
const {createNode, createSVGNode, TimeScale, getFormattedAnimationTitle} =
require("devtools/client/animationinspector/utils");
const {SummaryGraphHelper, getPreferredKeyframesProgressThreshold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"use strict";

const {Task} = require("devtools/shared/task");
const EventEmitter = require("devtools/shared/old-event-emitter");
const EventEmitter = require("devtools/shared/event-emitter");
const {
createNode,
findOptimalTimeInterval,
Expand Down Expand Up @@ -314,7 +314,7 @@ AnimationsTimeline.prototype = {
}, TIMELINE_BACKGROUND_RESIZE_DEBOUNCE_TIMER);
},

onAnimationSelected: Task.async(function* (e, animation) {
onAnimationSelected: Task.async(function* (animation) {
let index = this.animations.indexOf(animation);
if (index === -1) {
return;
Expand Down Expand Up @@ -353,7 +353,7 @@ AnimationsTimeline.prototype = {
yield this.details.render(animation, this.tracksMap.get(animation));
this.animationAnimationNameEl.textContent = getFormattedAnimationTitle(animation);
}
this.onTimelineDataChanged(null, { time: this.currentTime || 0 });
this.onTimelineDataChanged({ time: this.currentTime || 0 });
this.emit("animation-selected", animation);
}),

Expand Down Expand Up @@ -521,12 +521,12 @@ AnimationsTimeline.prototype = {
if (this.animations.length === 1) {
// Display animation's detail if there is only one animation,
// even if the detail pane is closing.
yield this.onAnimationSelected(null, this.animations[0]);
yield this.onAnimationSelected(this.animations[0]);
} else if (this.animationRootEl.classList.contains("animation-detail-visible") &&
this.animations.indexOf(this.selectedAnimation) >= 0) {
// animation's detail displays in case of the previously displayed animation is
// included in timeline list and the detail pane is not closing.
yield this.onAnimationSelected(null, this.selectedAnimation);
yield this.onAnimationSelected(this.selectedAnimation);
} else {
// Otherwise, close detail pane.
this.onDetailCloseButtonClick();
Expand Down Expand Up @@ -643,7 +643,7 @@ AnimationsTimeline.prototype = {
}
},

onTimelineDataChanged: function (e, { time }) {
onTimelineDataChanged: function ({ time }) {
this.currentTime = time;
const indicateTime =
TimeScale.minStartTime === Infinity ? 0 : this.currentTime + TimeScale.minStartTime;
Expand Down
5 changes: 1 addition & 4 deletions devtools/client/animationinspector/components/keyframes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

"use strict";

const EventEmitter = require("devtools/shared/old-event-emitter");
const {createNode, createSVGNode} =
require("devtools/client/animationinspector/utils");
const {ProgressGraphHelper, getPreferredKeyframesProgressThreshold} =
Expand All @@ -19,9 +18,7 @@ let LINEAR_GRADIENT_ID_COUNTER = 0;
* UI component responsible for displaying a list of keyframes.
* Also, shows a graphical graph for the animation progress of one iteration.
*/
function Keyframes() {
EventEmitter.decorate(this);
}
function Keyframes() {}

exports.Keyframes = Keyframes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"use strict";

const EventEmitter = require("devtools/shared/old-event-emitter");
const EventEmitter = require("devtools/shared/event-emitter");
const {createNode} = require("devtools/client/animationinspector/utils");
const { LocalizationHelper } = require("devtools/shared/l10n");
const L10N =
Expand Down
2 changes: 0 additions & 2 deletions devtools/client/animationinspector/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

"use strict";

loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/old-event-emitter");

const { LocalizationHelper } = require("devtools/shared/l10n");
const L10N =
new LocalizationHelper("devtools/client/locales/animationinspector.properties");
Expand Down

0 comments on commit 2d31297

Please sign in to comment.