浏览代码

LibWeb: Pass the correct timestamp to requestAnimationFrame callbacks

The timestamp needs to be consistent with the "current high resolution
time" as reflected by window.performance.now
Andreas Kling 3 年之前
父节点
当前提交
97ea277f8f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWeb/DOM/Window.cpp

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Window.cpp

@@ -188,7 +188,7 @@ i32 Window::request_animation_frame(JS::FunctionObject& js_callback)
     auto callback = request_animation_frame_driver().add([this, handle = JS::make_handle(&js_callback)](i32 id) mutable {
         auto& function = *handle.cell();
         auto& vm = function.vm();
-        (void)vm.call(function, JS::js_undefined(), JS::Value((double)Core::DateTime::now().timestamp()));
+        (void)vm.call(function, JS::js_undefined(), JS::Value(performance().now()));
         if (vm.exception())
             vm.clear_exception();
         m_request_animation_frame_callbacks.remove(id);