OSDN Git Service

Modify the push method
authordhrname <dhrname@users.sourceforge.jp>
Sun, 23 Oct 2016 13:16:07 +0000 (22:16 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 23 Oct 2016 13:16:07 +0000 (22:16 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index ffe453b..4c17f3e 100644 (file)
@@ -438,7 +438,7 @@ base("$frame").mix ( {
       this.begin = 0;\r
       this.isResolved = false;\r
       /*beginとend属性を考慮に入れないで、活動継続時間を求める*/\r
-      var s = this.$activate.up();\r
+      var s = ( this.$activate = this.$activate.up() );\r
       this.activeTime = s.call() || Number.MAX_VALUE;\r
       this.simpleDuration = s.simpleDur;\r
       var str = this.trim(this.string);\r
@@ -1100,13 +1100,12 @@ base("$calcMode").up("$attribute").mix( {
                     min: this.getAttr("min", "0"),\r
                     max: this.getAttr("max", "indefinite")\r
                   } )\r
-                } ).parse();\r
-    frame.$activate.end.$begin = frame;\r
+                } ).updateList().parse();\r
+    $frame.addLine(frame.$list);\r
     /*beginElementメソッドを追加*/\r
     function eleMethod (obj, eventName) {\r
       return (obj.string !== "indefinite") ? function(){}\r
                         : function() {\r
-                            base("$frame").addLine(obj.$list);\r
                             var evt = this.ownerDocument.createEvent("MouseEvents");\r
                             evt.initMouseEvent(eventName + "Event" ,true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, this);\r
                             this.dispatchEvent(evt);\r
@@ -1114,7 +1113,7 @@ base("$calcMode").up("$attribute").mix( {
     };\r
     ele.beginElement = eleMethod(frame, "begin");\r
     /*endElementメソッドを追加*/\r
-    ele.endElement = eleMethod(frame.$activate.end, "end");\r
+    ele.endElement = eleMethod(frame.$activate.end || {}, "end");\r
     /*setFrameメソッドを使ったときの、再帰スタックの使いすぎを防ぐため*/\r
     frame.timelines = [];\r
     begin = ele = void 0;\r
@@ -1308,7 +1307,6 @@ base("$calcMode").up("$attribute").mix( {
       line.$list.addEvent("begin", this._setFrame.bind(this));\r
       line.$list.addEvent("play", this._setFrame.bind(this));\r
       line.$list.addEvent("end", this._setEndFrame.bind(this));\r
-      base("$frame").addLine(line.$list);\r
       /*アニメーションが再起動する可能性もあるため、$listのstateプロパティはここで初期化*/\r
       line.$list.state = line.$list.WAITING;\r
     }\r
index 720ffbb..a1c5084 100644 (file)
@@ -1738,16 +1738,14 @@ describe("SMIL Animation Spec", function() {
         function check(attrName, num) {\r
           s.setAttribute(attrName, "1");\r
           expect(s.hasAttributeNS(null, attrName)).toBeTruthy();\r
-          var l = attr.push(s);\r
+          var fr = attr.push(s);\r
           expect(attr.element).toBe(p);\r
           var timelines = base("$frame").timelines;\r
           expect(timelines.length).toBe(num);\r
           var line = timelines[num-1];\r
-          expect(line.string).toBe("0");\r
-          expect(line).toBe(l); //タイムラインのオブジェクトを返す\r
-          var act = line.$activate;\r
+          expect(line).not.toBe(fr);\r
+          var act = fr.$activate;\r
           expect(act.dur).toBeNull();\r
-          expect(act.end).toBe(0);\r
           expect(act.repeatCount).toBeNull();\r
           expect(act.repeatDur).toBeNull();\r
           expect(act.min).toBe("0");\r
@@ -1816,14 +1814,13 @@ describe("SMIL Animation Spec", function() {
         function check2(attrName, value) {\r
           s.setAttribute(attrName, value);\r
           expect(s.hasAttributeNS(null, attrName)).toBeTruthy();\r
-          attr.push(s);\r
+          var fr = attr.push(s);\r
           expect(attr.element).toBe(p);\r
           var timelines = base("$frame").timelines;\r
           var line = timelines[timelines.length-1];\r
-          expect(line.string).toBe(values[0]);\r
-          var act = line.$activate;\r
+          expect(fr.string).toBe(values[0]);\r
+          var act = fr.$activate;\r
           expect(act.dur).toBe(values[1]);\r
-          expect(act.end).toBe(values[2]);\r
           expect(act.repeatCount).toBe(values[3]);\r
           expect(act.repeatDur).toBe(values[4]);\r
           expect(act.min).toBe(values[5]);\r