fix(animations): ensure the web-animations driver converts style props to camel-case

The web animations API now requires that all styles are converted to
camel case. Chrome has already made this breaking change and hyphenated
styles are not functional anymore.

Closes #9111
Closes #9112
This commit is contained in:
Matias Niemelä
2016-06-08 22:50:52 -07:00
parent 7d9c1e1225
commit 4d51158b1a
4 changed files with 166 additions and 76 deletions

View File

@ -0,0 +1,35 @@
import {DomAnimatePlayer} from '../src/dom/dom_animate_player';
import {isPresent} from '../src/facade/lang';
export class MockDomAnimatePlayer implements DomAnimatePlayer {
public captures: {[key: string]: any[]} = {};
private _position: number = 0;
private _onfinish: Function = () => {};
public currentTime: number;
/** @internal */
_capture(method: string, data: any): void {
if (!isPresent(this.captures[method])) {
this.captures[method] = [];
}
this.captures[method].push(data);
}
cancel(): void { this._capture('cancel', null); }
play(): void { this._capture('play', null); }
pause(): void { this._capture('pause', null); }
finish(): void {
this._capture('finish', null);
this._onfinish();
}
set onfinish(fn: Function) {
this._capture('onfinish', fn);
this._onfinish = fn;
}
get onfinish(): Function { return this._onfinish; }
set position(val: number) {
this._capture('position', val);
this._position = val;
}
get position(): number { return this._position; }
}