OSDN Git Service

Lighten the step function
authordhrname <dhrname@users.sourceforge.jp>
Fri, 11 Nov 2016 14:00:59 +0000 (23:00 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Fri, 11 Nov 2016 14:00:59 +0000 (23:00 +0900)
org/w3c/dom/smil.js

index 45ed0f7..0e7a950 100644 (file)
@@ -2104,19 +2104,18 @@ if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Anim
        handle: null\r
       };\r
     (function(frame) {\r
-      var $frame = base("$frame"),\r
-          _cancel = cancel; /*cancelのエイリアス*/\r
-      _cancel.handle = requestAnimationFrame(step);\r
-      function step() {\r
-        if (!$frame.isPaused) {\r
+      var _cancel = cancel; /*cancelのエイリアス*/\r
+      var step = function () {\r
+        if (!this.isPaused) {\r
           frame++;\r
           try {\r
-            $frame.setFrame(frame);\r
+            this.setFrame(frame);\r
           } catch(e) {\r
           }\r
           _cancel.handle = requestAnimationFrame(step);\r
         }\r
-      };\r
+      }.bind(base("$frame"));\r
+      _cancel.handle = requestAnimationFrame(step);\r
     })(-1);\r
     return cancel;\r
   } else {\r