1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

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
parent 8cb789d061
commit 97d0acc5b6
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))
{
}