OSDN Git Service

Modify the _tocallForPath method
[sie/sie.git] / org / w3c / dom / smil.js
index c39b13e..4af130d 100644 (file)
@@ -2074,9 +2074,22 @@ base("$calcMode").up("$attribute").mix( {
     \r
     /*setValuesメソッドのオーバライド*/\r
     setValues: function() {\r
-      if (this.getAttr("keyPoints", null)) {}\r
-      return this.$setElement.setValues.apply(this, arguments);\r
-    }\r
+      var keyPoints = this.getAttr("keyPoints", null),\r
+          /*$animateElementプロパティは下記のinitメソッドで上書きされているため、\r
+           * $animateElementを別方法で呼び出す必要がある*/\r
+          superSetValues = this.$animateElement.$animateElement.setValues;\r
+      if (keyPoints) {\r
+        return superSetValues.call(this, keyPoints, null, null, null);\r
+      } else {\r
+        return superSetValues.apply(this, arguments);\r
+      }\r
+    },\r
+    \r
+    /*isKeyErrorメソッドのオーバライド\r
+     *keyPoints属性があれば、処理するようにする*/\r
+    isKeyError: function() {\r
+      return !!this.getAttr("keyPoints", false) || this.$animateElement.isKeyError.apply(this, arguments);\r
+    },\r
   } )\r
   .on("init", function (ele) {\r
     if (!ele || !ele.parentNode) {\r
@@ -2089,6 +2102,12 @@ base("$calcMode").up("$attribute").mix( {
     this.isSum = true;\r
     this.mode = this.getAttr("mode", "paced");\r
     this.rotate = this.getAttr("rotate", "0");\r
+    if (ele.hasAttributeNS(null, "keyPoints") && !ele.hasAttributeNS(null, "path")) {\r
+      /*keyPoints属性がある場合は、path属性に指定がなければ、\r
+       * values属性などの値をpath属性に書いておく*/\r
+       var values = this.getAttr( "values", this.getAttr("from", "")+","+this.getAttr("to", "") );\r
+       ele.setAttributeNS( null, "path", "M " +values.replace(/;/g, " ") );\r
+    }\r
     this.path = this.path.cloneNode(true);\r
     var mpath = ele.getElementsByTagNameNS(this.path.namespaceURI, "mpath");\r
     /*$animateは後で、プロパティを書き換えるために使う。tocallメソッドも参照*/\r