Skip to content

Commit 8a559d4

Browse files
committed
Change onSample to onsample as discussed with Shane, Brian.
1 parent 768a7a5 commit 8a559d4

5 files changed

+13
-13
lines changed

src/effect-callback.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
if (isKeyframeEffect) {
2424
effectFunction = animation.effect.getFrames();
2525
} else {
26-
effectFunction = animation.effect._onSample;
26+
effectFunction = animation.effect._onsample;
2727
}
2828
var timing = animation.effect.timing;
2929
var last = null;

src/group-constructors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
};
181181

182182
var underlyingEffect = new KeyframeEffect(null, [], group._timing);
183-
underlyingEffect.onSample = ticker;
183+
underlyingEffect.onsample = ticker;
184184
underlyingAnimation = scope.timeline._play(underlyingEffect);
185185
return underlyingAnimation;
186186
};

src/keyframe-effect-constructor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
this.timing = shared.makeTiming(timingInput);
6363
if (typeof effectInput == 'function') {
64-
shared.deprecated('Custom KeyframeEffect', '2015-06-22', 'Use KeyframeEffect.onSample instead.');
64+
shared.deprecated('Custom KeyframeEffect', '2015-06-22', 'Use KeyframeEffect.onsample instead.');
6565
this._normalizedKeyframes = effectInput;
6666
} else {
6767
this._normalizedKeyframes = new KeyframeList(effectInput);
@@ -81,11 +81,11 @@
8181
shared.deprecated('KeyframeEffect.effect', '2015-03-23', 'Use KeyframeEffect.getFrames() instead.');
8282
return this._normalizedKeyframes;
8383
},
84-
set onSample(callback) {
84+
set onsample(callback) {
8585
if (typeof this.getFrames() == 'function') {
86-
throw new Error('Setting onSample on custom effect KeyframeEffect is not supported.');
86+
throw new Error('Setting onsample on custom effect KeyframeEffect is not supported.');
8787
}
88-
this._onSample = callback;
88+
this._onsample = callback;
8989
if (this._animation) {
9090
this._animation._rebuildUnderlyingAnimation();
9191
}

src/web-animations-next-animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
this._animation = scope.newUnderlyingAnimationForGroup(this.effect);
8787
scope.bindAnimationForGroup(this);
8888
}
89-
if (this.effect && this.effect._onSample) {
89+
if (this.effect && this.effect._onsample) {
9090
scope.bindAnimationForCustomEffect(this);
9191
}
9292
if (hadUnderlying) {

test/js/effect-callback.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ suite('effect-callback', function() {
88
var fractions = [];
99
tick(100);
1010
var effect = new KeyframeEffect(null, [], 1000);
11-
effect.onSample = function(fraction) {
11+
effect.onsample = function(fraction) {
1212
fractions.push(fraction);
1313
};
1414
var animation = document.timeline.play(effect);
@@ -23,7 +23,7 @@ suite('effect-callback', function() {
2323
var timeFraction;
2424
tick(0);
2525
var effect = new KeyframeEffect(null, [], {duration: 0, fill: 'both'});
26-
effect.onSample = function(t) {
26+
effect.onsample = function(t) {
2727
timeFraction = t;
2828
};
2929
var animation = document.timeline.play(effect);
@@ -38,10 +38,10 @@ suite('effect-callback', function() {
3838
tick(0);
3939
var effect = new KeyframeEffect(null, [], 2);
4040
var effect2 = new KeyframeEffect(null, [], 1);
41-
effect.onSample = function() {
41+
effect.onsample = function() {
4242
animation = document.timeline.play(effect2);
4343
};
44-
effect2.onSample = function() {
44+
effect2.onsample = function() {
4545
called = true;
4646
};
4747
document.timeline.play(effect);
@@ -53,7 +53,7 @@ suite('effect-callback', function() {
5353
test('custom effect should be called after cancel', function() {
5454
var fractions = [];
5555
var effect = new KeyframeEffect(null, [], 1000);
56-
effect.onSample = function(fraction) {
56+
effect.onsample = function(fraction) {
5757
fractions.push(fraction);
5858
};
5959
var animation = document.timeline.play(effect);
@@ -68,7 +68,7 @@ suite('effect-callback', function() {
6868
var callbackEffect;
6969
var callbackAnim;
7070
var effect = new KeyframeEffect(document.body, [], 100);
71-
effect.onSample = function(t, e, a) {
71+
effect.onsample = function(t, e, a) {
7272
callbackEffect = e;
7373
callbackAnim = a;
7474
};

0 commit comments

Comments
 (0)