From 63ab642b510c20c2dfaa9cd2ae4c2864fdcda56f Mon Sep 17 00:00:00 2001 From: dhrname Date: Tue, 18 Oct 2016 23:13:13 +0900 Subject: [PATCH] Modify the parse method --- org/w3c/dom/smil.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index f38df74..fdf2716 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -361,7 +361,14 @@ base("$frame").mix ( { _parse: function (str) { var plusminus = str.search(/[\+\-]/), event = null, - ele; + ele, + /*endListのvalueプロパティには、活動継続フレーム数と開始フレーム数を足したものが入る*/ + endList = this.$list.addEndList(Number.MAX_VALUE); + if (this.$end) { + /*$endオブジェクトを継承していた場合、 + *活動継続フレーム数関連のリストは無効とする*/ + endList = { value: 0}; + } if (str === "indefinite") { this.begin = Number.MAX_VALUE; } else if (plusminus > 0) { @@ -396,6 +403,7 @@ base("$frame").mix ( { /*イベントのリスナーとして使う*/ listener = function(evt) { objList.value = this.begin = eventOffset + this.$frame.currentFrame; + endList.value = this.$list.begin + this.activeTime; this.isResolved = true; }; this.eventOffset = eventOffset; @@ -416,7 +424,9 @@ base("$frame").mix ( { } } else { /*開始リストに登録しておく($endの場合は終了リストに登録)*/ - var objList = this.$list.addList(this.begin); + this.$list.addList(this.begin); + /*活動継続時間から算出される終了フレーム数は、終了リストに入れておく*/ + endList.value = this.$list.begin + this.activeTime; } s = event = str = plusminus = ele = void 0; }, @@ -429,6 +439,10 @@ base("$frame").mix ( { this.isResolved = false; /*$listオブジェクトを更新*/ this.$list = this.$list.up(); + /*beginとend属性を考慮に入れないで、活動継続時間を求める*/ + var s = this.$activate.up(); + this.activeTime = s.call() || Number.MAX_VALUE; + this.simpleDuration = s.simpleDur; var str = this.trim(this.string); if (str.indexOf(";") > -1){ /*;で区切られたリストを一つずつ解析*/ @@ -439,10 +453,6 @@ base("$frame").mix ( { } else { this._parse(str); } - /*beginとend属性を考慮に入れないで、活動継続時間を求める*/ - var s = this.$activate.up(); - this.activeTime = s.call() || Number.MAX_VALUE; - this.simpleDuration = s.simpleDur; s = str = void 0; return this; }, -- 2.11.0