From 2e4fb7b073a82ed4f4f7f77569d633defab417eb Mon Sep 17 00:00:00 2001 From: dhrname Date: Wed, 8 Feb 2017 21:14:42 +0900 Subject: [PATCH] Lighten the setKey method --- org/w3c/dom/smil.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 1da1374..76340f1 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -1315,6 +1315,7 @@ base("$calcMode").up("$attribute").mix( { this.getAttr("from", null), this.getAttr("to", null), this.getAttr("by", null) ), + toLength = to ? to.length : 0, keyTimes = this.getAttr("keyTimes", null), keySplines = this.getAttr("keySplines", null), keys, @@ -1330,7 +1331,7 @@ base("$calcMode").up("$attribute").mix( { return null; } /*toオブジェクトはtoとfromで一組となっているのでlengthが加算される*/ - if (this.isKeyError(keys.length, to.length)) { + if (this.isKeyError(keys.length, toLength)) { /*keyTimes属性とvalues属性のリストの個数が合致しない場合、アニメーションの効果がない * 仕様を参照 SMIL Animation 3.2.3. Animation function calculation modes * http://www.w3.org/TR/smil-animation/#AnimFuncCalcMode*/ @@ -1345,7 +1346,7 @@ base("$calcMode").up("$attribute").mix( { */ return null; } - for (var i=0;i