Skip to content

Commit

Permalink
perf(animation): using will-change when using progressStep()
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored and adamdbradley committed Jun 30, 2016
1 parent 4e88f89 commit 267aa32
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,21 @@ export class Animation {
}

if (Object.keys(this._fx).length) {
easing = (forcedLinearEasing ? 'linear' : this.getEasing());
for (i = 0; i < this._el.length; i++) {
// all parent/child animations should have the same duration
// ******** DOM WRITE ****************
this._el[i].style[CSS.transitionDuration] = duration + 'ms';

// each animation can have a different easing
easing = (forcedLinearEasing ? 'linear' : this.getEasing());
if (easing) {
if (duration > 0) {
// all parent/child animations should have the same duration
// ******** DOM WRITE ****************
this._el[i].style[CSS.transitionTimingFn] = easing;
this._el[i].style[CSS.transition] = '';
this._el[i].style[CSS.transitionDuration] = duration + 'ms';

// each animation can have a different easing
if (easing) {
// ******** DOM WRITE ****************
this._el[i].style[CSS.transitionTimingFn] = easing;
}
} else {
this._el[i].style[CSS.transition] = 'none';
}
}
}
Expand Down Expand Up @@ -824,6 +829,9 @@ export class Animation {
this._c[i].progressStart();
}

// ******** DOM WRITE ****************
this._willChg(true);

// ******** DOM WRITE ****************
this._before();

Expand Down

0 comments on commit 267aa32

Please sign in to comment.