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

@ -290,7 +290,7 @@ int main(int argc, char** argv)
return 1;
}
if (namespace_.is_one_of("DOM", "HTML", "UIEvents")) {
if (namespace_.is_one_of("DOM", "HTML", "UIEvents", "HighResolutionTime")) {
StringBuilder builder;
builder.append(namespace_);
builder.append("::");
@ -379,6 +379,8 @@ static void generate_header(const IDL::Interface& interface)
out() << "#include <LibWeb/HTML/" << interface.name << ".h>";
out() << "#elif __has_include(<LibWeb/UIEvents/" << interface.name << ".h>)";
out() << "#include <LibWeb/UIEvents/" << interface.name << ".h>";
out() << "#elif __has_include(<LibWeb/HighResolutionTime/" << interface.name << ".h>)";
out() << "#include <LibWeb/HighResolutionTime/" << interface.name << ".h>";
out() << "#endif";
if (wrapper_base_class != "Wrapper")