From: dhrname Date: Fri, 11 Nov 2016 14:00:59 +0000 (+0900) Subject: Lighten the step function X-Git-Url: http://git.osdn.net/view?p=sie%2Fsie.git;a=commitdiff_plain;h=f01545a80d300f41247ce6de34da94c9e38d463a Lighten the step function --- diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 45ed0f7..0e7a950 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -2104,19 +2104,18 @@ if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Anim handle: null }; (function(frame) { - var $frame = base("$frame"), - _cancel = cancel; /*cancelのエイリアス*/ - _cancel.handle = requestAnimationFrame(step); - function step() { - if (!$frame.isPaused) { + var _cancel = cancel; /*cancelのエイリアス*/ + var step = function () { + if (!this.isPaused) { frame++; try { - $frame.setFrame(frame); + this.setFrame(frame); } catch(e) { } _cancel.handle = requestAnimationFrame(step); } - }; + }.bind(base("$frame")); + _cancel.handle = requestAnimationFrame(step); })(-1); return cancel; } else {