diff --git a/.clang-format b/.clang-format index 2ee079f2bba..420e49cbfc0 100644 --- a/.clang-format +++ b/.clang-format @@ -19,6 +19,7 @@ RemoveSemicolon: true RequiresClausePosition: WithFollowing RequiresExpressionIndentation: OuterScope SpaceAfterTemplateKeyword: false +WrapNamespaceBodyWithEmptyLines: Always --- Language: ObjC diff --git a/AK/Array.h b/AK/Array.h index 0b43544f9ce..e60f0d864a8 100644 --- a/AK/Array.h +++ b/AK/Array.h @@ -15,6 +15,7 @@ namespace AK { namespace Detail { + // This type serves as the storage of 0-sized `AK::Array`s. While zero-length `T[0]` // is accepted as a GNU extension, it causes problems with UBSan in Clang 16. template @@ -22,6 +23,7 @@ struct EmptyArrayStorage { T& operator[](size_t) const { VERIFY_NOT_REACHED(); } constexpr operator T*() const { return nullptr; } }; + } template @@ -148,11 +150,13 @@ template Array(T, Types...) -> Array; namespace Detail { + template constexpr auto integer_sequence_generate_array([[maybe_unused]] T const offset, IntegerSequence) -> Array { return { { (offset + Is)... } }; } + } template @@ -163,11 +167,13 @@ constexpr auto iota_array(T const offset = {}) } namespace Detail { + template constexpr auto to_array_impl(T (&&a)[N], IndexSequence) -> Array { return { { a[Is]... } }; } + } template diff --git a/AK/Atomic.h b/AK/Atomic.h index c9e1203e499..7cb3c7d6746 100644 --- a/AK/Atomic.h +++ b/AK/Atomic.h @@ -455,6 +455,7 @@ public: return __atomic_is_lock_free(sizeof(m_value), &m_value); } }; + } #if USING_AK_GLOBALLY diff --git a/AK/CheckedFormatString.h b/AK/CheckedFormatString.h index b43b3015af1..324c3170ba9 100644 --- a/AK/CheckedFormatString.h +++ b/AK/CheckedFormatString.h @@ -126,11 +126,13 @@ consteval auto count_fmt_params(char const (&fmt)[N]) } return result; } + } #endif namespace AK::Format::Detail { + template struct CheckedFormatString { template @@ -206,6 +208,7 @@ private: StringView m_string; }; + } namespace AK { diff --git a/AK/Concepts.h b/AK/Concepts.h index 7a6286385e4..ae226f9ac4b 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -170,6 +170,7 @@ concept CallableAs = Detail::IsCallableWithArguments; #if !USING_AK_GLOBALLY namespace AK { + #endif using AK::Concepts::Arithmetic; using AK::Concepts::ArrayLike; @@ -195,5 +196,6 @@ using AK::Concepts::SpecializationOf; using AK::Concepts::Unsigned; using AK::Concepts::VoidFunction; #if !USING_AK_GLOBALLY + } #endif diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 08689934194..43daee7c8d8 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -46,6 +46,7 @@ namespace AK { */ namespace DistinctNumericFeature { + enum Arithmetic { }; enum CastToBool { }; enum CastToUnderlying { }; @@ -53,6 +54,7 @@ enum Comparison { }; enum Flags { }; enum Increment { }; enum Shift { }; + }; template @@ -304,6 +306,7 @@ struct Formatter> : Formatter { return Formatter::format(builder, value.value()); } }; + } #define AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, NAME, ...) \ diff --git a/AK/Enumerate.h b/AK/Enumerate.h index d824605e7dd..eadb30f6778 100644 --- a/AK/Enumerate.h +++ b/AK/Enumerate.h @@ -11,6 +11,7 @@ namespace AK { namespace Detail { + template class Enumerator { using IteratorType = decltype(declval().begin()); @@ -50,6 +51,7 @@ private: IteratorType m_iterator; IteratorType const m_end; }; + } template diff --git a/AK/Forward.h b/AK/Forward.h index 5c4efd1c2f9..2f5fa46b71b 100644 --- a/AK/Forward.h +++ b/AK/Forward.h @@ -14,10 +14,12 @@ namespace AK { namespace Detail { + template class ByteBuffer; class StringData; + } enum class TrailingCodePointTransformation : u8; diff --git a/AK/Function.h b/AK/Function.h index ae67c42f98f..d1a8a4b9004 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -57,6 +57,7 @@ namespace AK { #endif namespace Detail { + #ifdef AK_HAS_OBJC_ARC inline constexpr bool HaveObjcArc = true; #else @@ -65,6 +66,7 @@ inline constexpr bool HaveObjcArc = false; // validated in TestFunction.mm inline constexpr size_t block_layout_size = 32; + } template diff --git a/AK/GenericLexer.cpp b/AK/GenericLexer.cpp index 669348d0adc..47c4edefb3d 100644 --- a/AK/GenericLexer.cpp +++ b/AK/GenericLexer.cpp @@ -13,6 +13,7 @@ #include namespace AK { + // Consume a number of characters StringView GenericLexer::consume(size_t count) { diff --git a/AK/GenericShorthands.h b/AK/GenericShorthands.h index 06fe1bba743..63a62ad49d8 100644 --- a/AK/GenericShorthands.h +++ b/AK/GenericShorthands.h @@ -70,6 +70,7 @@ template { return (... && (forward(to_compare) >= forward(valid_values))); } + } #if USING_AK_GLOBALLY diff --git a/AK/HashTable.h b/AK/HashTable.h index 126e035db6f..26777db307e 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -793,6 +793,7 @@ private: size_t m_size { 0 }; size_t m_capacity { 0 }; }; + } #if USING_AK_GLOBALLY diff --git a/AK/IDAllocator.h b/AK/IDAllocator.h index 5026c9b8750..fdf41b9344e 100644 --- a/AK/IDAllocator.h +++ b/AK/IDAllocator.h @@ -48,6 +48,7 @@ private: HashTable m_allocated_ids; int m_minimum_value { 1 }; }; + } #if USING_AK_GLOBALLY diff --git a/AK/Math.h b/AK/Math.h index fe6c0c3d35a..600d0619da5 100644 --- a/AK/Math.h +++ b/AK/Math.h @@ -35,6 +35,7 @@ template constexpr T L2_E = 1.442695040888963407359924681001892137L; namespace Details { + template constexpr size_t product_even(); template<> @@ -48,6 +49,7 @@ template<> constexpr size_t product_odd<1>() { return 1; } template constexpr size_t product_odd() { return value * product_odd(); } + } template @@ -103,6 +105,7 @@ constexpr T fabs(T x) } namespace Rounding { + template constexpr T ceil(T num) { @@ -385,6 +388,7 @@ using Rounding::round_to; using Rounding::trunc; namespace Division { + template constexpr T fmod(T x, T y) { @@ -462,6 +466,7 @@ constexpr T remainder(T x, T y) return __builtin_remainderf(x, y); #endif } + } using Division::fmod; @@ -1036,6 +1041,7 @@ constexpr I clamp_to(T value) #undef CONSTEXPR_STATE #undef AARCH64_INSTRUCTION + } #if USING_AK_GLOBALLY diff --git a/AK/MemMem.h b/AK/MemMem.h index 3853858d487..d0cb71a3b7a 100644 --- a/AK/MemMem.h +++ b/AK/MemMem.h @@ -15,6 +15,7 @@ namespace AK { namespace Detail { + constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length, void const* needle, size_t needle_length) { VERIFY(needle_length < 32); @@ -40,6 +41,7 @@ constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length return nullptr; } + } template diff --git a/AK/NonnullRawPtr.h b/AK/NonnullRawPtr.h index eb53cba61ee..b290d60f27b 100644 --- a/AK/NonnullRawPtr.h +++ b/AK/NonnullRawPtr.h @@ -53,6 +53,7 @@ struct Traits> : public DefaultTraits> { }; namespace Detail { + template inline constexpr bool IsHashCompatible, T> = true; diff --git a/AK/Optional.h b/AK/Optional.h index f66f785fcd6..fe00c10b52a 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -17,6 +17,7 @@ namespace AK { namespace Detail { + template struct ConditionallyResultType; @@ -29,6 +30,7 @@ template struct ConditionallyResultType { using Type = T; }; + } template diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 3d6e3650893..605009b811d 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -207,6 +207,7 @@ struct Formatter> : Formatter { return Formatter::format(builder, value.ptr()); } }; + } #if USING_AK_GLOBALLY diff --git a/AK/SIMD.h b/AK/SIMD.h index f109899d02a..10438282af3 100644 --- a/AK/SIMD.h +++ b/AK/SIMD.h @@ -81,6 +81,7 @@ static_assert(vector_length == 4); static_assert(vector_length == 4); namespace Detail { + template struct IndexVectorFor; @@ -113,4 +114,5 @@ static_assert(IsSame, u64x4>); static_assert(IsSame, u32x4>); static_assert(IsSame, u64x4>); #endif + } diff --git a/AK/SIMDExtras.h b/AK/SIMDExtras.h index 41ce029ce44..cab6f1d635e 100644 --- a/AK/SIMDExtras.h +++ b/AK/SIMDExtras.h @@ -185,6 +185,7 @@ ALWAYS_INLINE static void store4_masked(VectorType v, UnderlyingType* a, Underly // Shuffle namespace Detail { + template ALWAYS_INLINE static T shuffle_impl(T a, Control control, IndexSequence) { diff --git a/AK/ScopeLogger.h b/AK/ScopeLogger.h index 5b6390aebc1..98951f391c1 100644 --- a/AK/ScopeLogger.h +++ b/AK/ScopeLogger.h @@ -12,6 +12,7 @@ #include namespace AK { + template class ScopeLogger { public: diff --git a/AK/SinglyLinkedList.h b/AK/SinglyLinkedList.h index 2ef119d6f3c..5df68200052 100644 --- a/AK/SinglyLinkedList.h +++ b/AK/SinglyLinkedList.h @@ -300,6 +300,7 @@ private: Node* m_tail { nullptr }; TSizeCalculationPolicy m_size_policy {}; }; + } #if USING_AK_GLOBALLY diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index fa2bdcb7116..39a0e0cf5c8 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -660,6 +660,7 @@ using EquivalentFunctionType = typename EquivalentFunctionTypeImpl::Ty #if !USING_AK_GLOBALLY namespace AK { + #endif using AK::Detail::AddConst; using AK::Detail::AddConstToReferencedType; @@ -738,5 +739,6 @@ using AK::Detail::TrueType; using AK::Detail::UnderlyingType; using AK::Detail::Void; #if !USING_AK_GLOBALLY + } #endif diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 7feb7a5a0d2..a7b6863595a 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -35,13 +35,16 @@ void compiletime_fail(Args...); using std::construct_at; using std::forward; using std::move; + } namespace AK::Detail { + template struct _RawPtr { using Type = T*; }; + } namespace AK { diff --git a/AK/StringBase.cpp b/AK/StringBase.cpp index 4819b2923f2..a348b8298d7 100644 --- a/AK/StringBase.cpp +++ b/AK/StringBase.cpp @@ -48,4 +48,5 @@ ErrorOr StringBase::substring_from_byte_offset_with_shared_superstri } return StringBase { TRY(Detail::StringData::create_substring(*m_impl.data, start, length)) }; } + } diff --git a/AK/StringBase.h b/AK/StringBase.h index ab74b1d5727..0b6ae00ad68 100644 --- a/AK/StringBase.h +++ b/AK/StringBase.h @@ -264,4 +264,5 @@ inline bool StringBase::operator==(StringBase const& other) const return m_impl.data == other.m_impl.data; return bytes() == other.bytes(); } + } diff --git a/AK/StringUtils.h b/AK/StringUtils.h index 31130df24da..d9e8c72cab5 100644 --- a/AK/StringUtils.h +++ b/AK/StringUtils.h @@ -14,8 +14,10 @@ namespace AK { namespace Detail { + template inline constexpr bool IsHashCompatible = true; + } enum class CaseSensitivity { diff --git a/AK/Time.cpp b/AK/Time.cpp index ff84eb51727..5acf0740a01 100644 --- a/AK/Time.cpp +++ b/AK/Time.cpp @@ -204,6 +204,7 @@ Duration Duration::from_half_sanitized(i64 seconds, i32 extra_seconds, u32 nanos } namespace { + #if defined(AK_OS_WINDOWS) # define CLOCK_REALTIME 0 # define CLOCK_MONOTONIC 1 diff --git a/AK/Time.h b/AK/Time.h index 8ac8502eaa5..967b9c13912 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -83,6 +83,7 @@ constexpr int weeks_in_year(int year) } namespace Detail { + // Integer division rounding towards negative infinity. // TODO: This feels like there should be an easier way to do this. template @@ -100,6 +101,7 @@ constexpr i64 mod_zeros_in_range(i64 begin, i64 end) { return floor_div_by(end - 1) - floor_div_by(begin - 1); } + } constexpr i64 years_to_days_since_epoch(int year) diff --git a/AK/Types.h b/AK/Types.h index 15aa9432f1a..bcc51874392 100644 --- a/AK/Types.h +++ b/AK/Types.h @@ -161,7 +161,9 @@ constexpr u64 PiB = KiB * KiB * KiB * KiB * KiB; constexpr u64 EiB = KiB * KiB * KiB * KiB * KiB * KiB; namespace AK_REPLACED_STD_NAMESPACE { // NOLINT(cert-dcl58-cpp) nullptr_t must be in ::std:: for some analysis tools + using nullptr_t = decltype(nullptr); + } namespace AK { diff --git a/AK/UFixedBigInt.h b/AK/UFixedBigInt.h index 09325fefe38..31cb65b6656 100644 --- a/AK/UFixedBigInt.h +++ b/AK/UFixedBigInt.h @@ -21,6 +21,7 @@ namespace AK { namespace Detail { + // As noted near the declaration of StaticStorage, bit_size is more like a hint for a storage size. // The effective bit size is `sizeof(StaticStorage<...>) * 8`. It is a programmer's responsibility // to ensure that the hinted bit_size is always greater than the actual integer size. @@ -497,6 +498,7 @@ bool operator==(BuiltInUFixedInt auto const& a, NotBuiltInUFixedInt auto const& int operator<=>(BuiltInUFixedInt auto const& a, NotBuiltInUFixedInt auto const& b) { return -b.operator<=>(a); } bool operator==(IntegerWrapper const& a, NotBuiltInUFixedInt auto const& b) { return b.operator==(a); } int operator<=>(IntegerWrapper const& a, NotBuiltInUFixedInt auto const& b) { return -b.operator<=>(a); } + } using Detail::UFixedBigInt; @@ -645,6 +647,7 @@ struct Formatter : StandardFormatter { return {}; } }; + } // these sizes should suffice for most usecases diff --git a/AK/Variant.h b/AK/Variant.h index 58a014da765..a04a1daf902 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -500,6 +500,7 @@ template struct TypeList> : TypeList { }; namespace Detail { + template struct FlattenVariant; diff --git a/AK/Vector.h b/AK/Vector.h index 28b2d0e05c1..b37003f974b 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -39,6 +39,7 @@ struct CanBePlacedInsideVectorHelper { template static constexpr bool value = requires(U&& u) { StorageType(forward(u)); }; }; + } template diff --git a/AK/kmalloc.cpp b/AK/kmalloc.cpp index 769a201ac18..181634fbbd1 100644 --- a/AK/kmalloc.cpp +++ b/AK/kmalloc.cpp @@ -63,7 +63,9 @@ void operator delete[](void* ptr, size_t) noexcept // This is usually provided by libstdc++ in most cases, and the kernel has its own definition in // Kernel/Heap/kmalloc.cpp. If neither of those apply, the following should suffice to not fail during linking. namespace AK_REPLACED_STD_NAMESPACE { + nothrow_t const nothrow; + } #endif diff --git a/Libraries/LibCore/DateTime.h b/Libraries/LibCore/DateTime.h index cb7ea441013..e478ffe8090 100644 --- a/Libraries/LibCore/DateTime.h +++ b/Libraries/LibCore/DateTime.h @@ -94,6 +94,7 @@ private: } namespace AK { + template<> struct Formatter : StandardFormatter { ErrorOr format(FormatBuilder& builder, Core::DateTime const& value) @@ -104,6 +105,7 @@ struct Formatter : StandardFormatter { value.hour(), value.minute(), value.second()); } }; + } namespace IPC { diff --git a/Libraries/LibCore/Directory.h b/Libraries/LibCore/Directory.h index 6b257339e56..ae495835402 100644 --- a/Libraries/LibCore/Directory.h +++ b/Libraries/LibCore/Directory.h @@ -65,6 +65,7 @@ private: } namespace AK { + template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Core::Directory const& directory) diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp index b66a73f74b7..da07647e2e2 100644 --- a/Libraries/LibCore/EventLoop.cpp +++ b/Libraries/LibCore/EventLoop.cpp @@ -17,6 +17,7 @@ namespace Core { namespace { + OwnPtr>& event_loop_stack_uninitialized() { thread_local OwnPtr> s_event_loop_stack = nullptr; @@ -29,6 +30,7 @@ Vector& event_loop_stack() the_stack = make>(); return *the_stack; } + } EventLoop::EventLoop() diff --git a/Libraries/LibCore/EventLoopImplementationUnix.cpp b/Libraries/LibCore/EventLoopImplementationUnix.cpp index f323d90bf92..b5f28114a6a 100644 --- a/Libraries/LibCore/EventLoopImplementationUnix.cpp +++ b/Libraries/LibCore/EventLoopImplementationUnix.cpp @@ -23,6 +23,7 @@ namespace Core { namespace { + struct ThreadData; class TimeoutSet; @@ -299,6 +300,7 @@ struct ThreadData { pid_t pid { 0 }; }; + } EventLoopImplementationUnix::EventLoopImplementationUnix() diff --git a/Libraries/LibCore/EventReceiver.h b/Libraries/LibCore/EventReceiver.h index 96152ad160e..b167bd1c457 100644 --- a/Libraries/LibCore/EventReceiver.h +++ b/Libraries/LibCore/EventReceiver.h @@ -188,6 +188,7 @@ struct AK::Formatter : AK::Formatter { }; namespace Core { + template inline void EventReceiver::for_each_child_of_type(Callback callback) requires IsBaseOf diff --git a/Libraries/LibCore/EventSwift.mm b/Libraries/LibCore/EventSwift.mm index e7f866bea82..ee3c678f048 100644 --- a/Libraries/LibCore/EventSwift.mm +++ b/Libraries/LibCore/EventSwift.mm @@ -8,6 +8,7 @@ #include namespace Core { + void deferred_invoke_block(EventLoop& event_loop, void (^invokee)(void)) { event_loop.deferred_invoke(invokee); diff --git a/Libraries/LibCore/Proxy.h b/Libraries/LibCore/Proxy.h index 7524716cf08..6ce883c6e7f 100644 --- a/Libraries/LibCore/Proxy.h +++ b/Libraries/LibCore/Proxy.h @@ -13,6 +13,7 @@ #include namespace Core { + // FIXME: Username/password support. struct ProxyData { enum Type { @@ -45,6 +46,7 @@ struct ProxyData { return proxy_data; } }; + } namespace IPC { diff --git a/Libraries/LibCrypto/ASN1/ASN1.cpp b/Libraries/LibCrypto/ASN1/ASN1.cpp index b49e276f674..741c8d989a5 100644 --- a/Libraries/LibCrypto/ASN1/ASN1.cpp +++ b/Libraries/LibCrypto/ASN1/ASN1.cpp @@ -236,4 +236,5 @@ done_parsing:; return UnixDateTime::from_unix_time_parts(year.value(), month.value(), day.value(), hour.value(), minute.value_or(0), seconds.value_or(0), milliseconds.value_or(0)); } + } diff --git a/Libraries/LibCrypto/Curves/SECPxxxr1.h b/Libraries/LibCrypto/Curves/SECPxxxr1.h index 9defc8dc8bc..fa22280ac1b 100644 --- a/Libraries/LibCrypto/Curves/SECPxxxr1.h +++ b/Libraries/LibCrypto/Curves/SECPxxxr1.h @@ -14,8 +14,10 @@ #include namespace { + // Used by ASN1 macros static String s_error_string; + } namespace Crypto::Curves { diff --git a/Libraries/LibCrypto/Hash/HashFunction.h b/Libraries/LibCrypto/Hash/HashFunction.h index 0400378e37a..7ca8d7b97b2 100644 --- a/Libraries/LibCrypto/Hash/HashFunction.h +++ b/Libraries/LibCrypto/Hash/HashFunction.h @@ -59,6 +59,7 @@ public: protected: virtual ~HashFunction() = default; }; + } template diff --git a/Libraries/LibDNS/Resolver.h b/Libraries/LibDNS/Resolver.h index e10f2a3199b..46fd98303d0 100644 --- a/Libraries/LibDNS/Resolver.h +++ b/Libraries/LibDNS/Resolver.h @@ -22,6 +22,7 @@ #include namespace DNS { + class Resolver; class LookupResult : public AtomicRefCounted diff --git a/Libraries/LibGC/Root.h b/Libraries/LibGC/Root.h index f9f100cea30..080ed5e9ee6 100644 --- a/Libraries/LibGC/Root.h +++ b/Libraries/LibGC/Root.h @@ -179,6 +179,7 @@ struct Formatter> : Formatter { }; namespace Detail { + template inline constexpr bool IsHashCompatible, T> = true; diff --git a/Libraries/LibGfx/ColorSpace.cpp b/Libraries/LibGfx/ColorSpace.cpp index 568f68823a5..076f27ea2bf 100644 --- a/Libraries/LibGfx/ColorSpace.cpp +++ b/Libraries/LibGfx/ColorSpace.cpp @@ -115,6 +115,7 @@ sk_sp& ColorSpace::color_space() } namespace IPC { + template<> ErrorOr encode(Encoder& encoder, Gfx::ColorSpace const& color_space) { @@ -141,4 +142,5 @@ ErrorOr decode(Decoder& decoder) auto color_space = SkColorSpace::Deserialize(buffer.data(), buffer.size()); return Gfx::ColorSpace { make<::Gfx::Details::ColorSpaceImpl>(move(color_space)) }; } + } diff --git a/Libraries/LibGfx/Filter.h b/Libraries/LibGfx/Filter.h index c59037ac61e..67ff839f258 100644 --- a/Libraries/LibGfx/Filter.h +++ b/Libraries/LibGfx/Filter.h @@ -40,4 +40,5 @@ struct ColorFilter { }; using Filter = Variant; + } diff --git a/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp b/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp index c64f314ca89..3a6343ff435 100644 --- a/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp +++ b/Libraries/LibGfx/ImageFormats/JPEGXLLoader.cpp @@ -270,4 +270,5 @@ ErrorOr> JPEGXLImageDecoderPlugin::icc_data() { return OptionalNone {}; } + } diff --git a/Libraries/LibGfx/ImageFormats/TIFFLoader.h b/Libraries/LibGfx/ImageFormats/TIFFLoader.h index 177306e4164..b530d394b3a 100644 --- a/Libraries/LibGfx/ImageFormats/TIFFLoader.h +++ b/Libraries/LibGfx/ImageFormats/TIFFLoader.h @@ -29,7 +29,9 @@ class ExifMetadata; // And it can be found at https://www.cipa.jp/e/std/std-sec.html namespace TIFF { + class TIFFLoadingContext; + } class TIFFImageDecoderPlugin : public ImageDecoderPlugin { diff --git a/Libraries/LibGfx/Matrix3x3.h b/Libraries/LibGfx/Matrix3x3.h index b4a99ee0a78..4f566865b45 100644 --- a/Libraries/LibGfx/Matrix3x3.h +++ b/Libraries/LibGfx/Matrix3x3.h @@ -26,6 +26,7 @@ constexpr static Vector3 operator*(Matrix3x3 const& m, Vector3 const& v typedef Matrix3x3 FloatMatrix3x3; typedef Matrix3x3 DoubleMatrix3x3; + } using Gfx::DoubleMatrix3x3; diff --git a/Libraries/LibGfx/Matrix4x4.h b/Libraries/LibGfx/Matrix4x4.h index d90992a6048..4441ca9e62b 100644 --- a/Libraries/LibGfx/Matrix4x4.h +++ b/Libraries/LibGfx/Matrix4x4.h @@ -86,6 +86,7 @@ Gfx::AffineTransform extract_2d_affine_transform(Matrix4x4 const& matrix) typedef Matrix4x4 FloatMatrix4x4; typedef Matrix4x4 DoubleMatrix4x4; + } using Gfx::DoubleMatrix4x4; diff --git a/Libraries/LibGfx/SkiaUtils.h b/Libraries/LibGfx/SkiaUtils.h index 8dc590a8d9c..fdf124cbbdf 100644 --- a/Libraries/LibGfx/SkiaUtils.h +++ b/Libraries/LibGfx/SkiaUtils.h @@ -134,4 +134,5 @@ constexpr SkSamplingOptions to_skia_sampling_options(Gfx::ScalingMode scaling_mo SkPath to_skia_path(Path const& path); sk_sp to_skia_image_filter(Gfx::Filter const& filter); sk_sp to_skia_blender(Gfx::CompositingAndBlendingOperator compositing_and_blending_operator); + } diff --git a/Libraries/LibIDL/IDLParser.cpp b/Libraries/LibIDL/IDLParser.cpp index 19ec6099779..256872f2cd5 100644 --- a/Libraries/LibIDL/IDLParser.cpp +++ b/Libraries/LibIDL/IDLParser.cpp @@ -1390,4 +1390,5 @@ Vector Parser::imported_files() const { return const_cast(this)->top_level_resolved_imports().keys(); } + } diff --git a/Libraries/LibIPC/Stub.h b/Libraries/LibIPC/Stub.h index 4a444cb4c79..91f016f1c9a 100644 --- a/Libraries/LibIPC/Stub.h +++ b/Libraries/LibIPC/Stub.h @@ -12,7 +12,9 @@ #include namespace AK { + class BufferStream; + } namespace IPC { diff --git a/Libraries/LibJS/Bytecode/IdentifierTable.h b/Libraries/LibJS/Bytecode/IdentifierTable.h index 44018d6bbe8..5c1f1703ca0 100644 --- a/Libraries/LibJS/Bytecode/IdentifierTable.h +++ b/Libraries/LibJS/Bytecode/IdentifierTable.h @@ -37,6 +37,7 @@ private: } namespace AK { + template<> class Optional : public OptionalBase { template diff --git a/Libraries/LibJS/Bytecode/Interpreter.cpp b/Libraries/LibJS/Bytecode/Interpreter.cpp index 5ab5b96d0d3..904b1b4a204 100644 --- a/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -51,6 +51,7 @@ struct PropertyKeyAndEnumerableFlag { } namespace AK { + template<> struct Traits : public DefaultTraits { static unsigned hash(JS::PropertyKeyAndEnumerableFlag const& entry) @@ -63,6 +64,7 @@ struct Traits : public DefaultTraits::equals(a.key, b.key); } }; + } namespace JS::Bytecode { diff --git a/Libraries/LibJS/Bytecode/Op.h b/Libraries/LibJS/Bytecode/Op.h index a1f2ea47cb4..56737394b3c 100644 --- a/Libraries/LibJS/Bytecode/Op.h +++ b/Libraries/LibJS/Bytecode/Op.h @@ -27,7 +27,9 @@ #include namespace JS { + class FunctionExpression; + } namespace JS::Bytecode::Op { diff --git a/Libraries/LibJS/Bytecode/Operand.h b/Libraries/LibJS/Bytecode/Operand.h index 874a046f1a3..ccda535bafe 100644 --- a/Libraries/LibJS/Bytecode/Operand.h +++ b/Libraries/LibJS/Bytecode/Operand.h @@ -71,6 +71,7 @@ static_assert(sizeof(Operand) == 8); } namespace AK { + template<> class Optional : public OptionalBase { template diff --git a/Libraries/LibJS/Bytecode/StringTable.h b/Libraries/LibJS/Bytecode/StringTable.h index e9ed4bef75c..48a2ac31fdd 100644 --- a/Libraries/LibJS/Bytecode/StringTable.h +++ b/Libraries/LibJS/Bytecode/StringTable.h @@ -37,6 +37,7 @@ private: } namespace AK { + template<> class Optional : public OptionalBase { template diff --git a/Libraries/LibJS/Forward.h b/Libraries/LibJS/Forward.h index 3613eecbe53..32ff57af473 100644 --- a/Libraries/LibJS/Forward.h +++ b/Libraries/LibJS/Forward.h @@ -268,6 +268,7 @@ JS_ENUMERATE_TYPED_ARRAYS #undef __JS_ENUMERATE namespace Intl { + #define __JS_ENUMERATE(ClassName, snake_name, ConstructorName, PrototypeName) \ class ClassName; \ class ConstructorName; \ @@ -284,9 +285,11 @@ class Segments; class SegmentsPrototype; struct ResolutionOptionDescriptor; + }; namespace Temporal { + #define __JS_ENUMERATE(ClassName, snake_name, ConstructorName, PrototypeName) \ class ClassName; \ class ConstructorName; \ @@ -309,6 +312,7 @@ struct PartialDuration; struct Time; struct TimeZone; struct TimeZoneOffset; + }; template @@ -316,6 +320,7 @@ requires(!IsLvalueReference) class ThrowCompletionOr; namespace Bytecode { + class BasicBlock; enum class Builtin : u8; class Executable; @@ -325,6 +330,7 @@ class Interpreter; class Operand; class RegexTable; class Register; + } } diff --git a/Libraries/LibJS/Parser.h b/Libraries/LibJS/Parser.h index fa8a8daf5c0..f2fee77a11a 100644 --- a/Libraries/LibJS/Parser.h +++ b/Libraries/LibJS/Parser.h @@ -342,4 +342,5 @@ private: HashMap m_token_memoizations; Program::Type m_program_type; }; + } diff --git a/Libraries/LibJS/Print.cpp b/Libraries/LibJS/Print.cpp index 0c77a3ccc63..202695dae98 100644 --- a/Libraries/LibJS/Print.cpp +++ b/Libraries/LibJS/Print.cpp @@ -1052,12 +1052,15 @@ ErrorOr print_value(JS::PrintContext& print_context, JS::Value value, Hash TRY(js_out(print_context, "\033[0m")); return {}; } + } namespace JS { + ErrorOr print(JS::Value value, PrintContext& print_context) { HashTable seen_objects; return print_value(print_context, value, seen_objects); } + } diff --git a/Libraries/LibJS/Print.h b/Libraries/LibJS/Print.h index eb7f4e3bd8f..68861e81e14 100644 --- a/Libraries/LibJS/Print.h +++ b/Libraries/LibJS/Print.h @@ -12,6 +12,7 @@ #include namespace JS { + struct PrintContext { JS::VM& vm; Stream& stream; @@ -19,4 +20,5 @@ struct PrintContext { }; ErrorOr print(JS::Value value, PrintContext&); + } diff --git a/Libraries/LibJS/Runtime/Error.h b/Libraries/LibJS/Runtime/Error.h index 6669236fe74..f3ab985adff 100644 --- a/Libraries/LibJS/Runtime/Error.h +++ b/Libraries/LibJS/Runtime/Error.h @@ -77,4 +77,5 @@ inline bool Object::fast_is() const { return is_error_object(); } DECLARE_NATIVE_ERROR(ClassName, snake_name, PrototypeName, ConstructorName) JS_ENUMERATE_NATIVE_ERRORS #undef __JS_ENUMERATE + } diff --git a/Libraries/LibJS/Runtime/PromiseCapability.cpp b/Libraries/LibJS/Runtime/PromiseCapability.cpp index e2b41331d8d..7e952a08690 100644 --- a/Libraries/LibJS/Runtime/PromiseCapability.cpp +++ b/Libraries/LibJS/Runtime/PromiseCapability.cpp @@ -34,6 +34,7 @@ void PromiseCapability::visit_edges(Cell::Visitor& visitor) } namespace { + struct ResolvingFunctions final : public Cell { GC_CELL(ResolvingFunctions, Cell); GC_DECLARE_ALLOCATOR(ResolvingFunctions); @@ -49,6 +50,7 @@ struct ResolvingFunctions final : public Cell { } }; GC_DEFINE_ALLOCATOR(ResolvingFunctions); + } // 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability diff --git a/Libraries/LibJS/Runtime/ValueTraits.h b/Libraries/LibJS/Runtime/ValueTraits.h index f99653dafea..9dd8fc3f095 100644 --- a/Libraries/LibJS/Runtime/ValueTraits.h +++ b/Libraries/LibJS/Runtime/ValueTraits.h @@ -13,6 +13,7 @@ #include namespace JS { + struct ValueTraits : public Traits { static unsigned hash(Value value) { diff --git a/Libraries/LibLine/InternalFunctions.cpp b/Libraries/LibLine/InternalFunctions.cpp index 94884fdb84d..a07895ee118 100644 --- a/Libraries/LibLine/InternalFunctions.cpp +++ b/Libraries/LibLine/InternalFunctions.cpp @@ -446,6 +446,7 @@ void Editor::enter_search() } namespace { + Optional read_unicode_char() { // FIXME: It would be ideal to somehow communicate that the line editor is @@ -470,6 +471,7 @@ Optional read_unicode_char() return {}; } + } void Editor::search_character_forwards() @@ -768,4 +770,5 @@ void Editor::edit_in_external_editor() } } } + } diff --git a/Libraries/LibLine/Style.h b/Libraries/LibLine/Style.h index 458e1ba4740..8fc5c5edad7 100644 --- a/Libraries/LibLine/Style.h +++ b/Libraries/LibLine/Style.h @@ -194,4 +194,5 @@ private: bool m_is_empty { true }; }; + } diff --git a/Libraries/LibMedia/Audio/Sample.h b/Libraries/LibMedia/Audio/Sample.h index 446d7962604..57bb60b0228 100644 --- a/Libraries/LibMedia/Audio/Sample.h +++ b/Libraries/LibMedia/Audio/Sample.h @@ -11,6 +11,7 @@ #include namespace Audio { + using AK::Exponentials::exp; using AK::Exponentials::log; // Constants for logarithmic volume. See Sample::linear_to_log diff --git a/Libraries/LibMedia/CodecID.h b/Libraries/LibMedia/CodecID.h index 432618137b8..9034ecec1d0 100644 --- a/Libraries/LibMedia/CodecID.h +++ b/Libraries/LibMedia/CodecID.h @@ -33,6 +33,7 @@ enum class CodecID : u32 { } namespace AK { + template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Media::CodecID value) @@ -82,4 +83,5 @@ struct Formatter : Formatter { return builder.put_string(codec); } }; + } diff --git a/Libraries/LibRegex/Forward.h b/Libraries/LibRegex/Forward.h index a7fb3e6005a..ce97e114814 100644 --- a/Libraries/LibRegex/Forward.h +++ b/Libraries/LibRegex/Forward.h @@ -10,6 +10,7 @@ #include namespace regex { + struct CompareTypeAndValuePair; enum class Error : u8; @@ -32,6 +33,7 @@ class OpCode_SaveNamedLeftCaptureGroup; class OpCode_SaveRightNamedCaptureGroup; class OpCode_Compare; class RegexStringView; + } using regex::ECMA262Parser; diff --git a/Libraries/LibRegex/RegexError.h b/Libraries/LibRegex/RegexError.h index dc756839841..2e6975a25f5 100644 --- a/Libraries/LibRegex/RegexError.h +++ b/Libraries/LibRegex/RegexError.h @@ -81,6 +81,7 @@ inline StringView get_error_string(Error error) } return "Undefined error."sv; } + } using regex::get_error_string; diff --git a/Libraries/LibRegex/RegexMatcher.cpp b/Libraries/LibRegex/RegexMatcher.cpp index d5c9784be52..dc4486d6a5f 100644 --- a/Libraries/LibRegex/RegexMatcher.cpp +++ b/Libraries/LibRegex/RegexMatcher.cpp @@ -603,6 +603,7 @@ template class Regex; template class Matcher; template class Regex; + } template diff --git a/Libraries/LibRegex/RegexMatcher.h b/Libraries/LibRegex/RegexMatcher.h index 6018cf556ee..da48a5fda2b 100644 --- a/Libraries/LibRegex/RegexMatcher.h +++ b/Libraries/LibRegex/RegexMatcher.h @@ -294,6 +294,7 @@ bool has_match(Vector const& views, Regex& pattern, Opt { return pattern.has_match(views, regex_options); } + } using regex::has_match; diff --git a/Libraries/LibRegex/RegexOptimizer.cpp b/Libraries/LibRegex/RegexOptimizer.cpp index 69eaa930ab8..0b3efa5d444 100644 --- a/Libraries/LibRegex/RegexOptimizer.cpp +++ b/Libraries/LibRegex/RegexOptimizer.cpp @@ -1813,4 +1813,5 @@ void Optimizer::append_character_class(ByteCode& target, Vector::run_optimization_passes(); template void Regex::run_optimization_passes(); template void Regex::run_optimization_passes(); + } diff --git a/Libraries/LibRegex/RegexParser.cpp b/Libraries/LibRegex/RegexParser.cpp index c7d47ab38f7..ddfb07712b1 100644 --- a/Libraries/LibRegex/RegexParser.cpp +++ b/Libraries/LibRegex/RegexParser.cpp @@ -2812,4 +2812,5 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis() m_total_number_of_capturing_parenthesis = count; return count; } + } diff --git a/Libraries/LibRequests/WebSocket.cpp b/Libraries/LibRequests/WebSocket.cpp index 7fdc1d67f2c..2001fd79de0 100644 --- a/Libraries/LibRequests/WebSocket.cpp +++ b/Libraries/LibRequests/WebSocket.cpp @@ -82,4 +82,5 @@ void WebSocket::did_request_certificates(Badge) dbgln("WebSocket: set_certificate failed"); } } + } diff --git a/Libraries/LibTest/TestCase.h b/Libraries/LibTest/TestCase.h index d55671cbf0a..275c9336461 100644 --- a/Libraries/LibTest/TestCase.h +++ b/Libraries/LibTest/TestCase.h @@ -109,6 +109,7 @@ private: // Helper to hide implementation of TestSuite from users void add_test_case_to_suite(NonnullRefPtr const& test_case); void set_suite_setup_function(Function setup); + } #define TEST_SETUP \ diff --git a/Libraries/LibTextCodec/Decoder.cpp b/Libraries/LibTextCodec/Decoder.cpp index 0056586477a..d2f72183bae 100644 --- a/Libraries/LibTextCodec/Decoder.cpp +++ b/Libraries/LibTextCodec/Decoder.cpp @@ -19,6 +19,7 @@ namespace TextCodec { static constexpr u32 replacement_code_point = 0xfffd; namespace { + Latin1Decoder s_latin1_decoder; UTF8Decoder s_utf8_decoder; UTF16BEDecoder s_utf16be_decoder; diff --git a/Libraries/LibTextCodec/Encoder.cpp b/Libraries/LibTextCodec/Encoder.cpp index fadf264d551..0a8007718cf 100644 --- a/Libraries/LibTextCodec/Encoder.cpp +++ b/Libraries/LibTextCodec/Encoder.cpp @@ -14,6 +14,7 @@ namespace TextCodec { namespace { + UTF8Encoder s_utf8_encoder; GB18030Encoder s_gb18030_encoder; GB18030Encoder s_gbk_encoder(GB18030Encoder::IsGBK::Yes); diff --git a/Libraries/LibURL/Forward.h b/Libraries/LibURL/Forward.h index 58c0a8ad7e7..61244e615e9 100644 --- a/Libraries/LibURL/Forward.h +++ b/Libraries/LibURL/Forward.h @@ -7,6 +7,7 @@ #pragma once namespace URL { + class Host; class Origin; class Parser; @@ -14,4 +15,5 @@ class Site; class URL; struct BlobURLEntry; + } diff --git a/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp b/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp index 34f5bb018fb..bda42c39b05 100644 --- a/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp +++ b/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp @@ -583,4 +583,5 @@ void AbstractMachine::visit_external_resources(HostVisitOps const& host) for (auto interpreter_ptr : m_active_interpreters) interpreter_ptr->visit_external_resources(host); } + } diff --git a/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp b/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp index 63ab2feec78..9ecb4082536 100644 --- a/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp +++ b/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp @@ -1669,4 +1669,5 @@ void DebuggerBytecodeInterpreter::interpret_instruction(Configuration& configura } } } + } diff --git a/Libraries/LibWasm/AbstractMachine/Validator.cpp b/Libraries/LibWasm/AbstractMachine/Validator.cpp index 10735debd09..950377039ba 100644 --- a/Libraries/LibWasm/AbstractMachine/Validator.cpp +++ b/Libraries/LibWasm/AbstractMachine/Validator.cpp @@ -3752,4 +3752,5 @@ ByteString Validator::Errors::find_instruction_name(SourceLocation const& locati return instruction_name(OpCode { *opcode }); } + } diff --git a/Libraries/LibWasm/Forward.h b/Libraries/LibWasm/Forward.h index 84006190ef1..9263fbad56e 100644 --- a/Libraries/LibWasm/Forward.h +++ b/Libraries/LibWasm/Forward.h @@ -14,7 +14,9 @@ struct ValidationError; struct Interpreter; namespace Wasi { + struct Implementation; + } } diff --git a/Libraries/LibWasm/Parser/Parser.cpp b/Libraries/LibWasm/Parser/Parser.cpp index 20f9e03d945..18270d93a2c 100644 --- a/Libraries/LibWasm/Parser/Parser.cpp +++ b/Libraries/LibWasm/Parser/Parser.cpp @@ -1378,4 +1378,5 @@ ByteString parse_error_to_byte_string(ParseError error) } return "Unknown error"; } + } diff --git a/Libraries/LibWasm/Printer/Printer.cpp b/Libraries/LibWasm/Printer/Printer.cpp index e7919afa2bb..1f52f87c7e2 100644 --- a/Libraries/LibWasm/Printer/Printer.cpp +++ b/Libraries/LibWasm/Printer/Printer.cpp @@ -700,6 +700,7 @@ void Printer::print(Wasm::Reference const& value) [](Wasm::Reference::Null const&) { return ByteString("null"); }, [](auto const& ref) { return ByteString::number(ref.address.value()); })); } + } HashMap Wasm::Names::instruction_names { diff --git a/Libraries/LibWasm/Types.h b/Libraries/LibWasm/Types.h index fd557ba5967..b82c333b959 100644 --- a/Libraries/LibWasm/Types.h +++ b/Libraries/LibWasm/Types.h @@ -1051,4 +1051,5 @@ private: ValidationStatus m_validation_status { ValidationStatus::Unchecked }; Optional m_validation_error; }; + } diff --git a/Libraries/LibWasm/WASI/Wasi.cpp b/Libraries/LibWasm/WASI/Wasi.cpp index 5ee6be35116..800f2e24ad6 100644 --- a/Libraries/LibWasm/WASI/Wasi.cpp +++ b/Libraries/LibWasm/WASI/Wasi.cpp @@ -1221,9 +1221,11 @@ FDFlags fd_flags_of(struct stat const&) FDFlags::Bits result {}; return FDFlags { result }; } + } namespace AK { + template<> struct Formatter : AK::Formatter { ErrorOr format(FormatBuilder& builder, Wasm::Wasi::Errno const& value) @@ -1291,4 +1293,5 @@ struct Formatter : AK::Formatter { return Formatter::format(builder, "size={}"sv, value.size); } }; + } diff --git a/Libraries/LibWasm/Wasi.h b/Libraries/LibWasm/Wasi.h index 3bd219e1c0c..43dc9d2bee3 100644 --- a/Libraries/LibWasm/Wasi.h +++ b/Libraries/LibWasm/Wasi.h @@ -98,10 +98,12 @@ using FileSize = LittleEndian; using Timestamp = LittleEndian; namespace Detail { + template struct __Pointer_tag; template struct __ConstPointer_tag; + } // NOTE: Might need to be updated if WASI ever supports memory64. diff --git a/Libraries/LibWeb/Animations/Animatable.h b/Libraries/LibWeb/Animations/Animatable.h index 158d6914912..95e30b0f540 100644 --- a/Libraries/LibWeb/Animations/Animatable.h +++ b/Libraries/LibWeb/Animations/Animatable.h @@ -12,7 +12,9 @@ #include namespace Web::CSS { + class CSSTransition; + } namespace Web::Animations { diff --git a/Libraries/LibWeb/CSS/CascadedProperties.cpp b/Libraries/LibWeb/CSS/CascadedProperties.cpp index 5e2ea38b700..9179a75ab03 100644 --- a/Libraries/LibWeb/CSS/CascadedProperties.cpp +++ b/Libraries/LibWeb/CSS/CascadedProperties.cpp @@ -10,6 +10,7 @@ #include namespace Web::CSS { + GC_DEFINE_ALLOCATOR(CascadedProperties); CascadedProperties::CascadedProperties() = default; diff --git a/Libraries/LibWeb/CSS/CharacterTypes.h b/Libraries/LibWeb/CSS/CharacterTypes.h index 7525554134a..b23b73ba61d 100644 --- a/Libraries/LibWeb/CSS/CharacterTypes.h +++ b/Libraries/LibWeb/CSS/CharacterTypes.h @@ -70,4 +70,5 @@ constexpr bool is_greater_than_maximum_allowed_code_point(u32 code_point) // The greatest code point defined by Unicode: U+10FFFF. return code_point > 0x10FFFF; } + } diff --git a/Libraries/LibWeb/CSS/Frequency.h b/Libraries/LibWeb/CSS/Frequency.h index 95b6cadefec..04bd8256f88 100644 --- a/Libraries/LibWeb/CSS/Frequency.h +++ b/Libraries/LibWeb/CSS/Frequency.h @@ -10,6 +10,7 @@ #include namespace Web::CSS { + class Frequency { public: enum class Type { diff --git a/Libraries/LibWeb/CSS/MediaQueryListEvent.h b/Libraries/LibWeb/CSS/MediaQueryListEvent.h index 49f73a21575..16b2f2f0973 100644 --- a/Libraries/LibWeb/CSS/MediaQueryListEvent.h +++ b/Libraries/LibWeb/CSS/MediaQueryListEvent.h @@ -37,4 +37,5 @@ private: String m_media; bool m_matches; }; + } diff --git a/Libraries/LibWeb/CSS/Number.h b/Libraries/LibWeb/CSS/Number.h index 74db9e79d68..5ec670bb9dd 100644 --- a/Libraries/LibWeb/CSS/Number.h +++ b/Libraries/LibWeb/CSS/Number.h @@ -90,6 +90,7 @@ private: double m_value { 0 }; Type m_type; }; + } template<> diff --git a/Libraries/LibWeb/CSS/Parser/ComponentValue.h b/Libraries/LibWeb/CSS/Parser/ComponentValue.h index 62bd83a1b90..4b48d8d375f 100644 --- a/Libraries/LibWeb/CSS/Parser/ComponentValue.h +++ b/Libraries/LibWeb/CSS/Parser/ComponentValue.h @@ -47,6 +47,7 @@ public: private: Variant m_value; }; + } template<> diff --git a/Libraries/LibWeb/CSS/Parser/Parser.h b/Libraries/LibWeb/CSS/Parser/Parser.h index 03710565d3a..f65e03574e3 100644 --- a/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Libraries/LibWeb/CSS/Parser/Parser.h @@ -41,6 +41,7 @@ namespace Web::CSS::Parser { class PropertyDependencyNode; namespace CalcParsing { + struct Operator { char delim; }; @@ -61,6 +62,7 @@ struct InvertNode { struct NegateNode { Node child; }; + } enum class ParsingMode { diff --git a/Libraries/LibWeb/CSS/Parser/Tokenizer.h b/Libraries/LibWeb/CSS/Parser/Tokenizer.h index a5e0d306bf0..e8c5ddf415e 100644 --- a/Libraries/LibWeb/CSS/Parser/Tokenizer.h +++ b/Libraries/LibWeb/CSS/Parser/Tokenizer.h @@ -106,4 +106,5 @@ private: Token::Position m_position; Token::Position m_prev_position; }; + } diff --git a/Libraries/LibWeb/CSS/Resolution.h b/Libraries/LibWeb/CSS/Resolution.h index 14b42fb5763..8287146a71a 100644 --- a/Libraries/LibWeb/CSS/Resolution.h +++ b/Libraries/LibWeb/CSS/Resolution.h @@ -52,4 +52,5 @@ private: Type m_type; double m_value { 0 }; }; + } diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 57fce2fd892..953a2597ddd 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -105,10 +105,12 @@ struct FontFaceKey { namespace AK { namespace Detail { + template<> inline constexpr bool IsHashCompatible = true; template<> inline constexpr bool IsHashCompatible = true; + } template<> diff --git a/Libraries/LibWeb/CSS/StyleSheetIdentifier.h b/Libraries/LibWeb/CSS/StyleSheetIdentifier.h index 7c2a8a780dd..9351505738f 100644 --- a/Libraries/LibWeb/CSS/StyleSheetIdentifier.h +++ b/Libraries/LibWeb/CSS/StyleSheetIdentifier.h @@ -29,6 +29,7 @@ struct StyleSheetIdentifier { StringView style_sheet_identifier_type_to_string(StyleSheetIdentifier::Type); Optional style_sheet_identifier_type_from_string(StringView); + } namespace IPC { diff --git a/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp index 645a1c5db3f..2e2a678084c 100644 --- a/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.cpp @@ -10,6 +10,7 @@ #include "BackgroundSizeStyleValue.h" namespace Web::CSS { + BackgroundSizeStyleValue::BackgroundSizeStyleValue(LengthPercentage size_x, LengthPercentage size_y) : StyleValueWithDefaultOperators(Type::BackgroundSize) , m_properties { .size_x = size_x, .size_y = size_y } diff --git a/Libraries/LibWeb/CSS/StyleValues/ColorSchemeStyleValue.h b/Libraries/LibWeb/CSS/StyleValues/ColorSchemeStyleValue.h index 75bedaf4358..0ed28f6c490 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ColorSchemeStyleValue.h +++ b/Libraries/LibWeb/CSS/StyleValues/ColorSchemeStyleValue.h @@ -41,4 +41,5 @@ private: bool operator==(Properties const&) const = default; } m_properties; }; + } diff --git a/Libraries/LibWeb/CSS/SystemColor.h b/Libraries/LibWeb/CSS/SystemColor.h index 176c8345d64..fe70c1300b1 100644 --- a/Libraries/LibWeb/CSS/SystemColor.h +++ b/Libraries/LibWeb/CSS/SystemColor.h @@ -31,4 +31,5 @@ Color mark_text(PreferredColorScheme); Color selected_item(PreferredColorScheme); Color selected_item_text(PreferredColorScheme); Color visited_text(PreferredColorScheme); + } diff --git a/Libraries/LibWeb/CSS/TransitionEvent.h b/Libraries/LibWeb/CSS/TransitionEvent.h index 876c71218ad..7d810265fb6 100644 --- a/Libraries/LibWeb/CSS/TransitionEvent.h +++ b/Libraries/LibWeb/CSS/TransitionEvent.h @@ -39,4 +39,5 @@ private: double m_elapsed_time {}; String m_pseudo_element {}; }; + } diff --git a/Libraries/LibWeb/CSS/URL.h b/Libraries/LibWeb/CSS/URL.h index cecf9458ec1..56e2828de92 100644 --- a/Libraries/LibWeb/CSS/URL.h +++ b/Libraries/LibWeb/CSS/URL.h @@ -12,6 +12,7 @@ #include namespace Web::CSS { + // https://drafts.csswg.org/css-values-5/#request-url-modifiers class RequestURLModifier { public: diff --git a/Libraries/LibWeb/CredentialManagement/Credential.cpp b/Libraries/LibWeb/CredentialManagement/Credential.cpp index 820c2fab8e8..6ebbf2e9910 100644 --- a/Libraries/LibWeb/CredentialManagement/Credential.cpp +++ b/Libraries/LibWeb/CredentialManagement/Credential.cpp @@ -35,4 +35,5 @@ void Credential::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(Credential); Base::initialize(realm); } + } diff --git a/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp b/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp index a97eff14290..2e3f5be85ee 100644 --- a/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp +++ b/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp @@ -8150,4 +8150,5 @@ WebIDL::ExceptionOr HMAC::get_key_length(AlgorithmParams const& param // 2. Return length. return JS::Value(length); } + } diff --git a/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Libraries/LibWeb/DOM/HTMLCollection.cpp index fc3ede9f09e..bb7c1149ac7 100644 --- a/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -176,4 +176,5 @@ JS::Value HTMLCollection::named_item_value(FlyString const& name) const return JS::js_undefined(); return element; } + } diff --git a/Libraries/LibWeb/Dump.cpp b/Libraries/LibWeb/Dump.cpp index 8a9a7bd6172..a2792c761d3 100644 --- a/Libraries/LibWeb/Dump.cpp +++ b/Libraries/LibWeb/Dump.cpp @@ -924,4 +924,5 @@ void dump_nested_declarations(StringBuilder& builder, CSS::CSSNestedDeclarations builder.append(" Nested declarations:\n"sv); dump_style_properties(builder, declarations.declaration(), indent_levels + 1); } + } diff --git a/Libraries/LibWeb/EventTiming/PerformanceEventTiming.h b/Libraries/LibWeb/EventTiming/PerformanceEventTiming.h index 4a34d9d4e11..753f7404f81 100644 --- a/Libraries/LibWeb/EventTiming/PerformanceEventTiming.h +++ b/Libraries/LibWeb/EventTiming/PerformanceEventTiming.h @@ -63,4 +63,5 @@ private: // https://www.w3.org/TR/event-timing/#sec-fin-event-timing // https://www.w3.org/TR/event-timing/#sec-dispatch-pending }; + } diff --git a/Libraries/LibWeb/Fetch/Fetching/Fetching.h b/Libraries/LibWeb/Fetch/Fetching/Fetching.h index 7ab44e40476..b831f59ea22 100644 --- a/Libraries/LibWeb/Fetch/Fetching/Fetching.h +++ b/Libraries/LibWeb/Fetch/Fetching/Fetching.h @@ -52,4 +52,5 @@ void set_sec_fetch_mode_header(Infrastructure::Request&); void set_sec_fetch_site_header(Infrastructure::Request&); void set_sec_fetch_user_header(Infrastructure::Request&); void append_fetch_metadata_headers_for_request(Infrastructure::Request&); + } diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h index d924ae059ad..49ae6025e9f 100644 --- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h +++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h @@ -349,4 +349,5 @@ private: GC::Ref m_header_list; }; + } diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index a9fd5a7e5f6..308dedf76ca 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -13,6 +13,7 @@ #include namespace Web { + class DragAndDropEventHandler; class EventHandler; class InputEventsTarget; @@ -28,17 +29,21 @@ enum class InvalidateDisplayList; enum class TraversalDecision; AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(i64, UniqueNodeID, Comparison, Increment, CastToUnderlying); + } namespace Web::Painting { + class BackingStore; class DisplayList; class DisplayListRecorder; class SVGGradientPaintStyle; using PaintStyle = RefPtr; + } namespace Web::Animations { + class Animatable; class Animation; class AnimationEffect; @@ -46,16 +51,20 @@ class AnimationPlaybackEvent; class AnimationTimeline; class DocumentTimeline; class KeyframeEffect; + } namespace Web::ARIA { + class AriaData; class ARIAMixin; enum class StateAndProperties; + } namespace Web::Bindings { + class Intrinsics; class OptionConstructor; @@ -87,43 +96,55 @@ enum class ResponseType : u8; enum class TextTrackKind : u8; enum class TransferFunction : u8; enum class XMLHttpRequestResponseType : u8; + } namespace Web::Clipboard { + class Clipboard; class ClipboardItem; struct SystemClipboardItem; struct SystemClipboardRepresentation; + } namespace Web::Compression { + class CompressionStream; class DecompressionStream; + } namespace Web::ContentSecurityPolicy { + class Policy; class PolicyList; class SecurityPolicyViolationEvent; class Violation; struct SecurityPolicyViolationEventInit; struct SerializedPolicy; + } namespace Web::ContentSecurityPolicy::Directives { + class Directive; struct SerializedDirective; + } namespace Web::Cookie { + struct Cookie; struct ParsedCookie; enum class Source; + } namespace Web::CredentialManagement { + class Credential; class CredentialsContainer; class FederatedCredential; @@ -135,14 +156,18 @@ struct CredentialCreationOptions; struct FederatedCredentialRequestOptions; struct FederatedCredentialInit; struct PasswordCredentialData; + } namespace Web::Crypto { + class Crypto; class SubtleCrypto; + } namespace Web::CSS { + class AbstractImageStyleValue; class Angle; class AngleOrCalculated; @@ -286,9 +311,11 @@ enum class PropertyID; struct BackgroundLayerData; struct CSSStyleSheetInit; struct StyleSheetIdentifier; + } namespace Web::CSS::Parser { + class ComponentValue; class Parser; class Token; @@ -299,9 +326,11 @@ struct Declaration; struct Function; struct QualifiedRule; struct SimpleBlock; + } namespace Web::DOM { + class AbortController; class AbortSignal; class AbstractRange; @@ -351,9 +380,11 @@ enum class QuirksMode; struct AddEventListenerOptions; struct EventListenerOptions; + } namespace Web::Encoding { + class TextDecoder; class TextEncoder; class TextEncoderStream; @@ -361,30 +392,40 @@ class TextEncoderStream; struct TextDecodeOptions; struct TextDecoderOptions; struct TextEncoderEncodeIntoResult; + } namespace Web::EntriesAPI { + class FileSystemEntry; + } namespace Web::EventTiming { + class PerformanceEventTiming; + } namespace Web::Fetch { + class BodyMixin; class Headers; class HeadersIterator; class Request; class Response; + } namespace Web::Fetch::Fetching { + class PendingResponse; class RefCountedFlag; + } namespace Web::Fetch::Infrastructure { + class Body; class FetchAlgorithms; class FetchController; @@ -399,15 +440,19 @@ class Response; struct BodyWithType; struct ConnectionTimingInfo; struct Header; + } namespace Web::FileAPI { + class Blob; class File; class FileList; + } namespace Web::Geometry { + class DOMMatrix; class DOMMatrixReadOnly; class DOMPoint; @@ -420,9 +465,11 @@ class DOMRectReadOnly; struct DOMMatrix2DInit; struct DOMMatrixInit; struct DOMPointInit; + } namespace Web::HTML { + class AnimationFrameCallbackDriver; class AudioTrack; class AudioTrackList; @@ -615,13 +662,17 @@ struct StructuredSerializeOptions; struct SyntheticRealmSettings; struct ToggleTaskTracker; struct TransferDataHolder; + } namespace Web::HighResolutionTime { + class Performance; + } namespace Web::IndexedDB { + class Database; class IDBCursor; class IDBCursorWithValue; @@ -637,21 +688,27 @@ class IDBVersionChangeEvent; class Index; class ObjectStore; class RequestList; + } namespace Web::Internals { + class Internals; class WebUI; + } namespace Web::IntersectionObserver { + class IntersectionObserver; class IntersectionObserverEntry; struct IntersectionObserverRegistration; + } namespace Web::Layout { + class AudioBox; class BlockContainer; class BlockFormattingContext; @@ -685,13 +742,17 @@ class Viewport; enum class LayoutMode; struct LayoutState; + } namespace Web::MathML { + class MathMLElement; + } namespace Web::MediaCapabilitiesAPI { + class MediaCapabilities; struct AudioConfiguration; @@ -704,9 +765,11 @@ struct MediaConfiguration; struct MediaDecodingConfiguration; struct MediaEncodingConfiguration; struct VideoConfiguration; + } namespace Web::MediaSourceExtensions { + class BufferedChangeEvent; class ManagedMediaSource; class ManagedSourceBuffer; @@ -714,18 +777,24 @@ class MediaSource; class MediaSourceHandle; class SourceBuffer; class SourceBufferList; + } namespace Web::MimeSniff { + class MimeType; + } namespace Web::NavigationTiming { + class PerformanceNavigation; class PerformanceTiming; + } namespace Web::Painting { + class AudioPaintable; class ButtonPaintable; class CheckBoxPaintable; @@ -745,52 +814,72 @@ enum class PaintPhase; struct BorderRadiiData; struct BorderRadiusData; struct LinearGradientData; + } namespace Web::PerformanceTimeline { + class PerformanceEntry; class PerformanceObserver; class PerformanceObserverEntryList; struct PerformanceObserverInit; + } namespace Web::PermissionsPolicy { + class AutoplayAllowlist; + } namespace Web::Platform { + class AudioCodecPlugin; class Timer; + } namespace Web::ReferrerPolicy { + enum class ReferrerPolicy; + } namespace Web::RequestIdleCallback { + class IdleDeadline; + } namespace Web::ResizeObserver { + class ResizeObserver; + } namespace Web::ResourceTiming { + class PerformanceResourceTiming; + } namespace Web::Selection { + class Selection; + } namespace Web::ServiceWorker { + class ServiceWorker; class ServiceWorkerContainer; class ServiceWorkerRegistration; + } namespace Web::Streams { + class ByteLengthQueuingStrategy; class CountQueuingStrategy; class ReadableByteStreamController; @@ -816,9 +905,11 @@ struct ReadableStreamGetReaderOptions; struct Transformer; struct UnderlyingSink; struct UnderlyingSource; + } namespace Web::StorageAPI { + class NavigatorStorage; class StorageManager; class StorageShed; @@ -827,9 +918,11 @@ struct StorageBottle; struct StorageBucket; struct StorageEndpoint; struct StorageShelf; + } namespace Web::SVG { + class SVGAnimatedEnumeration; class SVGAnimatedLength; class SVGAnimatedRect; @@ -855,9 +948,11 @@ class SVGRectElement; class SVGScriptElement; class SVGSVGElement; class SVGTitleElement; + } namespace Web::UIEvents { + class CompositionEvent; class InputEvent; class KeyboardEvent; @@ -865,32 +960,42 @@ class MouseEvent; class PointerEvent; class TextEvent; class UIEvent; + } namespace Web::URLPattern { + class URLPattern; + } namespace Web::DOMURL { + class DOMURL; class URLSearchParams; class URLSearchParamsIterator; + } namespace Web::UserTiming { + class PerformanceMark; class PerformanceMeasure; + } namespace Web::WebAssembly { + class Global; class Instance; class Memory; class Module; class Table; + } namespace Web::WebAudio { + class AudioBuffer; class AudioBufferSourceNode; class AudioContext; @@ -913,9 +1018,11 @@ enum class AudioContextState; struct AudioContextOptions; struct DynamicsCompressorOptions; struct OscillatorOptions; + } namespace Web::WebGL { + class OpenGLContext; class WebGL2RenderingContext; class WebGLActiveInfo; @@ -933,9 +1040,11 @@ class WebGLSync; class WebGLTexture; class WebGLUniformLocation; class WebGLVertexArrayObject; + } namespace Web::WebGL::Extensions { + class ANGLEInstancedArrays; class EXTBlendMinMax; class EXTColorBufferFloat; @@ -943,9 +1052,11 @@ class OESVertexArrayObject; class WebGLCompressedTextureS3tc; class WebGLDrawBuffers; class WebGLVertexArrayObjectOES; + } namespace Web::WebIDL { + class ArrayBufferView; class BufferSource; class CallbackType; @@ -955,25 +1066,33 @@ template class ExceptionOr; using Promise = JS::PromiseCapability; + } namespace Web::WebDriver { + class HeapTimer; struct ActionObject; struct InputState; + }; namespace Web::WebSockets { + class WebSocket; + } namespace Web::WebVTT { + class VTTCue; class VTTRegion; + } namespace Web::XHR { + class FormData; class FormDataIterator; class ProgressEvent; @@ -982,6 +1101,7 @@ class XMLHttpRequestEventTarget; class XMLHttpRequestUpload; struct FormDataEntry; + } namespace IPC { diff --git a/Libraries/LibWeb/Geometry/DOMRectReadOnly.h b/Libraries/LibWeb/Geometry/DOMRectReadOnly.h index 9c77dc9c7ee..faec34b468a 100644 --- a/Libraries/LibWeb/Geometry/DOMRectReadOnly.h +++ b/Libraries/LibWeb/Geometry/DOMRectReadOnly.h @@ -81,4 +81,5 @@ protected: Gfx::DoubleRect m_rect; }; + } diff --git a/Libraries/LibWeb/HTML/BarProp.cpp b/Libraries/LibWeb/HTML/BarProp.cpp index 6e16cd712ce..19eef99e052 100644 --- a/Libraries/LibWeb/HTML/BarProp.cpp +++ b/Libraries/LibWeb/HTML/BarProp.cpp @@ -44,4 +44,5 @@ void BarProp::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(BarProp); Base::initialize(realm); } + } diff --git a/Libraries/LibWeb/HTML/BarProp.h b/Libraries/LibWeb/HTML/BarProp.h index d3b0a47778d..60e0a6d6f58 100644 --- a/Libraries/LibWeb/HTML/BarProp.h +++ b/Libraries/LibWeb/HTML/BarProp.h @@ -27,4 +27,5 @@ public: private: virtual void initialize(JS::Realm&) override; }; + } diff --git a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp index 9c96199f66a..bae7b49c5ce 100644 --- a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp +++ b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp @@ -89,4 +89,5 @@ WebIDL::ExceptionOr CanvasDrawImage::draw_image(Web::HTML::CanvasImageSour { return draw_image_internal(image, source_x, source_y, source_width, source_height, destination_x, destination_y, destination_width, destination_height); } + } diff --git a/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index 002cc07b398..6f17332a3e8 100644 --- a/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -1117,4 +1117,5 @@ void CanvasRenderingContext2D::set_filter(String filter) // 3. If parsedValue is failure, then return. } + } diff --git a/Libraries/LibWeb/HTML/DataTransfer.cpp b/Libraries/LibWeb/HTML/DataTransfer.cpp index fc5424f1a7e..377aae87f01 100644 --- a/Libraries/LibWeb/HTML/DataTransfer.cpp +++ b/Libraries/LibWeb/HTML/DataTransfer.cpp @@ -314,4 +314,5 @@ void DataTransfer::update_data_transfer_types_list() // 3. Set the DataTransfer object's types array to the result of creating a frozen array from L. m_types = move(types); } + } diff --git a/Libraries/LibWeb/HTML/GlobalEventHandlers.cpp b/Libraries/LibWeb/HTML/GlobalEventHandlers.cpp index ad99712cfc5..d0db416cc04 100644 --- a/Libraries/LibWeb/HTML/GlobalEventHandlers.cpp +++ b/Libraries/LibWeb/HTML/GlobalEventHandlers.cpp @@ -28,4 +28,5 @@ ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE) #undef __ENUMERATE GlobalEventHandlers::~GlobalEventHandlers() = default; + } diff --git a/Libraries/LibWeb/HTML/HTMLAnchorElement.h b/Libraries/LibWeb/HTML/HTMLAnchorElement.h index 1a83a70bf7c..1fa0c2fba26 100644 --- a/Libraries/LibWeb/HTML/HTMLAnchorElement.h +++ b/Libraries/LibWeb/HTML/HTMLAnchorElement.h @@ -80,6 +80,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_anchor_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLAreaElement.h b/Libraries/LibWeb/HTML/HTMLAreaElement.h index 663d4331ca5..cdcdd0417fa 100644 --- a/Libraries/LibWeb/HTML/HTMLAreaElement.h +++ b/Libraries/LibWeb/HTML/HTMLAreaElement.h @@ -63,6 +63,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_area_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLBRElement.h b/Libraries/LibWeb/HTML/HTMLBRElement.h index 2fb9ceb66f1..1a45185eccf 100644 --- a/Libraries/LibWeb/HTML/HTMLBRElement.h +++ b/Libraries/LibWeb/HTML/HTMLBRElement.h @@ -31,6 +31,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_br_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Libraries/LibWeb/HTML/HTMLBaseElement.h index 1c953433c81..dfa7806ba83 100644 --- a/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -42,6 +42,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_base_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Libraries/LibWeb/HTML/HTMLBodyElement.h index eadc7583be7..8aeb3838c5b 100644 --- a/Libraries/LibWeb/HTML/HTMLBodyElement.h +++ b/Libraries/LibWeb/HTML/HTMLBodyElement.h @@ -50,6 +50,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_body_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLButtonElement.h b/Libraries/LibWeb/HTML/HTMLButtonElement.h index a4d5e8ff456..8e0f751aa7a 100644 --- a/Libraries/LibWeb/HTML/HTMLButtonElement.h +++ b/Libraries/LibWeb/HTML/HTMLButtonElement.h @@ -102,6 +102,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_button_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLDivElement.h b/Libraries/LibWeb/HTML/HTMLDivElement.h index bede96bfda6..56ba23a434b 100644 --- a/Libraries/LibWeb/HTML/HTMLDivElement.h +++ b/Libraries/LibWeb/HTML/HTMLDivElement.h @@ -35,6 +35,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_div_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLElement.h b/Libraries/LibWeb/HTML/HTMLElement.h index a2bc1af9d06..cfb8d6de9d6 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Libraries/LibWeb/HTML/HTMLElement.h @@ -238,6 +238,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLEmbedElement.h b/Libraries/LibWeb/HTML/HTMLEmbedElement.h index 8b539d0d6e9..e6f68b4d75a 100644 --- a/Libraries/LibWeb/HTML/HTMLEmbedElement.h +++ b/Libraries/LibWeb/HTML/HTMLEmbedElement.h @@ -30,6 +30,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_embed_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index c6bafcb85cb..43d92f639fa 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -62,6 +62,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_fieldset_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLFormElement.h b/Libraries/LibWeb/HTML/HTMLFormElement.h index 5861ba44811..4899dea092d 100644 --- a/Libraries/LibWeb/HTML/HTMLFormElement.h +++ b/Libraries/LibWeb/HTML/HTMLFormElement.h @@ -158,6 +158,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_form_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index 14ae65f7197..d2f88bc22e3 100644 --- a/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -41,6 +41,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_frameset_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLHeadElement.h b/Libraries/LibWeb/HTML/HTMLHeadElement.h index 632b441b009..e87fbbf57dc 100644 --- a/Libraries/LibWeb/HTML/HTMLHeadElement.h +++ b/Libraries/LibWeb/HTML/HTMLHeadElement.h @@ -27,6 +27,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_head_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLHtmlElement.h b/Libraries/LibWeb/HTML/HTMLHtmlElement.h index ebf5bfd9948..b715799ecf2 100644 --- a/Libraries/LibWeb/HTML/HTMLHtmlElement.h +++ b/Libraries/LibWeb/HTML/HTMLHtmlElement.h @@ -33,6 +33,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_html_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 39b13c86d4b..f51c811e4ed 100644 --- a/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -71,6 +71,8 @@ void run_iframe_load_event_steps(HTML::HTMLIFrameElement&); } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_iframe_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.h b/Libraries/LibWeb/HTML/HTMLImageElement.h index 5105bcd6f94..06239ee17a6 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -164,6 +164,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_image_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.h b/Libraries/LibWeb/HTML/HTMLInputElement.h index 017c442ee85..d926d1e07ca 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -395,6 +395,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_input_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Libraries/LibWeb/HTML/HTMLMediaElement.h index 20ce380c825..9a4ad809f8c 100644 --- a/Libraries/LibWeb/HTML/HTMLMediaElement.h +++ b/Libraries/LibWeb/HTML/HTMLMediaElement.h @@ -335,6 +335,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_media_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index cb3fc125550..ab5c088fc05 100644 --- a/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -240,4 +240,5 @@ void HTMLMeterElement::update_meter_value_element() double position = (value - min) / (max - min) * 100; MUST(m_meter_value_element->style_for_bindings()->set_property(CSS::PropertyID::Width, MUST(String::formatted("{}%", position)))); } + } diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Libraries/LibWeb/HTML/HTMLObjectElement.h index ccecc5e1b31..6ff1677df16 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -102,6 +102,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_object_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLProgressElement.h b/Libraries/LibWeb/HTML/HTMLProgressElement.h index d3d0ee25337..12e0a9f330e 100644 --- a/Libraries/LibWeb/HTML/HTMLProgressElement.h +++ b/Libraries/LibWeb/HTML/HTMLProgressElement.h @@ -59,6 +59,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_progress_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Libraries/LibWeb/HTML/HTMLScriptElement.h index 880cbf81b11..d989eb55c98 100644 --- a/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -147,6 +147,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_script_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLSpanElement.h b/Libraries/LibWeb/HTML/HTMLSpanElement.h index 0dab62faead..b5359ffd4ca 100644 --- a/Libraries/LibWeb/HTML/HTMLSpanElement.h +++ b/Libraries/LibWeb/HTML/HTMLSpanElement.h @@ -32,6 +32,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_span_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTableCellElement.h b/Libraries/LibWeb/HTML/HTMLTableCellElement.h index e1645788bd9..0279feb1864 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCellElement.h +++ b/Libraries/LibWeb/HTML/HTMLTableCellElement.h @@ -41,6 +41,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_table_cell_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTableElement.h b/Libraries/LibWeb/HTML/HTMLTableElement.h index 69c6f9baef4..1d275430238 100644 --- a/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -70,6 +70,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_table_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTableRowElement.h b/Libraries/LibWeb/HTML/HTMLTableRowElement.h index a9d20536693..fdc8b7e8510 100644 --- a/Libraries/LibWeb/HTML/HTMLTableRowElement.h +++ b/Libraries/LibWeb/HTML/HTMLTableRowElement.h @@ -44,6 +44,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_table_row_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTableSectionElement.h b/Libraries/LibWeb/HTML/HTMLTableSectionElement.h index 836534c1a15..10ddf748814 100644 --- a/Libraries/LibWeb/HTML/HTMLTableSectionElement.h +++ b/Libraries/LibWeb/HTML/HTMLTableSectionElement.h @@ -46,6 +46,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_table_section_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTemplateElement.h b/Libraries/LibWeb/HTML/HTMLTemplateElement.h index f791a2eeeda..9b5f910ba7c 100644 --- a/Libraries/LibWeb/HTML/HTMLTemplateElement.h +++ b/Libraries/LibWeb/HTML/HTMLTemplateElement.h @@ -40,6 +40,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_template_element(); } + } diff --git a/Libraries/LibWeb/HTML/HTMLTitleElement.h b/Libraries/LibWeb/HTML/HTMLTitleElement.h index ea918412e84..ddaba971cca 100644 --- a/Libraries/LibWeb/HTML/HTMLTitleElement.h +++ b/Libraries/LibWeb/HTML/HTMLTitleElement.h @@ -31,6 +31,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_html_title_element(); } + } diff --git a/Libraries/LibWeb/HTML/NavigableContainer.h b/Libraries/LibWeb/HTML/NavigableContainer.h index 4632e3acb3d..5a39f16e3cd 100644 --- a/Libraries/LibWeb/HTML/NavigableContainer.h +++ b/Libraries/LibWeb/HTML/NavigableContainer.h @@ -78,6 +78,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_navigable_container(); } + } diff --git a/Libraries/LibWeb/HTML/NavigateEvent.h b/Libraries/LibWeb/HTML/NavigateEvent.h index 7b1e874eced..cca320160c7 100644 --- a/Libraries/LibWeb/HTML/NavigateEvent.h +++ b/Libraries/LibWeb/HTML/NavigateEvent.h @@ -151,6 +151,7 @@ private: } namespace AK { + template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::Bindings::NavigationScrollBehavior const& value) @@ -166,4 +167,5 @@ struct Formatter : Formatter { return Formatter::format(builder, Web::Bindings::idl_enum_to_string(value)); } }; + } diff --git a/Libraries/LibWeb/HTML/NavigationHistoryEntry.h b/Libraries/LibWeb/HTML/NavigationHistoryEntry.h index d08f00fdf01..b038826b2b4 100644 --- a/Libraries/LibWeb/HTML/NavigationHistoryEntry.h +++ b/Libraries/LibWeb/HTML/NavigationHistoryEntry.h @@ -42,4 +42,5 @@ private: GC::Ref m_session_history_entry; }; + } diff --git a/Libraries/LibWeb/HTML/NavigationParams.h b/Libraries/LibWeb/HTML/NavigationParams.h index 0a9e324d88d..db0c380f703 100644 --- a/Libraries/LibWeb/HTML/NavigationParams.h +++ b/Libraries/LibWeb/HTML/NavigationParams.h @@ -111,4 +111,5 @@ struct NonFetchSchemeNavigationParams : JS::Cell { }; bool check_a_navigation_responses_adherence_to_x_frame_options(GC::Ptr response, Navigable* navigable, GC::Ref csp_list, URL::Origin destination_origin); + } diff --git a/Libraries/LibWeb/HTML/NavigationType.h b/Libraries/LibWeb/HTML/NavigationType.h index 277ac9bc3e2..eec9c51bc5e 100644 --- a/Libraries/LibWeb/HTML/NavigationType.h +++ b/Libraries/LibWeb/HTML/NavigationType.h @@ -10,6 +10,7 @@ // FIXME: Generate this from the IDL file that just has an enum in it namespace Web::Bindings { + enum class NavigationType { Push, Replace, diff --git a/Libraries/LibWeb/HTML/Parser/HTMLParser.h b/Libraries/LibWeb/HTML/Parser/HTMLParser.h index 787b96cd20a..a76c153f9cb 100644 --- a/Libraries/LibWeb/HTML/Parser/HTMLParser.h +++ b/Libraries/LibWeb/HTML/Parser/HTMLParser.h @@ -18,7 +18,9 @@ # include namespace Web { + class SpeculativeHTMLParser; + } #endif diff --git a/Libraries/LibWeb/HTML/Scripting/Fetching.h b/Libraries/LibWeb/HTML/Scripting/Fetching.h index db6effa470d..92310db043a 100644 --- a/Libraries/LibWeb/HTML/Scripting/Fetching.h +++ b/Libraries/LibWeb/HTML/Scripting/Fetching.h @@ -102,4 +102,5 @@ void fetch_descendants_of_and_link_a_module_script(JS::Realm&, JavaScriptModuleS Fetch::Infrastructure::Request::Destination fetch_destination_from_module_type(Fetch::Infrastructure::Request::Destination, ByteString const&); void fetch_single_module_script(JS::Realm&, URL::URL const&, EnvironmentSettingsObject& fetch_client, Fetch::Infrastructure::Request::Destination, ScriptFetchOptions const&, JS::Realm& module_map_realm, Web::Fetch::Infrastructure::Request::ReferrerType const&, Optional const&, TopLevelModule, PerformTheFetchHook, OnFetchScriptComplete callback); + } diff --git a/Libraries/LibWeb/HTML/SourceSet.cpp b/Libraries/LibWeb/HTML/SourceSet.cpp index f4ecc14d1f6..f4387b24c4d 100644 --- a/Libraries/LibWeb/HTML/SourceSet.cpp +++ b/Libraries/LibWeb/HTML/SourceSet.cpp @@ -444,4 +444,5 @@ void SourceSet::normalize_source_densities(DOM::Element const& element) } } } + } diff --git a/Libraries/LibWeb/HTML/XMLSerializer.h b/Libraries/LibWeb/HTML/XMLSerializer.h index 6a52b89a962..14ccef8d350 100644 --- a/Libraries/LibWeb/HTML/XMLSerializer.h +++ b/Libraries/LibWeb/HTML/XMLSerializer.h @@ -34,4 +34,5 @@ enum class RequireWellFormed { }; WebIDL::ExceptionOr serialize_node_to_xml_string(GC::Ref root, RequireWellFormed require_well_formed); + } diff --git a/Libraries/LibWeb/IndexedDB/IDBTransaction.h b/Libraries/LibWeb/IndexedDB/IDBTransaction.h index 35019709527..a058c61db5b 100644 --- a/Libraries/LibWeb/IndexedDB/IDBTransaction.h +++ b/Libraries/LibWeb/IndexedDB/IDBTransaction.h @@ -113,4 +113,5 @@ private: // NOTE: Used for debug purposes String m_uuid; }; + } diff --git a/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Libraries/LibWeb/Layout/GridFormattingContext.cpp index b3e8caf61e6..1343fd7543c 100644 --- a/Libraries/LibWeb/Layout/GridFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/GridFormattingContext.cpp @@ -2657,11 +2657,14 @@ StaticPositionRect GridFormattingContext::calculate_static_position_rect(Box con static_position.rect = { { 0, 0 }, { box_state.content_width(), box_state.content_height() } }; return static_position; } + } namespace AK { + template<> struct Traits : public DefaultTraits { static unsigned hash(Web::Layout::GridPosition const& key) { return pair_int_hash(key.row, key.column); } }; + } diff --git a/Libraries/LibWeb/Layout/LayoutState.cpp b/Libraries/LibWeb/Layout/LayoutState.cpp index 33c825e81fc..71257d64d6a 100644 --- a/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Libraries/LibWeb/Layout/LayoutState.cpp @@ -673,4 +673,5 @@ void LayoutState::UsedValues::set_indefinite_content_height() { m_has_definite_height = false; } + } diff --git a/Libraries/LibWeb/Layout/ListItemBox.h b/Libraries/LibWeb/Layout/ListItemBox.h index 58dc4a8550a..dafecdd969a 100644 --- a/Libraries/LibWeb/Layout/ListItemBox.h +++ b/Libraries/LibWeb/Layout/ListItemBox.h @@ -35,4 +35,5 @@ private: template<> inline bool Node::fast_is() const { return is_list_item_box(); } + } diff --git a/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp b/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp index 0f5abdc9e5c..4701c5b0a17 100644 --- a/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp +++ b/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp @@ -71,4 +71,5 @@ void ListItemMarkerBox::visit_edges(Cell::Visitor& visitor) Base::visit_edges(visitor); visitor.visit(m_list_item_element); } + } diff --git a/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Libraries/LibWeb/Layout/TreeBuilder.cpp index 030a7a06582..6f6c5e644bd 100644 --- a/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -1081,4 +1081,5 @@ void TreeBuilder::missing_cells_fixup(Vector> const& table_root_bo }); } } + } diff --git a/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp b/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp index 396a9bbf975..70ea2b96145 100644 --- a/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp +++ b/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp @@ -10,6 +10,7 @@ #include namespace Web::NavigationTiming { + GC_DEFINE_ALLOCATOR(PerformanceTiming); PerformanceTiming::PerformanceTiming(JS::Realm& realm) diff --git a/Libraries/LibWeb/Painting/Command.h b/Libraries/LibWeb/Painting/Command.h index 1ef3d21633c..2c4ee283e56 100644 --- a/Libraries/LibWeb/Painting/Command.h +++ b/Libraries/LibWeb/Painting/Command.h @@ -486,4 +486,5 @@ using Command = Variant< ApplyFilters, ApplyTransform, ApplyMaskBitmap>; + } diff --git a/Libraries/LibWeb/Painting/FieldSetPaintable.cpp b/Libraries/LibWeb/Painting/FieldSetPaintable.cpp index f991a98d23f..a2aff22e39a 100644 --- a/Libraries/LibWeb/Painting/FieldSetPaintable.cpp +++ b/Libraries/LibWeb/Painting/FieldSetPaintable.cpp @@ -9,6 +9,7 @@ #include namespace Web::Painting { + GC_DEFINE_ALLOCATOR(FieldSetPaintable); GC::Ref FieldSetPaintable::create(Layout::FieldSetBox const& layout_box) diff --git a/Libraries/LibWeb/Painting/TableBordersPainting.cpp b/Libraries/LibWeb/Painting/TableBordersPainting.cpp index 9111a43cf0c..6b8086812f0 100644 --- a/Libraries/LibWeb/Painting/TableBordersPainting.cpp +++ b/Libraries/LibWeb/Painting/TableBordersPainting.cpp @@ -23,10 +23,12 @@ struct CellCoordinates { }; namespace AK { + template<> struct Traits : public DefaultTraits { static unsigned hash(CellCoordinates const& key) { return pair_int_hash(key.row_index, key.column_index); } }; + } namespace Web::Painting { @@ -441,4 +443,5 @@ void paint_table_borders(PaintContext& context, PaintableBox const& table_painta } } } + } diff --git a/Libraries/LibWeb/SVG/SVGAElement.h b/Libraries/LibWeb/SVG/SVGAElement.h index 425f6d6fe27..539b932bca8 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.h +++ b/Libraries/LibWeb/SVG/SVGAElement.h @@ -43,6 +43,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_svg_a_element(); } + } diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.h b/Libraries/LibWeb/SVG/SVGClipPathElement.h index 8c845a8de0e..a6b44266d60 100644 --- a/Libraries/LibWeb/SVG/SVGClipPathElement.h +++ b/Libraries/LibWeb/SVG/SVGClipPathElement.h @@ -49,4 +49,5 @@ private: Optional m_clip_path_units = {}; }; + } diff --git a/Libraries/LibWeb/SVG/SVGForeignObjectElement.h b/Libraries/LibWeb/SVG/SVGForeignObjectElement.h index ce441f287b9..f830f79f095 100644 --- a/Libraries/LibWeb/SVG/SVGForeignObjectElement.h +++ b/Libraries/LibWeb/SVG/SVGForeignObjectElement.h @@ -45,6 +45,8 @@ private: } namespace Web::DOM { + template<> inline bool Node::fast_is() const { return is_svg_foreign_object_element(); } + } diff --git a/Libraries/LibWeb/ServiceWorker/Registration.h b/Libraries/LibWeb/ServiceWorker/Registration.h index fd48e7e4ab2..d170aa1d529 100644 --- a/Libraries/LibWeb/ServiceWorker/Registration.h +++ b/Libraries/LibWeb/ServiceWorker/Registration.h @@ -84,6 +84,7 @@ struct RegistrationKey { } namespace AK { + template<> struct Traits : public DefaultTraits { static unsigned hash(Web::ServiceWorker::RegistrationKey const& key) diff --git a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp index bd9d817a2ae..0d7c3eb2118 100644 --- a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp +++ b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp @@ -7,4 +7,5 @@ #include namespace Web::ServiceWorker { + } diff --git a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRegistration.cpp b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRegistration.cpp index fb9a0fdbae4..f5d2e617058 100644 --- a/Libraries/LibWeb/ServiceWorker/ServiceWorkerRegistration.cpp +++ b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRegistration.cpp @@ -38,4 +38,5 @@ GC::Ref ServiceWorkerRegistration::create(JS::Realm& { return realm.create(realm, registration); } + } diff --git a/Libraries/LibWeb/StorageAPI/StorageKey.h b/Libraries/LibWeb/StorageAPI/StorageKey.h index c58243ce780..142f8820d8c 100644 --- a/Libraries/LibWeb/StorageAPI/StorageKey.h +++ b/Libraries/LibWeb/StorageAPI/StorageKey.h @@ -36,6 +36,7 @@ StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const } namespace AK { + template<> struct Traits : public DefaultTraits { static unsigned hash(Web::StorageAPI::StorageKey const& key) @@ -43,4 +44,5 @@ struct Traits : public DefaultTraits::hash(key.origin); } }; + } diff --git a/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp b/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp index d2fa489685a..c61c29218c1 100644 --- a/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp +++ b/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp @@ -179,4 +179,5 @@ GC::Ref ReadableStreamBYOBReader::read(GC::Root namespace Web::Bindings { + enum class ImportExportKind : u8; + } namespace Web::WebAssembly { diff --git a/Libraries/LibWeb/WebAssembly/WebAssembly.cpp b/Libraries/LibWeb/WebAssembly/WebAssembly.cpp index 956912cdc41..c2b3d8bdead 100644 --- a/Libraries/LibWeb/WebAssembly/WebAssembly.cpp +++ b/Libraries/LibWeb/WebAssembly/WebAssembly.cpp @@ -1010,9 +1010,11 @@ DEFINE_WASM_NATIVE_ERROR_PROTOTYPE(RuntimeError, runtime_error, RuntimeErrorProt } namespace Web::Bindings { + DEFINE_WASM_ERROR_PROTOTYPE_AND_CONSTRUCTOR_WEB_INTRINSIC(CompileError, compile_error, CompileErrorPrototype, CompileErrorConstructor) DEFINE_WASM_ERROR_PROTOTYPE_AND_CONSTRUCTOR_WEB_INTRINSIC(LinkError, link_error, LinkErrorPrototype, LinkErrorConstructor) DEFINE_WASM_ERROR_PROTOTYPE_AND_CONSTRUCTOR_WEB_INTRINSIC(RuntimeError, runtime_error, RuntimeErrorPrototype, RuntimeErrorConstructor) + } #undef DEFINE_WASM_ERROR_PROTOTYPE_AND_CONSTRUCTOR_WEB_INTRINSIC diff --git a/Libraries/LibWeb/WebAssembly/WebAssembly.h b/Libraries/LibWeb/WebAssembly/WebAssembly.h index ffd8b4ffff8..7500569329c 100644 --- a/Libraries/LibWeb/WebAssembly/WebAssembly.h +++ b/Libraries/LibWeb/WebAssembly/WebAssembly.h @@ -32,6 +32,7 @@ WebIDL::ExceptionOr> instantiate(JS::VM&, Module const& WebIDL::ExceptionOr> instantiate_streaming(JS::VM&, GC::Root source, Optional>& import_object); namespace Detail { + struct CompiledWebAssemblyModule : public RefCounted { explicit CompiledWebAssemblyModule(NonnullRefPtr module) : module(move(module)) @@ -163,4 +164,5 @@ DECLARE_WASM_NATIVE_ERROR_PROTOTYPE(RuntimeError, runtime_error, RuntimeErrorPro #undef DECLARE_WASM_NATIVE_ERROR #undef DECLARE_WASM_NATIVE_ERROR_PROTOTYPE #undef DECLARE_WASM_NATIVE_ERROR_CONSTRUCTOR + } diff --git a/Libraries/LibWeb/WebAudio/AnalyserNode.h b/Libraries/LibWeb/WebAudio/AnalyserNode.h index 5172a37a1b4..a81fbea8bcc 100644 --- a/Libraries/LibWeb/WebAudio/AnalyserNode.h +++ b/Libraries/LibWeb/WebAudio/AnalyserNode.h @@ -81,4 +81,5 @@ private: // https://webaudio.github.io/web-audio-api/#conversion-to-db Vector conversion_to_dB(Vector const& X_hat) const; }; + } diff --git a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp index 8a0b3e5ae4b..07b20270cfd 100644 --- a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp +++ b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp @@ -14,7 +14,9 @@ #include inline namespace { + extern StringView s_xhtml_unified_dtd; + } namespace Web { @@ -392,7 +394,9 @@ Optional XMLDocumentBuilder::namespace_for_name(XML::Name const& name } inline namespace { + StringView s_xhtml_unified_dtd = R"xmlxmlxml( )xmlxmlxml"sv; + } diff --git a/Libraries/LibWebView/MachPortServer.cpp b/Libraries/LibWebView/MachPortServer.cpp index 69a5fef09b5..7877800a3be 100644 --- a/Libraries/LibWebView/MachPortServer.cpp +++ b/Libraries/LibWebView/MachPortServer.cpp @@ -102,4 +102,5 @@ void MachPortServer::thread_loop() dbgln("Received message with id {}, ignoring", message.header.msgh_id); } } + } diff --git a/Libraries/LibWebView/WebUI/SettingsUI.cpp b/Libraries/LibWebView/WebUI/SettingsUI.cpp index 2963895e9c8..95884782619 100644 --- a/Libraries/LibWebView/WebUI/SettingsUI.cpp +++ b/Libraries/LibWebView/WebUI/SettingsUI.cpp @@ -276,4 +276,5 @@ void SettingsUI::set_dns_settings(JsonValue const& dns_settings) Application::settings().set_dns_settings(Settings::parse_dns_settings(dns_settings)); load_current_settings(); } + } diff --git a/Libraries/LibXML/DOM/Document.h b/Libraries/LibXML/DOM/Document.h index b725d89c020..5197465edc6 100644 --- a/Libraries/LibXML/DOM/Document.h +++ b/Libraries/LibXML/DOM/Document.h @@ -50,4 +50,5 @@ private: Version m_version; Optional m_explicit_doctype; }; + } diff --git a/Libraries/LibXML/DOM/DocumentTypeDeclaration.h b/Libraries/LibXML/DOM/DocumentTypeDeclaration.h index 38794d8de98..0c4eeb13b65 100644 --- a/Libraries/LibXML/DOM/DocumentTypeDeclaration.h +++ b/Libraries/LibXML/DOM/DocumentTypeDeclaration.h @@ -135,4 +135,5 @@ struct NotationDeclaration { }; using MarkupDeclaration = Variant; + } diff --git a/Libraries/LibXML/DOM/Node.h b/Libraries/LibXML/DOM/Node.h index 644d2ee6ec3..ed6d803611d 100644 --- a/Libraries/LibXML/DOM/Node.h +++ b/Libraries/LibXML/DOM/Node.h @@ -48,4 +48,5 @@ struct Node { bool is_element() const { return content.has(); } Element const& as_element() const { return content.get(); } }; + } diff --git a/Libraries/LibXML/Forward.h b/Libraries/LibXML/Forward.h index 7cc6e764de0..0306ead65cc 100644 --- a/Libraries/LibXML/Forward.h +++ b/Libraries/LibXML/Forward.h @@ -7,9 +7,11 @@ #pragma once namespace XML { + class Parser; class Document; struct Node; struct Attribute; struct Listener; + } diff --git a/Libraries/LibXML/Parser/Parser.h b/Libraries/LibXML/Parser/Parser.h index 2fb9e6f905f..4dc887e7e94 100644 --- a/Libraries/LibXML/Parser/Parser.h +++ b/Libraries/LibXML/Parser/Parser.h @@ -222,6 +222,7 @@ private: Optional m_doctype; }; + } template<> diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp index c7fe62dfa4a..91769636f1a 100644 --- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp @@ -907,6 +907,7 @@ void build(StringBuilder& builder, Vector const& endpoints) for (auto const& endpoint : endpoints) build_endpoint(generator.fork(), endpoint); } + } // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp index f1f7a0dc209..69adaeaf246 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp @@ -16,6 +16,7 @@ #include namespace { + struct LookupTable { u32 first_pointer; u32 max_code_point; @@ -222,6 +223,7 @@ namespace TextCodec { TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } + } // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 7ced49c6673..dd1d8e77898 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -5675,4 +5675,5 @@ namespace Web::Bindings { } // namespace Web::Bindings )~~~"); } + } diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp index 06b0539ecf7..8ef61c7f799 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp @@ -11,6 +11,7 @@ #include namespace { + ErrorOr generate_header_file(JsonObject& roles_data, Core::File& file) { StringBuilder builder; @@ -370,6 +371,7 @@ NameFromSource @name@::name_from_source() const TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } + } // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp index f0588a7b785..e6002ed0d57 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp @@ -11,6 +11,7 @@ #include namespace { + ErrorOr generate_header_file(JsonObject& functions_data, Core::File& file) { StringBuilder builder; @@ -378,6 +379,7 @@ RefPtr Parser::parse_math_function(Function const& functi TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } + } // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) diff --git a/Services/RequestServer/main.cpp b/Services/RequestServer/main.cpp index 742b1cfcc34..b0c881c9e13 100644 --- a/Services/RequestServer/main.cpp +++ b/Services/RequestServer/main.cpp @@ -23,7 +23,9 @@ #endif namespace RequestServer { + extern ByteString g_default_certificate_path; + } static ErrorOr find_certificates(StringView serenity_resource_root) diff --git a/Services/WebContent/main.cpp b/Services/WebContent/main.cpp index e1373f13e11..401da35ff05 100644 --- a/Services/WebContent/main.cpp +++ b/Services/WebContent/main.cpp @@ -54,15 +54,21 @@ static ErrorOr initialize_image_decoder(int image_decoder_socket); static ErrorOr reinitialize_image_decoder(IPC::File const& image_decoder_socket); namespace JS { + extern bool g_log_all_js_exceptions; + } namespace Web::WebIDL { + extern bool g_enable_idl_tracing; + } namespace Web::Fetch::Fetching { + extern bool g_http_cache_enabled; + } ErrorOr serenity_main(Main::Arguments arguments) diff --git a/Tests/LibGfx/TestWOFF2.cpp b/Tests/LibGfx/TestWOFF2.cpp index 9ff068361a6..14026fe2b01 100644 --- a/Tests/LibGfx/TestWOFF2.cpp +++ b/Tests/LibGfx/TestWOFF2.cpp @@ -12,12 +12,14 @@ #define TEST_INPUT(x) ("test-inputs/" x) namespace { + struct Global { Global() { Gfx::FontDatabase::the().install_system_font_provider(make()); } } global; + } TEST_CASE(tolerate_incorrect_sfnt_size) diff --git a/UI/Android/src/main/cpp/JNIHelpers.cpp b/UI/Android/src/main/cpp/JNIHelpers.cpp index 939fe0d9310..b06223d47fb 100644 --- a/UI/Android/src/main/cpp/JNIHelpers.cpp +++ b/UI/Android/src/main/cpp/JNIHelpers.cpp @@ -8,9 +8,11 @@ #include namespace Ladybird { + jstring JavaEnvironment::jstring_from_ak_string(String const& str) { auto as_utf16 = MUST(AK::utf8_to_utf16(str.code_points())); return m_env->NewString(as_utf16.data(), as_utf16.size()); } + } diff --git a/UI/Android/src/main/cpp/JNIHelpers.h b/UI/Android/src/main/cpp/JNIHelpers.h index 38f1b67d6f5..6145ab20090 100644 --- a/UI/Android/src/main/cpp/JNIHelpers.h +++ b/UI/Android/src/main/cpp/JNIHelpers.h @@ -11,6 +11,7 @@ #include namespace Ladybird { + class JavaEnvironment { public: JavaEnvironment(JavaVM* vm) @@ -45,5 +46,6 @@ private: JNIEnv* m_env = nullptr; bool m_did_attach_thread = false; }; + } extern JavaVM* global_vm; diff --git a/UI/Android/src/main/cpp/WebViewImplementationNative.cpp b/UI/Android/src/main/cpp/WebViewImplementationNative.cpp index ffa71c6ba09..5696d45bed3 100644 --- a/UI/Android/src/main/cpp/WebViewImplementationNative.cpp +++ b/UI/Android/src/main/cpp/WebViewImplementationNative.cpp @@ -15,6 +15,7 @@ #include namespace Ladybird { + static Gfx::BitmapFormat to_gfx_bitmap_format(i32 f) { switch (f) { @@ -142,4 +143,5 @@ NonnullRefPtr WebViewImplementationNative::bind_web_c return new_client; } + } diff --git a/UI/Android/src/main/cpp/WebViewImplementationNative.h b/UI/Android/src/main/cpp/WebViewImplementationNative.h index 3103f208642..e64e950ce5a 100644 --- a/UI/Android/src/main/cpp/WebViewImplementationNative.h +++ b/UI/Android/src/main/cpp/WebViewImplementationNative.h @@ -11,6 +11,7 @@ #include namespace Ladybird { + class WebViewImplementationNative : public WebView::ViewImplementation { public: WebViewImplementationNative(jobject thiz); @@ -42,4 +43,5 @@ private: jobject m_java_instance = nullptr; Web::DevicePixelSize m_viewport_size; }; + } diff --git a/UI/AppKit/Application/Application.h b/UI/AppKit/Application/Application.h index 7bb1736fbb7..8d81487c916 100644 --- a/UI/AppKit/Application/Application.h +++ b/UI/AppKit/Application/Application.h @@ -14,7 +14,9 @@ #import namespace Ladybird { + class WebViewBridge; + } @interface Application : NSApplication diff --git a/UI/Qt/WebContentView.h b/UI/Qt/WebContentView.h index 93fa0b30468..87eaa1e0af5 100644 --- a/UI/Qt/WebContentView.h +++ b/UI/Qt/WebContentView.h @@ -32,7 +32,9 @@ class QSinglePointEvent; class QTextEdit; namespace WebView { + class WebContentClient; + } using WebView::WebContentClient;