• R/O
  • HTTP
  • SSH
  • HTTPS

sie: コミット

ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)


コミットメタ情報

リビジョン73f7b14af89ffd55be08d45060c01547b62eeb71 (tree)
日時2015-10-24 22:58:05
作者dhrname <dhrname@user...>
コミッターdhrname

ログメッセージ

Modify the setFrame method and the setTimeTable for a repeatEvent

変更サマリ

差分

--- a/org/w3c/dom/smil.js
+++ b/org/w3c/dom/smil.js
@@ -1257,11 +1257,12 @@ base("$frame").up("$svgEvent").mix( {
12571257 /*活動継続時間と単純持続時間が異なるとき、repeatイベントを設定
12581258 * ただし、repeatイベントはendイベントが発生する前に起きるものと仮定*/
12591259 first.next = {
1260- frame: begin+simpleDur,
1260+ firstFrame: begin + simpleDur,
1261+ frame: begin + simpleDur,
12611262 eventType: "repeat",
12621263 target: target,
1263- /*リピートの制限回数*/
1264- limit: Math.floor(activeTime / simpleDur),
1264+ /*リピートの制限時間*/
1265+ limit: begin + activeTime,
12651266 /*リピートの回数 (n >= 1)*/
12661267 count: 1,
12671268 simpleDuration: simpleDur,
@@ -1292,12 +1293,23 @@ base("$frame").up("$svgEvent").mix( {
12921293 if (frame <= num) {
12931294 /*IE11ではSVGEventsやDOMEventsを使うと問題が起きるため、MouseEventsで代用する*/
12941295 var evt = target.ownerDocument.createEvent("MouseEvents");
1295- if ( (obj.eventType === "repeat") && (obj.count < obj.limit) ) {
1296+ if (obj.eventType === "repeat") {
12961297 /*リピートイベントが、リピート制限内である場合
12971298 *numの段階で、何回リピートしたかを求める*/
1298- obj.count += floor( (num - frame) / obj.simpleDuration);
1299+ obj.count = floor( (num - obj.firstFrame) / obj.simpleDuration) + 1;
1300+ /*simpleDurationを足すことによって、リピートイベントが
1301+ * 単純継続時間内に何度も繰り返されることを防ぐ*/
1302+ frame += obj.simpleDuration;
1303+ obj.frame = frame;
12991304 detail = obj.count;
1300- cobj = obj;
1305+ if (frame >= obj.limit) {
1306+ cobj.next = obj.next;
1307+ if (this.first === obj) {
1308+ cobj = this.first = obj.next;
1309+ }
1310+ } else {
1311+ cobj = obj;
1312+ }
13011313 } else {
13021314 /*ポインタの連結を変更することで、リストからobj を除去*/
13031315 cobj.next = obj.next;
--- a/tool/Spec/spec/SvgDomSpec.js
+++ b/tool/Spec/spec/SvgDomSpec.js
@@ -4339,9 +4339,10 @@ describe("SMIL Animation Spec", function() {
43394339 eventType: "begin",
43404340 target: ele,
43414341
4342- next: { frame: 10,
4342+ next: { firstFrame: 10,
4343+ frame: 10,
43434344 eventType: "repeat",
4344- limit: 1,
4345+ limit: 12,
43454346 count: 1,
43464347 simpleDuration: 9,
43474348 target: ele,
@@ -4375,9 +4376,10 @@ describe("SMIL Animation Spec", function() {
43754376 eventType: "begin",
43764377 target: ele,
43774378
4378- next: { frame: 5,
4379+ next: {firstFrame:5,
4380+ frame: 5,
43794381 eventType: "repeat",
4380- limit: 2,
4382+ limit: 11,
43814383 count: 1,
43824384 simpleDuration: 4,
43834385 target: ele,
@@ -4397,11 +4399,11 @@ describe("SMIL Animation Spec", function() {
43974399 expect(frame.first).toEqual(a);
43984400 frame.setFrame(5);
43994401 a.count = 1;
4402+ a.frame = 9;
44004403 expect(frame.first).toEqual(a);
44014404
44024405 ele.addEventListener("repeatEvent", function(evt) {
44034406 expect(evt.target).toBe(ele);
4404- expect(evt.detail).toBe(2);
44054407 } );
44064408 frame.timelines = [];
44074409 frame.first = null;
@@ -4414,7 +4416,7 @@ describe("SMIL Animation Spec", function() {
44144416 }) );
44154417 frame.setFrame(9);
44164418 a.count = 2;
4417- a.limit = 3;
4419+ a.limit = 16;
44184420 a.next.frame = 16;
44194421 expect(frame.first).toEqual(a);
44204422 } );
旧リポジトリブラウザで表示