OSDN Git Service

Modify the initTargetElement method
authordhrname <dhrname@users.sourceforge.jp>
Sat, 24 Sep 2016 14:24:00 +0000 (23:24 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sat, 24 Sep 2016 14:24:00 +0000 (23:24 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index a6fd106..188f4a9 100644 (file)
@@ -783,7 +783,7 @@ base("$calcMode").up("$attribute").mix( {
   \r
   /*指定された要素にvalues属性が付いているかどうかのチェックできるメソッド*/\r
   hasAttrValues: function () {\r
-    var ele = this._ele;\r
+    var ele = this.ele;\r
     if (!ele) {\r
       return false;\r
     } else {\r
@@ -802,11 +802,11 @@ base("$calcMode").up("$attribute").mix( {
     if (!attrName) {\r
       return;\r
     }\r
-    if (this.__cacheAttr === value) {\r
+    if (this.cacheAttr === value) {\r
       /*同じ値であれば、再設定しない*/\r
       return;\r
     } else {\r
-      this.__cacheAttr = value;\r
+      this.cacheAttr = value;\r
     }\r
     var ele = this.element;\r
     if (this.isCSS) {\r
@@ -840,7 +840,8 @@ base("$calcMode").up("$attribute").mix( {
   \r
   /*アニメーションの対象となる要素を値として返すメソッド\r
    * もっぱら、pushメソッドで使われる*/\r
-  initTargetElement: function(ele) {\r
+  initTargetElement: function() {\r
+    var ele = this.ele;\r
     var s = ele.parentNode || null;\r
     var id = ele.getAttribute("xlink:href");\r
     /*getAttributeNSメソッドでうまくいかなかったため、NSなしで代用*/\r
@@ -850,7 +851,7 @@ base("$calcMode").up("$attribute").mix( {
     if ( id = ele.getAttributeNS(null, "targetElement") ) {\r
       return ele.ownerDocument.getElementById(id);\r
     }\r
-    ele = id = void 0;\r
+    id = void 0;\r
     return s;\r
   },\r
 \r
@@ -862,11 +863,13 @@ base("$calcMode").up("$attribute").mix( {
     /*キャッシュを初期化しておく*/\r
     this.cacheAttr = "";\r
     \r
-    /*initTargetElementメソッドを使って、elementプロパティの初期化*/\r
-    this.element = this.initTargetElement(ele);\r
-   \r
+\r
    /*getAttrメソッドとhasAttrValuesメソッドで必要*/\r
     this.ele = ele;\r
+    \r
+    /*initTargetElementメソッドを使って、elementプロパティの初期化*/\r
+    this.element = this.initTargetElement();\r
+    \r
     if (!this.hasAttrValues()) {\r
       /*from属性、to、by、values属性が指定されていない場合、アニメーションの効果が出ないように調整する\r
        *SMILアニメーションの仕様を参照\r
@@ -902,7 +905,7 @@ base("$calcMode").up("$attribute").mix( {
     var thisele = this.element;\r
     if (thisele) {\r
       /*規定値を設定しておく。属性を初期化するときに使われる*/\r
-      this._ele = thisele;\r
+      this.ele = thisele;\r
       this.isDefault = thisele.hasAttributeNS(this.attrNameSpace, attrName);\r
       this.defaultValue = this.getAttr(attrName,\r
        computedStyle.getPropertyValue(attrName) );\r
index 7347d87..ed13e64 100644 (file)
@@ -1731,7 +1731,7 @@ describe("SMIL Animation Spec", function() {
         attr.push(s);\r
         var timelines = base("$frame").timelines;\r
         expect(timelines.length).toBe(0);\r
-        s.setAttributeNS(null, "from", "1");\r
+        s.setAttributeNS(null, "from", "0");\r
         attr.push(s);\r
         expect(timelines.length).toBe(1);\r
         expect(attr.push(12)).toBeNull();\r