ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)
Revisión | 0fb9736f742428ee92e7b132ed58dd8197fb56f3 (tree) |
---|---|
Tiempo | 2017-05-12 23:35:09 |
Autor | dhrname <dhrname@user...> |
Commiter | dhrname |
Modify the Spec for the base.js
@@ -1207,7 +1207,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1207 | 1207 | target: ele, |
1208 | 1208 | eventTarget: (this.element || begin.eventTarget), |
1209 | 1209 | string: this.getAttr("begin", "0"), |
1210 | - $activate: begin.$activate.up().mix( { | |
1210 | + $activate: begin.$activate.up().of( { | |
1211 | 1211 | dur: this.getAttr("dur", null), |
1212 | 1212 | end: begin.$end.up().mix( { |
1213 | 1213 | eventTarget: (this.element || begin.eventTarget), |
@@ -1234,7 +1234,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1234 | 1234 | this.dispatchEvent(evt); |
1235 | 1235 | }; |
1236 | 1236 | /*endElementメソッドを追加*/ |
1237 | - var endFrame = frame.$activate.end || {}; | |
1237 | + var endFrame = frame.$activate.end__ || {}; | |
1238 | 1238 | ele.endElement = (endFrame.string !== "indefinite") ? function(){} |
1239 | 1239 | : function() { |
1240 | 1240 | if (frame.isResolved) { |
@@ -1259,12 +1259,12 @@ base("$calcMode").up("$attribute").mix( { | ||
1259 | 1259 | * 自分自身となる$attributeオブジェクトのコピーを返す*/ |
1260 | 1260 | setValues: function(values, from, to, by) { |
1261 | 1261 | var $from = this.$from, |
1262 | - s = [this.up().mix( { | |
1263 | - to: $from.up().mix( { | |
1262 | + s = [this.up().of( { | |
1263 | + to: $from.up().of( { | |
1264 | 1264 | from: $from.up() |
1265 | 1265 | } ) |
1266 | 1266 | } )], |
1267 | - sto = s[0].to; | |
1267 | + sto = s[0].to__; | |
1268 | 1268 | values = values && values.split(";"); |
1269 | 1269 | /*from属性はオプションなので、条件には付け加えない*/ |
1270 | 1270 | if (values && values.length) { |
@@ -1272,21 +1272,21 @@ base("$calcMode").up("$attribute").mix( { | ||
1272 | 1272 | * W3C仕様 SMIL アニメーション 3.2.2. アニメーション関数の値*/ |
1273 | 1273 | s = []; |
1274 | 1274 | for (var i=1;i<values.length;++i) { |
1275 | - s.push( this.up().mix( { | |
1276 | - to: $from.up().mix( { | |
1275 | + s.push( this.up().of( { | |
1276 | + to: $from.up().of( { | |
1277 | 1277 | from: $from.up() |
1278 | 1278 | } ) |
1279 | 1279 | } ) ); |
1280 | - sto = s[s.length-1].to; | |
1280 | + sto = s[s.length-1].to__; | |
1281 | 1281 | sto.string = values[i]; |
1282 | - sto.from.string = values[i-1]; | |
1282 | + sto.from__.string = values[i-1]; | |
1283 | 1283 | } |
1284 | 1284 | } else if (to) { |
1285 | 1285 | sto.string = to; |
1286 | - sto.from.string = from || "0"; | |
1286 | + sto.from__.string = from || "0"; | |
1287 | 1287 | } else if (by) { |
1288 | 1288 | sto.string = by; |
1289 | - sto.from.string = from || "0"; | |
1289 | + sto.from__.string = from || "0"; | |
1290 | 1290 | var toNumList = sto.call(), |
1291 | 1291 | fromNumList = sto.from; |
1292 | 1292 | for (var i=0;i<toNumList.length;++i) { |
@@ -1324,7 +1324,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1324 | 1324 | isDiscrete = (this.mode === "discrete"), |
1325 | 1325 | toiKeySplines; |
1326 | 1326 | if (!isDiscrete && keyTimes && to) { |
1327 | - keys = this.$from.numList.call( { | |
1327 | + keys = this.$from.numList__.call( { | |
1328 | 1328 | string: keyTimes |
1329 | 1329 | } ); |
1330 | 1330 | /*keysTime属性の最初は0でなければならない。そうでなければエラー(SVG 1.1 2ndの仕様を参照)*/ |
@@ -1350,7 +1350,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1350 | 1350 | for (var i=0;i<toLength;++i) { |
1351 | 1351 | to[i].keyTime = keys[i+1] - keys[i]; |
1352 | 1352 | if (splines) { |
1353 | - toiKeySplines = this.$from.numList.call( { | |
1353 | + toiKeySplines = this.$from.numList__.call( { | |
1354 | 1354 | string: splines[i] |
1355 | 1355 | } ); |
1356 | 1356 | /*空配列を返すため、nullに変えておく*/ |
@@ -1362,7 +1362,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1362 | 1362 | for (var i=0;i<toLength;++i) { |
1363 | 1363 | to[i].keyTime = per; |
1364 | 1364 | if (splines) { |
1365 | - toiKeySplines = this.$from.numList.call( { | |
1365 | + toiKeySplines = this.$from.numList__.call( { | |
1366 | 1366 | string: splines[i] |
1367 | 1367 | } ); |
1368 | 1368 | to[i].keySplines = toiKeySplines.length ? toiKeySplines : null; |
@@ -1371,7 +1371,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1371 | 1371 | } else if (to) { |
1372 | 1372 | /*discreteモードの処理*/ |
1373 | 1373 | if (keyTimes) { |
1374 | - keys = this.$from.numList.call( { | |
1374 | + keys = this.$from.numList__.call( { | |
1375 | 1375 | string: keyTimes |
1376 | 1376 | } ); |
1377 | 1377 | /*keysTime属性の最初は0でなければならない。そうでなければエラー(SVG 1.1 2ndの仕様を参照)*/ |
@@ -1410,7 +1410,7 @@ base("$calcMode").up("$attribute").mix( { | ||
1410 | 1410 | /*ベクトル全体の距離を算出*/ |
1411 | 1411 | var norm = 0; |
1412 | 1412 | to.forEach( function(x) { |
1413 | - norm += x.to.distance(x.to.from); | |
1413 | + norm += x.to__.distance(x.to__.from__); | |
1414 | 1414 | } ); |
1415 | 1415 | to.forEach( function(x) { |
1416 | 1416 | x.norm = norm; |
@@ -1129,36 +1129,36 @@ describe("SMIL Animation Spec", function() { | ||
1129 | 1129 | var from = base("$from"); |
1130 | 1130 | beforeEach( function() { |
1131 | 1131 | from = base("$from").up(); |
1132 | - from.from = from.from.up(); | |
1132 | + from.from__ = from.from__.up(); | |
1133 | 1133 | from.string = ""; |
1134 | 1134 | } ); |
1135 | 1135 | /*境界条件を調べておく (limit value analysis)*/ |
1136 | 1136 | it("should be this for the value (limit value analysis)", function() { |
1137 | 1137 | expect(from.string).toBe(""); |
1138 | - expect(from.numList()).toEqual([]); | |
1139 | - expect(from.strList()).toBeNull(); | |
1138 | + expect(from.numList__()).toEqual([]); | |
1139 | + expect(from.strList__()).toBeNull(); | |
1140 | 1140 | |
1141 | 1141 | from.string = "0"; |
1142 | - expect(from.numList()[0]).toBe(0); | |
1143 | - expect(from.strList()).toBeNull(); | |
1142 | + expect(from.numList__()[0]).toBe(0); | |
1143 | + expect(from.strList__()).toBeNull(); | |
1144 | 1144 | |
1145 | 1145 | from.string = " 0 "; |
1146 | - expect(from.numList()[0]).toBe(0); | |
1147 | - expect(from.strList().join("")).toBe(" "); | |
1146 | + expect(from.numList__()[0]).toBe(0); | |
1147 | + expect(from.strList__().join("")).toBe(" "); | |
1148 | 1148 | |
1149 | 1149 | from.string = "a"; |
1150 | - expect(from.numList()).toEqual([]); | |
1151 | - expect(from.strList()[0]).toBe("a"); | |
1150 | + expect(from.numList__()).toEqual([]); | |
1151 | + expect(from.strList__()[0]).toBe("a"); | |
1152 | 1152 | |
1153 | 1153 | /*前後の空白を除去する処理をしない。なぜなら、文字列リストの空白は保持するのが望ましいから |
1154 | 1154 | * 文字列リストの空白を除去した例: "M 20 20 M M" -> "M20 20 MM"となってしまう*/ |
1155 | 1155 | |
1156 | 1156 | from.string = null; |
1157 | 1157 | expect( function() { |
1158 | - from.numList(); | |
1158 | + from.numList__(); | |
1159 | 1159 | } ).toThrow(); |
1160 | 1160 | expect( function() { |
1161 | - from.strList(); | |
1161 | + from.strList__(); | |
1162 | 1162 | } ).toThrow(); |
1163 | 1163 | |
1164 | 1164 | expect(from.additive[0]).toBe(0); |
@@ -1167,87 +1167,87 @@ describe("SMIL Animation Spec", function() { | ||
1167 | 1167 | /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/ |
1168 | 1168 | it("should be this for the value (the valid partion)", function() { |
1169 | 1169 | from.string = "0a"; |
1170 | - expect(from.numList()[0]).toBe(0); | |
1171 | - expect(from.strList()[0]).toBe("a"); | |
1170 | + expect(from.numList__()[0]).toBe(0); | |
1171 | + expect(from.strList__()[0]).toBe("a"); | |
1172 | 1172 | |
1173 | 1173 | from.string = "a0"; |
1174 | - expect(from.numList()[0]).toBe(0); | |
1175 | - expect(from.strList()[0]).toBe("a"); | |
1174 | + expect(from.numList__()[0]).toBe(0); | |
1175 | + expect(from.strList__()[0]).toBe("a"); | |
1176 | 1176 | |
1177 | 1177 | from.string = "0.1"; |
1178 | - expect(from.numList()[0]).toBe(0.1); | |
1179 | - expect(from.strList()).toBeNull(); | |
1178 | + expect(from.numList__()[0]).toBe(0.1); | |
1179 | + expect(from.strList__()).toBeNull(); | |
1180 | 1180 | |
1181 | 1181 | from.string = "+0.1"; |
1182 | - expect(from.numList()[0]).toBe(0.1); | |
1183 | - expect(from.strList()).toBeNull(); | |
1182 | + expect(from.numList__()[0]).toBe(0.1); | |
1183 | + expect(from.strList__()).toBeNull(); | |
1184 | 1184 | |
1185 | 1185 | from.string = "-0.1"; |
1186 | - expect(from.numList()[0]).toBe(-0.1); | |
1187 | - expect(from.strList()).toBeNull(); | |
1186 | + expect(from.numList__()[0]).toBe(-0.1); | |
1187 | + expect(from.strList__()).toBeNull(); | |
1188 | 1188 | |
1189 | 1189 | from.string = "1e-1"; |
1190 | - expect(from.numList()[0]).toBe(1e-1); | |
1191 | - expect(from.strList()).toBeNull(); | |
1190 | + expect(from.numList__()[0]).toBe(1e-1); | |
1191 | + expect(from.strList__()).toBeNull(); | |
1192 | 1192 | |
1193 | 1193 | from.string = "1E-1"; |
1194 | - expect(from.numList()[0]).toBe(1E-1); | |
1195 | - expect(from.strList()).toBeNull(); | |
1194 | + expect(from.numList__()[0]).toBe(1E-1); | |
1195 | + expect(from.strList__()).toBeNull(); | |
1196 | 1196 | |
1197 | 1197 | from.string = "0,0"; |
1198 | - expect(from.numList().toString()).toBe("0,0"); | |
1199 | - expect(from.strList().join("")).toBe(","); | |
1198 | + expect(from.numList__().toString()).toBe("0,0"); | |
1199 | + expect(from.strList__().join("")).toBe(","); | |
1200 | 1200 | |
1201 | 1201 | from.string = "a00a"; |
1202 | - expect(from.numList()[0]).toBe(0); | |
1203 | - expect(from.strList().join("")).toBe("aa"); | |
1202 | + expect(from.numList__()[0]).toBe(0); | |
1203 | + expect(from.strList__().join("")).toBe("aa"); | |
1204 | 1204 | |
1205 | 1205 | from.string = "a0b0a"; |
1206 | - expect(from.numList().toString()).toBe("0,0"); | |
1207 | - expect(from.strList().join("")).toBe("aba"); | |
1206 | + expect(from.numList__().toString()).toBe("0,0"); | |
1207 | + expect(from.strList__().join("")).toBe("aba"); | |
1208 | 1208 | |
1209 | 1209 | from.string = "0b0a"; |
1210 | - expect(from.numList().toString()).toBe("0,0"); | |
1211 | - expect(from.strList().join("")).toBe("ba"); | |
1210 | + expect(from.numList__().toString()).toBe("0,0"); | |
1211 | + expect(from.strList__().join("")).toBe("ba"); | |
1212 | 1212 | |
1213 | 1213 | from.string = "0b-1.0a"; |
1214 | - expect(from.numList()[1]).toBe(-1); | |
1215 | - expect(from.strList().join("")).toBe("ba"); | |
1214 | + expect(from.numList__()[1]).toBe(-1); | |
1215 | + expect(from.strList__().join("")).toBe("ba"); | |
1216 | 1216 | |
1217 | 1217 | expect(from.up().call()).toBe(from.$1.numList); |
1218 | 1218 | expect(from.$1.numList[1]).toBe(-1); |
1219 | 1219 | expect(from.$1.strList.join("")).toBe("ba"); |
1220 | 1220 | |
1221 | 1221 | from.string = "あ 0b-1.0a12"; |
1222 | - expect(from.numList()[1]).toBe(-1); | |
1223 | - expect(from.strList().join("")).toBe("あ ba12"); | |
1222 | + expect(from.numList__()[1]).toBe(-1); | |
1223 | + expect(from.strList__().join("")).toBe("あ ba12"); | |
1224 | 1224 | |
1225 | 1225 | from.string = "0b-1.0a0"; |
1226 | - expect(from.numList().join(",")).toBe("0,-1,0"); | |
1227 | - expect(from.strList().join("")).toBe("ba"); | |
1226 | + expect(from.numList__().join(",")).toBe("0,-1,0"); | |
1227 | + expect(from.strList__().join("")).toBe("ba"); | |
1228 | 1228 | |
1229 | 1229 | from.string = "0b .1a"; |
1230 | - expect(from.numList()[1]).toBe(0.1); | |
1231 | - expect(from.strList().join("")).toBe("b a"); | |
1230 | + expect(from.numList__()[1]).toBe(0.1); | |
1231 | + expect(from.strList__().join("")).toBe("b a"); | |
1232 | 1232 | } ); |
1233 | 1233 | /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ |
1234 | 1234 | it("should be this for the value (the invalid partion)", function() { |
1235 | 1235 | from.string = NaN; |
1236 | 1236 | expect(function(){ |
1237 | - from.numList(); | |
1237 | + from.numList__(); | |
1238 | 1238 | } ).toThrow(); |
1239 | 1239 | expect(function(){ |
1240 | - from.strList(); | |
1240 | + from.strList__(); | |
1241 | 1241 | } ).toThrow(); |
1242 | 1242 | |
1243 | 1243 | from.string = "currentColor"; |
1244 | - expect(from.numList()).toEqual([]); | |
1245 | - expect(from.strList()[0]).toBe("currentColor"); | |
1244 | + expect(from.numList__()).toEqual([]); | |
1245 | + expect(from.strList__()[0]).toBe("currentColor"); | |
1246 | 1246 | |
1247 | 1247 | from.string = "eE"; |
1248 | - expect(from.numList()).toEqual([]); | |
1249 | - expect(from.strList()[0]).toBe("eE"); | |
1250 | - expect(from.strList()[0]).toBe("eE"); | |
1248 | + expect(from.numList__()).toEqual([]); | |
1249 | + expect(from.strList__()[0]).toBe("eE"); | |
1250 | + expect(from.strList__()[0]).toBe("eE"); | |
1251 | 1251 | } ) |
1252 | 1252 | } ); |
1253 | 1253 | describe("A $to object", function() { |
@@ -1266,10 +1266,10 @@ describe("SMIL Animation Spec", function() { | ||
1266 | 1266 | /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/ |
1267 | 1267 | it("should be this for the value (the valid partion)", function() { |
1268 | 1268 | from.up("$to"); |
1269 | - from.$to.from = from; | |
1269 | + from.$to.from__ = from; | |
1270 | 1270 | from.$to.string = "12cm-7"; |
1271 | - expect(from.$to.numList().join(",")).toBe("12,-7"); | |
1272 | - expect(from.$to.strList().toString()).toBe("cm"); | |
1271 | + expect(from.$to.numList__().join(",")).toBe("12,-7"); | |
1272 | + expect(from.$to.strList__().toString()).toBe("cm"); | |
1273 | 1273 | |
1274 | 1274 | from.string = "7cm+8"; |
1275 | 1275 | from.$to.call(); |
@@ -1300,7 +1300,7 @@ describe("SMIL Animation Spec", function() { | ||
1300 | 1300 | from = base("$from").up(); |
1301 | 1301 | from.string = ""; |
1302 | 1302 | from.up("$to"); |
1303 | - from.$to.from = from; | |
1303 | + from.$to.from__ = from; | |
1304 | 1304 | } ); |
1305 | 1305 | /*境界条件を調べておく (limit value analysis)*/ |
1306 | 1306 | it("should be this for the value (limit value analysis)", function() { |
@@ -1319,7 +1319,7 @@ describe("SMIL Animation Spec", function() { | ||
1319 | 1319 | |
1320 | 1320 | from = base("$from").up(); |
1321 | 1321 | from.up("$to"); |
1322 | - from.$to.from = from; | |
1322 | + from.$to.from__ = from; | |
1323 | 1323 | arr.string = from.string = "0"; |
1324 | 1324 | from.$to.string = "1"; |
1325 | 1325 | expect(from.$to.call()).toBe(from.$to.numList); |
@@ -1337,7 +1337,7 @@ describe("SMIL Animation Spec", function() { | ||
1337 | 1337 | f(from.up(), " inline", " block "); |
1338 | 1338 | function f(from, inline, block) { |
1339 | 1339 | from.up("$to"); |
1340 | - from.$to.from = from; | |
1340 | + from.$to.from__ = from; | |
1341 | 1341 | from.string = inline; |
1342 | 1342 | arr.string = from.$to.string = block; |
1343 | 1343 | expect(from.$to.call()).toBe(from.$to.numList); |
@@ -1377,7 +1377,7 @@ describe("SMIL Animation Spec", function() { | ||
1377 | 1377 | from.up("$to"); |
1378 | 1378 | from.string = "a0S"; |
1379 | 1379 | from.$to.string = "a1S"; |
1380 | - from.$to.from = from; | |
1380 | + from.$to.from__ = from; | |
1381 | 1381 | expect(from.$to.call()).toBe(from.$to.numList); |
1382 | 1382 | expect(from.$to.numList[0]).toBe(1); |
1383 | 1383 | expect(from.$to.strList[0]).toBe("a"); |
@@ -1400,7 +1400,7 @@ describe("SMIL Animation Spec", function() { | ||
1400 | 1400 | from.up("$to"); |
1401 | 1401 | from.string = fromString; |
1402 | 1402 | from.$to.string = toString; |
1403 | - from.$to.from = from; | |
1403 | + from.$to.from__ = from; | |
1404 | 1404 | from.$to.call(); |
1405 | 1405 | from.$to.degit = 1; |
1406 | 1406 | expect(from.$to.advance(0)).toBe("a-10.0s1.5"); |
@@ -1527,7 +1527,7 @@ describe("SMIL Animation Spec", function() { | ||
1527 | 1527 | beforeEach( function() { |
1528 | 1528 | calc = base("$calcMode").up(); |
1529 | 1529 | calc.to = base("$from").up().mix( {string: "1"} ); |
1530 | - from = calc.to.from = base("$from").up().mix( {string: "0"} ); | |
1530 | + from = calc.to.from__ = base("$from").up().mix( {string: "0"} ); | |
1531 | 1531 | } ); |
1532 | 1532 | /*境界条件を調べておく (limit value analysis)*/ |
1533 | 1533 | it("should be this for the value (limit value analysis)", function() { |
@@ -1546,19 +1546,19 @@ describe("SMIL Animation Spec", function() { | ||
1546 | 1546 | /*paced mode*/ |
1547 | 1547 | calc.mode = "paced"; |
1548 | 1548 | expect(calc.norm).toBe(1); |
1549 | - calc.to.from = from; | |
1549 | + calc.to.from__ = from; | |
1550 | 1550 | expect(calc.call()(0)).toBe("0"); |
1551 | 1551 | expect(calc.keyTime).toBe(1); |
1552 | - calc.to.from = from; | |
1552 | + calc.to.from__ = from; | |
1553 | 1553 | expect(calc.call()(1)).toBe("1"); |
1554 | 1554 | |
1555 | 1555 | calc.keyTime = 0; |
1556 | - calc.to.from = from; | |
1556 | + calc.to.from__ = from; | |
1557 | 1557 | expect(calc.call()(1)).toBe("1"); |
1558 | 1558 | |
1559 | 1559 | /*discrete mode*/ |
1560 | 1560 | calc.mode = "discrete"; |
1561 | - calc.to.from = from; | |
1561 | + calc.to.from__ = from; | |
1562 | 1562 | calc.keyTime = 1; |
1563 | 1563 | expect(calc.call()(0)).toBe("0"); |
1564 | 1564 | expect(calc.call()(1)).toBe("1"); |
@@ -1576,8 +1576,8 @@ describe("SMIL Animation Spec", function() { | ||
1576 | 1576 | calc = base("$calcMode").up(); |
1577 | 1577 | calc.keyTime = 0.2; |
1578 | 1578 | calc.to = base("$from").up(); |
1579 | - calc.to.from = base("$from").up(); | |
1580 | - calc.to.from.string = "0s"; | |
1579 | + calc.to.from__ = base("$from").up(); | |
1580 | + calc.to.from__.string = "0s"; | |
1581 | 1581 | calc.to.string = "1s"; |
1582 | 1582 | calc.to.degit = 1; |
1583 | 1583 | expect(calc.call()(0.1)).toBe("0.5s"); |
@@ -1585,61 +1585,61 @@ describe("SMIL Animation Spec", function() { | ||
1585 | 1585 | calc = base("$calcMode").up(); |
1586 | 1586 | calc.keyTime = 0.5; |
1587 | 1587 | calc.to = base("$from").up(); |
1588 | - calc.to.from = base("$from").up(); | |
1589 | - calc.to.from.string = "rgb(100, 20, 32)"; | |
1588 | + calc.to.from__ = base("$from").up(); | |
1589 | + calc.to.from__.string = "rgb(100, 20, 32)"; | |
1590 | 1590 | calc.to.string = "rgb(0, 10, 50)"; |
1591 | 1591 | expect(calc.call()(0.25)).toBe("rgb(50, 15, 41)"); |
1592 | 1592 | |
1593 | 1593 | /*paced mode*/ |
1594 | 1594 | calc.to = base("$from").up(); |
1595 | - calc.to.from = base("$from").up(); | |
1595 | + calc.to.from__ = base("$from").up(); | |
1596 | 1596 | calc.mode = "paced"; |
1597 | 1597 | calc.norm = 100; |
1598 | - calc.to.from.string = "0s"; | |
1598 | + calc.to.from__.string = "0s"; | |
1599 | 1599 | calc.to.string = "20s"; |
1600 | 1600 | calc.to.degit = 1; |
1601 | 1601 | expect(calc.call()(0.1)).toBe("10.0s"); |
1602 | 1602 | expect(calc.keyTime).toBe(0.2); |
1603 | 1603 | |
1604 | 1604 | calc.to = base("$from").up(); |
1605 | - calc.to.from = base("$from").up(); | |
1605 | + calc.to.from__ = base("$from").up(); | |
1606 | 1606 | calc.mode = "paced"; |
1607 | 1607 | calc.norm = 100; |
1608 | - calc.to.from.string = "rgb(0, 0, 20)"; | |
1608 | + calc.to.from__.string = "rgb(0, 0, 20)"; | |
1609 | 1609 | calc.to.string = "rgb(0, 0, 0)"; |
1610 | 1610 | expect(calc.call()(0.1)).toBe("rgb(0, 0, 10)"); |
1611 | 1611 | expect(calc.keyTime).toBe(0.2); |
1612 | 1612 | |
1613 | 1613 | /*discrete mode*/ |
1614 | 1614 | calc.to = base("$from").up(); |
1615 | - calc.to.from = base("$from").up(); | |
1615 | + calc.to.from__ = base("$from").up(); | |
1616 | 1616 | calc.mode = "discrete"; |
1617 | 1617 | calc.keyTime = 0.5; |
1618 | 1618 | calc.to.degit = 1; |
1619 | 1619 | calc.to.string = "1"; |
1620 | - calc.to.from.string = "0.5"; | |
1620 | + calc.to.from__.string = "0.5"; | |
1621 | 1621 | expect(calc.call()(0.2)).toBe("0.5"); |
1622 | 1622 | expect(calc.call()(0.3)).toBe("0.5"); |
1623 | 1623 | /*もう一度確かめる*/ |
1624 | 1624 | expect(calc.call()(0.2)).toBe("0.5"); |
1625 | 1625 | |
1626 | 1626 | calc.to = base("$from").up(); |
1627 | - calc.to.from = base("$from").up(); | |
1627 | + calc.to.from__ = base("$from").up(); | |
1628 | 1628 | calc.mode = "discrete"; |
1629 | 1629 | calc.keyTime = 0.5; |
1630 | 1630 | calc.to.degit = 1; |
1631 | 1631 | calc.to.string = "block"; |
1632 | - calc.to.from.string = "inline"; | |
1632 | + calc.to.from__.string = "inline"; | |
1633 | 1633 | expect(calc.call()(0.2)).toBe("inline"); |
1634 | 1634 | expect(calc.call()(0.3)).toBe("inline"); |
1635 | 1635 | |
1636 | 1636 | calc.to = base("$from").up(); |
1637 | - calc.to.from = base("$from").up(); | |
1637 | + calc.to.from__ = base("$from").up(); | |
1638 | 1638 | calc.mode = "linear"; |
1639 | 1639 | calc.keyTime = 1; |
1640 | 1640 | calc.to.degit = 1; |
1641 | 1641 | calc.to.string = "1 1"; |
1642 | - calc.to.from.string = "0.0 1"; | |
1642 | + calc.to.from__.string = "0.0 1"; | |
1643 | 1643 | expect(calc.call()(0.2)).toBe("0.2 1.0"); |
1644 | 1644 | expect(calc.call()(0.3)).toBe("0.3 1.0"); |
1645 | 1645 | } ); |
@@ -1658,7 +1658,7 @@ describe("SMIL Animation Spec", function() { | ||
1658 | 1658 | |
1659 | 1659 | calc = base("$calcMode").up(); |
1660 | 1660 | calc.mode = "paced"; |
1661 | - calc.to.from = from; | |
1661 | + calc.to.from__ = from; | |
1662 | 1662 | expect(calc.call()()).toBe(calc.string); |
1663 | 1663 | |
1664 | 1664 | calc = base("$calcMode").up(); |
@@ -1683,11 +1683,11 @@ describe("SMIL Animation Spec", function() { | ||
1683 | 1683 | expect( calc.call()("undef")).toBe(Math.PI); |
1684 | 1684 | calc.keySplines = [0, 0, 1, 1]; |
1685 | 1685 | calc.to.degit = 1; |
1686 | - calc.to.from = from; | |
1686 | + calc.to.from__ = from; | |
1687 | 1687 | expect(calc.call()(0)).toBe(bezier(0,0, 0,0, 1,1, 1,1)(0)+".0"); |
1688 | - calc.to.from = from; | |
1688 | + calc.to.from__ = from; | |
1689 | 1689 | expect(calc.call()(1)).toBe(bezier(0,0, 0,0, 1,1, 1,1)(1)+".0"); |
1690 | - calc.to.from = from; | |
1690 | + calc.to.from__ = from; | |
1691 | 1691 | expect(calc.call()(0.5)).toBe(bezier(0,0, 0,0, 1,1, 1,1)(0.5)+""); |
1692 | 1692 | |
1693 | 1693 | df(0,0, 0,0, 1,1, 1,1, 0.1); |
@@ -1724,9 +1724,9 @@ describe("SMIL Animation Spec", function() { | ||
1724 | 1724 | calc.to.degit = 1; |
1725 | 1725 | var b = bezier(0,0, 0,0.5, 0.5,1, 1,1); |
1726 | 1726 | expect(calc.call()(0)).toBe(b(0).y+".0"); |
1727 | - calc.to.from = from; | |
1727 | + calc.to.from__ = from; | |
1728 | 1728 | expect(calc.call()(1)).toBe(b(1).y+".0"); |
1729 | - calc.to.from = from; | |
1729 | + calc.to.from__ = from; | |
1730 | 1730 | expect(calc.call()( b(0.5).x )).toBe(b(0.5).y.toFixed(1)); |
1731 | 1731 | |
1732 | 1732 | var ff = function(k) { |
@@ -1735,9 +1735,9 @@ describe("SMIL Animation Spec", function() { | ||
1735 | 1735 | var b = bezier(0,0, k[0],k[1], k[2],k[3], 1,1), |
1736 | 1736 | epsilon = 1e-5; //誤差 |
1737 | 1737 | expect(calc.call()(0)).toBe(b(0).y.toFixed(10)); |
1738 | - calc.to.from = from; | |
1738 | + calc.to.from__ = from; | |
1739 | 1739 | expect(calc.call()(1)).toBe(b(1).y.toFixed(10)); |
1740 | - calc.to.from = from; | |
1740 | + calc.to.from__ = from; | |
1741 | 1741 | b = b(Math.random()); |
1742 | 1742 | expect(Math.abs(calc.call()(b.x) - b.y.toFixed(10))).toBeLessThan(epsilon); |
1743 | 1743 | }; |
@@ -1751,18 +1751,18 @@ describe("SMIL Animation Spec", function() { | ||
1751 | 1751 | calc.mode = "spline"; |
1752 | 1752 | calc.keySplines = [0, NaN, 1, 1]; |
1753 | 1753 | calc.to.degit = 1; |
1754 | - calc.to.from = from; | |
1754 | + calc.to.from__ = from; | |
1755 | 1755 | expect( calc.up().call()("undef")).toBe(Math.PI); |
1756 | 1756 | |
1757 | 1757 | |
1758 | 1758 | calc.keySplines = [0, 0, 1, 2]; |
1759 | 1759 | calc.to.degit = 1; |
1760 | - calc.to.from = from; | |
1760 | + calc.to.from__ = from; | |
1761 | 1761 | expect( calc.up().call()("undef")).toBe(Math.PI); |
1762 | 1762 | |
1763 | 1763 | calc.keySplines = null; |
1764 | 1764 | calc.to.degit = 1; |
1765 | - calc.to.from = from; | |
1765 | + calc.to.from__ = from; | |
1766 | 1766 | expect( calc.up().call()("undef")).toBe(Math.PI); |
1767 | 1767 | } ); |
1768 | 1768 | } ); |
@@ -1960,13 +1960,13 @@ describe("SMIL Animation Spec", function() { | ||
1960 | 1960 | expect(attr.setValues("")).toBeNull(); |
1961 | 1961 | |
1962 | 1962 | expect(attr.setValues("0;1")[0].to.string).toBe("1"); |
1963 | - expect(attr.setValues("0;1")[0].to.from.string).toBe("0"); | |
1964 | - expect(attr.setValues("0;1", "0", "1", "1")[0].to.from.string).toBe("0"); | |
1965 | - expect(attr.setValues("0;1", null, "1", "0")[0].to.from.string).toBe("0"); | |
1963 | + expect(attr.setValues("0;1")[0].to.from__.string).toBe("0"); | |
1964 | + expect(attr.setValues("0;1", "0", "1", "1")[0].to.from__.string).toBe("0"); | |
1965 | + expect(attr.setValues("0;1", null, "1", "0")[0].to.from__.string).toBe("0"); | |
1966 | 1966 | |
1967 | 1967 | /*from-to アニメーション*/ |
1968 | 1968 | expect(attr.setValues(null, "0", "1")[0].to.string).toBe("1"); |
1969 | - expect(attr.setValues(null, "0", "1")[0].to.from.string).toBe("0"); | |
1969 | + expect(attr.setValues(null, "0", "1")[0].to.from__.string).toBe("0"); | |
1970 | 1970 | |
1971 | 1971 | /*from-by アニメーション*/ |
1972 | 1972 | expect(attr.setValues(null, "1", null, "1")[0].to.string).toBe("1"); |
@@ -1975,7 +1975,7 @@ describe("SMIL Animation Spec", function() { | ||
1975 | 1975 | |
1976 | 1976 | /*fromなしto アニメーション*/ |
1977 | 1977 | expect(attr.setValues(null, null, "1")[0].to.string).toBe("1"); |
1978 | - expect(attr.setValues(null, null, "1")[0].to.from.string).toBe("0"); | |
1978 | + expect(attr.setValues(null, null, "1")[0].to.from__.string).toBe("0"); | |
1979 | 1979 | var aset = attr.setValues(null, null, "1")[0].to; |
1980 | 1980 | aset.call(); |
1981 | 1981 | expect(aset.from[0]).toBe(0); |
@@ -2049,12 +2049,12 @@ describe("SMIL Animation Spec", function() { | ||
2049 | 2049 | s.setAttributeNS(null, "from", "0"); |
2050 | 2050 | attr.setKey(s); |
2051 | 2051 | s.setAttributeNS(null, "to", "0"); |
2052 | - expect(attr.setKey(s)[0].to.from.string).toBe("0"); | |
2052 | + expect(attr.setKey(s)[0].to.from__.string).toBe("0"); | |
2053 | 2053 | expect(attr.setKey(s)[0].to.string).toBe("0"); |
2054 | 2054 | s.setAttributeNS(null, "by", "0"); |
2055 | 2055 | attr.setKey(s); |
2056 | 2056 | s.setAttributeNS(null, "values", "0;2"); |
2057 | - expect(attr.setKey(s)[0].to.from.string).toBe("0"); | |
2057 | + expect(attr.setKey(s)[0].to.from__.string).toBe("0"); | |
2058 | 2058 | expect(attr.setKey(s)[0].to.string).toBe("2"); |
2059 | 2059 | |
2060 | 2060 | s.setAttributeNS(null, "keyTimes", "0;0.1"); |