1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
parent 950e819ee7
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/NavigationTiming/EntryNames.h>
namespace Web::NavigationTiming::EntryNames {
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) FlyString name;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
void initialize_strings()
{
static bool s_initialized = false;
VERIFY(!s_initialized);
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) \
name = #name##_fly_string;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
s_initialized = true;
}
}

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
namespace Web::NavigationTiming::EntryNames {
#define ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(navigationStart, navigation_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(unloadEventStart, unload_event_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(unloadEventEnd, unload_event_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(redirectStart, redirect_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(redirectEnd, redirect_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(fetchStart, fetch_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domainLookupStart, domain_lookup_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domainLookupEnd, domain_lookup_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(connectStart, connect_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(connectEnd, connect_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(secureConnectionStart, secure_connection_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(requestStart, request_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(responseStart, response_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(responseEnd, response_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domLoading, dom_loading) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domInteractive, dom_interactive) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domContentLoadedEventStart, dom_content_loaded_event_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domContentLoadedEventEnd, dom_content_loaded_event_end) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(domComplete, dom_complete) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(loadEventStart, load_event_start) \
__ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(loadEventEnd, load_event_end)
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) extern FlyString name;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
void initialize_strings();
}

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2024, Colin Reeder <colin@vpzom.click>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Bindings/PerformanceNavigationPrototype.h>
#include <LibWeb/NavigationTiming/PerformanceNavigation.h>
namespace Web::NavigationTiming {
JS_DEFINE_ALLOCATOR(PerformanceNavigation);
PerformanceNavigation::PerformanceNavigation(JS::Realm& realm, u16 type, u16 redirect_count)
: PlatformObject(realm)
, m_type(type)
, m_redirect_count(redirect_count)
{
}
PerformanceNavigation::~PerformanceNavigation() = default;
void PerformanceNavigation::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceNavigation);
}
u16 PerformanceNavigation::type() const
{
return m_type;
}
u16 PerformanceNavigation::redirect_count() const
{
return m_redirect_count;
}
}

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2024, Colin Reeder <colin@vpzom.click>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::NavigationTiming {
class PerformanceNavigation final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(PerformanceNavigation, Bindings::PlatformObject);
JS_DECLARE_ALLOCATOR(PerformanceNavigation);
public:
~PerformanceNavigation();
u16 type() const;
u16 redirect_count() const;
private:
explicit PerformanceNavigation(JS::Realm&, u16 type, u16 redirect_count);
void initialize(JS::Realm&) override;
u16 m_type;
u16 m_redirect_count;
};
}

View file

@ -0,0 +1,10 @@
[Exposed=Window]
interface PerformanceNavigation {
const unsigned short TYPE_NAVIGATE = 0;
const unsigned short TYPE_RELOAD = 1;
const unsigned short TYPE_BACK_FORWARD = 2;
const unsigned short TYPE_RESERVED = 255;
readonly attribute unsigned short type;
readonly attribute unsigned short redirectCount;
[Default] object toJSON();
};

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/PerformanceTimingPrototype.h>
#include <LibWeb/NavigationTiming/PerformanceTiming.h>
namespace Web::NavigationTiming {
JS_DEFINE_ALLOCATOR(PerformanceTiming);
PerformanceTiming::PerformanceTiming(JS::Realm& realm)
: PlatformObject(realm)
{
}
PerformanceTiming::~PerformanceTiming() = default;
void PerformanceTiming::initialize(JS::Realm& realm)
{
Base::initialize(realm);
WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceTiming);
}
}

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/HTML/Window.h>
namespace Web::NavigationTiming {
class PerformanceTiming final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(PerformanceTiming, Bindings::PlatformObject);
JS_DECLARE_ALLOCATOR(PerformanceTiming);
public:
using AllowOwnPtr = TrueType;
~PerformanceTiming();
u64 navigation_start() { return 0; }
u64 unload_event_start() { return 0; }
u64 unload_event_end() { return 0; }
u64 redirect_start() { return 0; }
u64 redirect_end() { return 0; }
u64 fetch_start() { return 0; }
u64 domain_lookup_start() { return 0; }
u64 domain_lookup_end() { return 0; }
u64 connect_start() { return 0; }
u64 connect_end() { return 0; }
u64 secure_connection_start() { return 0; }
u64 request_start() { return 0; }
u64 response_start() { return 0; }
u64 response_end() { return 0; }
u64 dom_loading() { return 0; }
u64 dom_interactive() { return 0; }
u64 dom_content_loaded_event_start() { return 0; }
u64 dom_content_loaded_event_end() { return 0; }
u64 dom_complete() { return 0; }
u64 load_event_start() { return 0; }
u64 load_event_end() { return 0; }
private:
explicit PerformanceTiming(JS::Realm&);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -0,0 +1,29 @@
// https://w3c.github.io/navigation-timing/#dom-performancetiming
[Exposed=Window]
interface PerformanceTiming {
readonly attribute unsigned long long navigationStart;
readonly attribute unsigned long long unloadEventStart;
readonly attribute unsigned long long unloadEventEnd;
readonly attribute unsigned long long redirectStart;
readonly attribute unsigned long long redirectEnd;
readonly attribute unsigned long long fetchStart;
readonly attribute unsigned long long domainLookupStart;
readonly attribute unsigned long long domainLookupEnd;
readonly attribute unsigned long long connectStart;
readonly attribute unsigned long long connectEnd;
readonly attribute unsigned long long secureConnectionStart;
readonly attribute unsigned long long requestStart;
readonly attribute unsigned long long responseStart;
readonly attribute unsigned long long responseEnd;
readonly attribute unsigned long long domLoading;
readonly attribute unsigned long long domInteractive;
readonly attribute unsigned long long domContentLoadedEventStart;
readonly attribute unsigned long long domContentLoadedEventEnd;
readonly attribute unsigned long long domComplete;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
[Default] object toJSON();
};