LibWeb: Implement performance.now()

This patch introduces the HighResolutionTime namespace which is home to
the Performance object (exposed via window.performance)

performance.now() is currently the only function, and it returns the
number of milliseconds since the window object was constructed. :^)
This commit is contained in:
Andreas Kling 2020-09-29 18:19:18 +02:00
commit 97d0acc5b6
Notes: sideshowbarker 2024-07-19 02:07:50 +09:00
10 changed files with 155 additions and 1 deletions

View file

@ -30,6 +30,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Timer.h>
#include <LibWeb/DOM/Window.h>
#include <LibWeb/HighResolutionTime/Performance.h>
#include <LibWeb/InProcessWebView.h>
#include <LibWeb/Page/Frame.h>
@ -42,6 +43,7 @@ NonnullRefPtr<Window> Window::create_with_document(Document& document)
Window::Window(Document& document)
: m_document(document)
, m_performance(make<HighResolutionTime::Performance>(*this))
{
}