From aabe3915539d01838d7ff439325cf164e351915d Mon Sep 17 00:00:00 2001 From: dhrname Date: Mon, 7 Nov 2016 22:16:25 +0900 Subject: [PATCH] Lighten the updateList method --- org/w3c/dom/smil.js | 10 ++++++---- tool/Spec/spec/SvgDomSpec.js | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index fc25d5e..b6b9796 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -197,12 +197,13 @@ base("$frame").mix ( { * それをbeginプロパティの値cacheBeginと比較する*/ var startTime = this.getMaxList(f, this.beginList), endTime = this.getMaxList(f, this.endList), + isWait = (state === wait), cacheBegin = this.begin; - if ( (!startTime) && (state === wait) ) { + if ( !startTime && isWait) { /*開始時刻が0ならば、アニメーションを開始*/ this.begin = 0; this.state = begin; - } else if ( (state === wait) || (state === post) ) { + } else if ( isWait || (state === post) ) { if (startTime > cacheBegin) { this.state = begin; /*beginプロパティに開始時刻をキャッシュ用に保存*/ @@ -247,7 +248,7 @@ base("$frame").mix ( { } else { this.state = begin; } - cacheBegin = startTime = endTime = void 0; + cacheBegin = startTime = endTime = isWait = state = void 0; return this; }, @@ -286,7 +287,8 @@ base("$frame").mix ( { for (var i=0;i