OSDN Git Service

Add properties to the object
authordhrname <dhrname@users.sourceforge.jp>
Sat, 4 Apr 2015 14:21:48 +0000 (23:21 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sat, 4 Apr 2015 14:21:48 +0000 (23:21 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index e057706..987c760 100644 (file)
@@ -684,8 +684,12 @@ base("$calcMode").up("$attribute").mix( {
   /*前述の$frameオブジェクトでフレームを記述*/\r
   frame: base("$frame"),\r
   \r
+  /*SMILアニメーション関連の要素。たとえばanimate要素*/\r
+  element: null,\r
+  \r
   /*引数で指定した要素 ele の属性を解析して、フレームに追加する*/\r
-  push: function() {\r
+  push: function(/*Element Node*/ ele) {\r
+    this.element = ele || null;\r
   }\r
 } );\r
 //#endif // _SMIL_IDL_\r
index d92154c..7bb4eb0 100644 (file)
@@ -3319,12 +3319,17 @@ describe("SMIL Animation Spec", function() {
       /*境界条件を調べておく (limit value analysis)*/\r
       it("should be this for the value  (limit value analysis)", function() {\r
         expect(attr.frame).toBe(base("$frame"));\r
+        expect(attr.element).toBeNull();\r
         attr.push();\r
+        expect(attr.element).toBeNull();\r
         expect(attr.frame.timelines.length).toEqual(0);\r
         \r
         attr.push(document.documentElement);\r
+        expect(attr.element).toBe(document.documentElement);\r
         expect(attr.frame.timelines.length).toEqual(0);\r
-        attr.push(document.createElement("animate"));\r
+        var s = document.createElement("animate");\r
+        attr.push(s);\r
+        expect(attr.element).toBe(s);\r
         expect(attr.frame.timelines.length).toEqual(0);\r
       } );\r
       /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
@@ -3334,7 +3339,7 @@ describe("SMIL Animation Spec", function() {
       it("should be this for the value (the invalid partion on a spline mode )", function() {\r
       } );\r
     } );\r
-    describe("A ", function() {\r
+    describe("A getAttr method", function() {\r
       var attr;\r
       beforeEach( function() {\r
         attr = base("$calcMode").$attribute.up("width");\r