ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)
| リビジョン | b987c9349883152e497072c20f42583d9eb2463c (tree) |
|---|---|
| 日時 | 2016-04-04 23:10:18 |
| 作者 | dhrname <dhrname@user...> |
| コミッター | dhrname |
Modify the _setEndFrame method
| @@ -831,9 +831,15 @@ base("$calcMode").up("$attribute").mix( { | ||
| 831 | 831 | return; |
| 832 | 832 | } |
| 833 | 833 | var ele = this.element; |
| 834 | - ele.removeAttributeNS(this.attrNameSpace, this.attrName); | |
| 835 | - /*スタイルシートのプロパティも削除しておく*/ | |
| 836 | - ele.style[this.attrName] = this.defaultValue; | |
| 834 | + if (this.isDefault) { | |
| 835 | + this.setAttribute(this.defaultValue); | |
| 836 | + } else { | |
| 837 | + /*初期段階でターゲットの要素に属性が指定されていない場合は、 | |
| 838 | + * 現在の属性値を削除するだけでよい*/ | |
| 839 | + ele.removeAttributeNS(this.attrNameSpace, this.attrName); | |
| 840 | + /*スタイルシートのプロパティも削除しておく*/ | |
| 841 | + ele.style[this.attrName] = this.defaultValue; | |
| 842 | + } | |
| 837 | 843 | value = ele = void 0; |
| 838 | 844 | }, |
| 839 | 845 |
| @@ -1092,10 +1098,8 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1092 | 1098 | /*イベントが設定されていないか、解決済みである場合*/ |
| 1093 | 1099 | this.isEnd = true; |
| 1094 | 1100 | /*removeの場合、アニメーションを凍結せずに、もとに戻す*/ |
| 1095 | - if ((this.fill === "remove") && this.isDefault) { | |
| 1096 | - this.element.setAttributeNS(this.attrNameSpace, this.attrName, this.defaultValue); | |
| 1097 | - } else if (this.fill === "remove"){ | |
| 1098 | - this.element.removeAttributeNS(this.attrNameSpace, this.attrName); | |
| 1101 | + if ((this.fill === "remove")) { | |
| 1102 | + this.removeAttribute(); | |
| 1099 | 1103 | } |
| 1100 | 1104 | line = frame = void 0; |
| 1101 | 1105 | return false; |
| @@ -1167,7 +1171,7 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1167 | 1171 | * http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues*/ |
| 1168 | 1172 | advance = duration ? ( (currentTime - line.begin) % duration ) / duration |
| 1169 | 1173 | : 0; |
| 1170 | - this.element.setAttributeNS(this.attrNameSpace, this.attrName, this.tocall(advance)); | |
| 1174 | + this.setAttribute(this.tocall(advance)); | |
| 1171 | 1175 | line = duration = advance = void 0; |
| 1172 | 1176 | }, |
| 1173 | 1177 |
| @@ -1186,7 +1190,7 @@ base("$calcMode").up("$attribute").mix( { | ||
| 1186 | 1190 | } else { |
| 1187 | 1191 | advance = 0; |
| 1188 | 1192 | } |
| 1189 | - this.element.setAttributeNS(this.attrNameSpace, this.attrName, this.tocall(advance)); | |
| 1193 | + this.setAttribute(this.tocall(advance)); | |
| 1190 | 1194 | line = duration = advance = void 0; |
| 1191 | 1195 | } |
| 1192 | 1196 | }, |