svnno****@sourc*****
svnno****@sourc*****
2011年 11月 5日 (土) 00:31:54 JST
Revision: 3068 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=3068 Author: dhrname Date: 2011-11-05 00:31:54 +0900 (Sat, 05 Nov 2011) Log Message: ----------- SVGColor in 2nd edition is supported Modified Paths: -------------- trunk/Spec/SpecRunner.html trunk/Spec/spec/SvgDomSpec.js Modified: trunk/Spec/SpecRunner.html =================================================================== --- trunk/Spec/SpecRunner.html 2011-11-03 11:57:28 UTC (rev 3067) +++ trunk/Spec/SpecRunner.html 2011-11-04 15:31:54 UTC (rev 3068) @@ -8,12 +8,12 @@ <script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script> <!-- include source files here... --> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/core.js"></script> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/dom/events.js"></script> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/dom/stylesheet.js"></script> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/dom/css.js"></script> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/dom/smil.js"></script> -<script defer="defer" type="text/javascript" src="../../branches/08x/088/org/w3c/dom/svg.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/core.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/dom/events.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/dom/stylesheet.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/dom/css.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/dom/smil.js"></script> +<script defer="defer" type="text/javascript" src="../../branches/08x/089/org/w3c/dom/svg.js"></script> <!-- include spec files here... --> <script defer="defer" type="text/javascript" src="spec/SvgDomSpec.js"></script> Modified: trunk/Spec/spec/SvgDomSpec.js =================================================================== --- trunk/Spec/spec/SvgDomSpec.js 2011-11-03 11:57:28 UTC (rev 3067) +++ trunk/Spec/spec/SvgDomSpec.js 2011-11-04 15:31:54 UTC (rev 3068) @@ -1066,7 +1066,7 @@ expect(s.colorType).toEqual(1); }); /*setRGBColorメソッドの同値分割をして、無効同値クラスを調べておく (equivalence partitioning, the following is the invalid partion)*/ - it("should throw a DOMException 'Not Supported Error', when it calls a setRGBColor method (the invalid partion)", function() { + it("should throw a DOMException 'SVG_INVALID_VALUE_ERR', when it calls a setRGBColor method (the invalid partion)", function() { var t = [Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NaN, {}, [], "", "1", "-1", undefined, null, 0, -1, 11, 1.1, 10.1]; for (var i=0,tli=t.length;i<tli;++i) { var ti = t[i], sn = function() { @@ -1096,7 +1096,7 @@ expect(s.rgbColor.blue.getFloatValue(1)).toEqual(255); expect(s.colorType).toEqual(1); } - s.setColor(/*SVG_COLORTYPE_CURRENTCOLOR*/ 3, cls[0], null); + s.setColor(/*SVG_COLORTYPE_CURRENTCOLOR*/ 3, null, null); expect(s.colorType).toEqual(3); }); /*setColorメソッドの同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion, when it calls a setColor method)*/ @@ -1125,8 +1125,9 @@ expect(s.colorType).toEqual(1); }); /*setColorメソッドの同値分割をして、無効同値クラスを調べておく (equivalence partitioning, the following is the invalid partion)*/ - it("should throw a DOMException 'Not Supported Error', when it calls a setColor method (the invalid partion)", function() { + it("should throw a DOMException 'SVG_INVALID_VALUE_ERR', when it calls a setColor method (the invalid partion)", function() { var t = [Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NaN, {}, [], "", "1", "-1", undefined, null, 0, -1, 11, 1.1, 10.1]; + var cls = ["gainsboro", "rgb(220, 220, 220)", "#dcdcdc", "magenta", "rgb(255, 0, 255)", "#ff00ff", "#f0f", "rgb(100%, 0%, 100%)"]; for (var i=0,tli=t.length;i<tli;++i) { var ti = t[i], sn = function() { s.setColor(/*SVG_COLORTYPE_RGBCOLOR*/ 1, ti, null); @@ -1134,7 +1135,37 @@ expect(sn).toThrow(); ti = sn = null; } - t = null; + for (var i=0,tli=cls.length;i<tli;++i) { + var ci = cls[i], sn = function() { + s.setColor(/*SVG_COLORTYPE_RGBCOLOR*/ 1, ci, ci); + }; + expect(sn).toThrow(); + ci = sn = null; + } + for (var i=0,tli=cls.length;i<tli;++i) { + var ci = cls[i], sn = function() { + s.setColor(/*SVG_COLORTYPE_RGBCOLOR*/ 1, null, ci); + }; + expect(sn).toThrow(); + ci = sn = null; + } + for (var i=0,tli=t.length,ci=cls[0];i<tli;++i) { + var ti = t[i], sn = function() { + s.setColor(/*SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR*/ 2, null, ti); + s.setColor(/*SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR*/ 2, ci, ti); + }; + expect(sn).toThrow(); + ti = sn = null; + } + for (var i=0,tli=cls.length;i<tli;++i) { + var ci = cls[i], sn = function() { + s.setColor(/*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0, ci, null); + s.setColor(/*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0, ci, ci); + }; + expect(sn).toThrow(); + ci = sn = null; + } + t = cls = null; }); }); }); \ No newline at end of file