diff --git a/AK/CMakeLists.txt b/AK/CMakeLists.txt index 64051dac995..778593085eb 100644 --- a/AK/CMakeLists.txt +++ b/AK/CMakeLists.txt @@ -2,9 +2,9 @@ set(AK_SOURCES Assertions.cpp Base64.cpp CircularBuffer.cpp + DeprecatedFlyString.cpp DeprecatedString.cpp FloatingPointStringConversions.cpp - FlyString.cpp Format.cpp FuzzyMatch.cpp GenericLexer.cpp diff --git a/AK/FlyString.cpp b/AK/DeprecatedFlyString.cpp similarity index 54% rename from AK/FlyString.cpp rename to AK/DeprecatedFlyString.cpp index 5dcd6ea9284..1d437702896 100644 --- a/AK/FlyString.cpp +++ b/AK/DeprecatedFlyString.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include #include #include #include @@ -14,7 +14,7 @@ namespace AK { -struct FlyStringImplTraits : public Traits { +struct DeprecatedFlyStringImplTraits : public Traits { static unsigned hash(StringImpl const* s) { return s ? s->hash() : 0; } static bool equals(StringImpl const* a, StringImpl const* b) { @@ -24,19 +24,19 @@ struct FlyStringImplTraits : public Traits { } }; -static Singleton> s_table; +static Singleton> s_table; -static HashTable& fly_impls() +static HashTable& fly_impls() { return *s_table; } -void FlyString::did_destroy_impl(Badge, StringImpl& impl) +void DeprecatedFlyString::did_destroy_impl(Badge, StringImpl& impl) { fly_impls().remove(&impl); } -FlyString::FlyString(DeprecatedString const& string) +DeprecatedFlyString::DeprecatedFlyString(DeprecatedString const& string) { if (string.is_null()) return; @@ -55,7 +55,7 @@ FlyString::FlyString(DeprecatedString const& string) } } -FlyString::FlyString(StringView string) +DeprecatedFlyString::DeprecatedFlyString(StringView string) { if (string.is_null()) return; @@ -74,70 +74,70 @@ FlyString::FlyString(StringView string) } template -Optional FlyString::to_int(TrimWhitespace trim_whitespace) const +Optional DeprecatedFlyString::to_int(TrimWhitespace trim_whitespace) const { return StringUtils::convert_to_int(view(), trim_whitespace); } -template Optional FlyString::to_int(TrimWhitespace) const; -template Optional FlyString::to_int(TrimWhitespace) const; -template Optional FlyString::to_int(TrimWhitespace) const; -template Optional FlyString::to_int(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_int(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_int(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_int(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_int(TrimWhitespace) const; template -Optional FlyString::to_uint(TrimWhitespace trim_whitespace) const +Optional DeprecatedFlyString::to_uint(TrimWhitespace trim_whitespace) const { return StringUtils::convert_to_uint(view(), trim_whitespace); } -template Optional FlyString::to_uint(TrimWhitespace) const; -template Optional FlyString::to_uint(TrimWhitespace) const; -template Optional FlyString::to_uint(TrimWhitespace) const; -template Optional FlyString::to_uint(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_uint(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_uint(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_uint(TrimWhitespace) const; +template Optional DeprecatedFlyString::to_uint(TrimWhitespace) const; #ifndef KERNEL -Optional FlyString::to_double(TrimWhitespace trim_whitespace) const +Optional DeprecatedFlyString::to_double(TrimWhitespace trim_whitespace) const { return StringUtils::convert_to_floating_point(view(), trim_whitespace); } -Optional FlyString::to_float(TrimWhitespace trim_whitespace) const +Optional DeprecatedFlyString::to_float(TrimWhitespace trim_whitespace) const { return StringUtils::convert_to_floating_point(view(), trim_whitespace); } #endif -bool FlyString::equals_ignoring_case(StringView other) const +bool DeprecatedFlyString::equals_ignoring_case(StringView other) const { return StringUtils::equals_ignoring_case(view(), other); } -bool FlyString::starts_with(StringView str, CaseSensitivity case_sensitivity) const +bool DeprecatedFlyString::starts_with(StringView str, CaseSensitivity case_sensitivity) const { return StringUtils::starts_with(view(), str, case_sensitivity); } -bool FlyString::ends_with(StringView str, CaseSensitivity case_sensitivity) const +bool DeprecatedFlyString::ends_with(StringView str, CaseSensitivity case_sensitivity) const { return StringUtils::ends_with(view(), str, case_sensitivity); } -FlyString FlyString::to_lowercase() const +DeprecatedFlyString DeprecatedFlyString::to_lowercase() const { return DeprecatedString(*m_impl).to_lowercase(); } -bool FlyString::operator==(DeprecatedString const& other) const +bool DeprecatedFlyString::operator==(DeprecatedString const& other) const { return m_impl == other.impl() || view() == other.view(); } -bool FlyString::operator==(StringView string) const +bool DeprecatedFlyString::operator==(StringView string) const { return view() == string; } -bool FlyString::operator==(char const* string) const +bool DeprecatedFlyString::operator==(char const* string) const { return view() == string; } diff --git a/AK/FlyString.h b/AK/DeprecatedFlyString.h similarity index 69% rename from AK/FlyString.h rename to AK/DeprecatedFlyString.h index 74e18dbb8da..513cbc3134d 100644 --- a/AK/FlyString.h +++ b/AK/DeprecatedFlyString.h @@ -11,39 +11,39 @@ namespace AK { -class FlyString { +class DeprecatedFlyString { public: - FlyString() = default; - FlyString(FlyString const& other) + DeprecatedFlyString() = default; + DeprecatedFlyString(DeprecatedFlyString const& other) : m_impl(other.impl()) { } - FlyString(FlyString&& other) + DeprecatedFlyString(DeprecatedFlyString&& other) : m_impl(move(other.m_impl)) { } - FlyString(DeprecatedString const&); - FlyString(StringView); - FlyString(char const* string) - : FlyString(static_cast(string)) + DeprecatedFlyString(DeprecatedString const&); + DeprecatedFlyString(StringView); + DeprecatedFlyString(char const* string) + : DeprecatedFlyString(static_cast(string)) { } - static FlyString from_fly_impl(NonnullRefPtr impl) + static DeprecatedFlyString from_fly_impl(NonnullRefPtr impl) { VERIFY(impl->is_fly()); - FlyString string; + DeprecatedFlyString string; string.m_impl = move(impl); return string; } - FlyString& operator=(FlyString const& other) + DeprecatedFlyString& operator=(DeprecatedFlyString const& other) { m_impl = other.m_impl; return *this; } - FlyString& operator=(FlyString&& other) + DeprecatedFlyString& operator=(DeprecatedFlyString&& other) { m_impl = move(other.m_impl); return *this; @@ -52,7 +52,7 @@ public: bool is_empty() const { return !m_impl || !m_impl->length(); } bool is_null() const { return !m_impl; } - bool operator==(FlyString const& other) const { return m_impl == other.m_impl; } + bool operator==(DeprecatedFlyString const& other) const { return m_impl == other.m_impl; } bool operator==(DeprecatedString const&) const; @@ -67,7 +67,7 @@ public: ALWAYS_INLINE u32 hash() const { return m_impl ? m_impl->existing_hash() : 0; } ALWAYS_INLINE StringView view() const { return m_impl ? m_impl->view() : StringView {}; } - FlyString to_lowercase() const; + DeprecatedFlyString to_lowercase() const; template Optional to_int(TrimWhitespace = TrimWhitespace::Yes) const; @@ -95,12 +95,12 @@ private: }; template<> -struct Traits : public GenericTraits { - static unsigned hash(FlyString const& s) { return s.hash(); } +struct Traits : public GenericTraits { + static unsigned hash(DeprecatedFlyString const& s) { return s.hash(); } }; } #if USING_AK_GLOBALLY -using AK::FlyString; +using AK::DeprecatedFlyString; #endif diff --git a/AK/DeprecatedString.cpp b/AK/DeprecatedString.cpp index a929824ea37..957dc3d675a 100644 --- a/AK/DeprecatedString.cpp +++ b/AK/DeprecatedString.cpp @@ -5,8 +5,8 @@ */ #include +#include #include -#include #include #include #include @@ -15,7 +15,7 @@ namespace AK { -bool DeprecatedString::operator==(FlyString const& fly_string) const +bool DeprecatedString::operator==(DeprecatedFlyString const& fly_string) const { return m_impl == fly_string.impl() || view() == fly_string.view(); } @@ -375,7 +375,7 @@ DeprecatedString escape_html_entities(StringView html) return builder.to_deprecated_string(); } -DeprecatedString::DeprecatedString(FlyString const& string) +DeprecatedString::DeprecatedString(DeprecatedFlyString const& string) : m_impl(string.impl()) { } diff --git a/AK/DeprecatedString.h b/AK/DeprecatedString.h index c126f2c21ac..f9e09ae0f1f 100644 --- a/AK/DeprecatedString.h +++ b/AK/DeprecatedString.h @@ -93,7 +93,7 @@ public: { } - DeprecatedString(FlyString const&); + DeprecatedString(DeprecatedFlyString const&); [[nodiscard]] static DeprecatedString repeated(char, size_t count); [[nodiscard]] static DeprecatedString repeated(StringView, size_t count); @@ -212,7 +212,7 @@ public: bool operator==(StringView) const; - bool operator==(FlyString const&) const; + bool operator==(DeprecatedFlyString const&) const; bool operator<(DeprecatedString const&) const; bool operator<(char const*) const; diff --git a/AK/Format.h b/AK/Format.h index cb35323e609..a7a1080b9b5 100644 --- a/AK/Format.h +++ b/AK/Format.h @@ -461,7 +461,7 @@ template<> struct Formatter : Formatter { }; template<> -struct Formatter : Formatter { +struct Formatter : Formatter { }; template diff --git a/AK/Forward.h b/AK/Forward.h index 3803009a4ae..6805f659b12 100644 --- a/AK/Forward.h +++ b/AK/Forward.h @@ -27,13 +27,13 @@ class JsonArray; class JsonObject; class JsonValue; class StackInfo; +class DeprecatedFlyString; class DeprecatedString; class StringBuilder; class StringImpl; class StringView; class Time; class URL; -class FlyString; class String; class Utf16View; class Utf32View; @@ -160,6 +160,7 @@ using AK::Bytes; using AK::CircularBuffer; using AK::CircularDuplexStream; using AK::CircularQueue; +using AK::DeprecatedFlyString; using AK::DeprecatedString; using AK::DoublyLinkedList; using AK::DuplexMemoryStream; @@ -167,7 +168,6 @@ using AK::Error; using AK::ErrorOr; using AK::FixedArray; using AK::FixedPoint; -using AK::FlyString; using AK::Function; using AK::GenericLexer; using AK::HashMap; diff --git a/AK/StringImpl.cpp b/AK/StringImpl.cpp index 76cc66e431f..56f2cc73de7 100644 --- a/AK/StringImpl.cpp +++ b/AK/StringImpl.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include @@ -32,7 +32,7 @@ StringImpl::StringImpl(ConstructWithInlineBufferTag, size_t length) StringImpl::~StringImpl() { if (m_fly) - FlyString::did_destroy_impl({}, *this); + DeprecatedFlyString::did_destroy_impl({}, *this); } NonnullRefPtr StringImpl::create_uninitialized(size_t length, char*& buffer) diff --git a/AK/StringImpl.h b/AK/StringImpl.h index 85ad9d62aee..00b40812b53 100644 --- a/AK/StringImpl.h +++ b/AK/StringImpl.h @@ -78,7 +78,7 @@ public: unsigned case_insensitive_hash() const; bool is_fly() const { return m_fly; } - void set_fly(Badge, bool fly) const { m_fly = fly; } + void set_fly(Badge, bool fly) const { m_fly = fly; } private: enum ConstructTheEmptyStringImplTag { diff --git a/AK/StringView.cpp b/AK/StringView.cpp index 8d907e4d858..1d8e6fe1520 100644 --- a/AK/StringView.cpp +++ b/AK/StringView.cpp @@ -13,8 +13,8 @@ #include #ifndef KERNEL +# include # include -# include # include #endif @@ -33,7 +33,7 @@ StringView::StringView(DeprecatedString const& string) { } -StringView::StringView(FlyString const& string) +StringView::StringView(DeprecatedFlyString const& string) : m_characters(string.characters()) , m_length(string.length()) { diff --git a/AK/StringView.h b/AK/StringView.h index 7cbc760af9c..7fd23ef3333 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -50,14 +50,14 @@ public: #ifndef KERNEL StringView(String const&); StringView(DeprecatedString const&); - StringView(FlyString const&); + StringView(DeprecatedFlyString const&); #endif explicit StringView(ByteBuffer&&) = delete; #ifndef KERNEL explicit StringView(String&&) = delete; explicit StringView(DeprecatedString&&) = delete; - explicit StringView(FlyString&&) = delete; + explicit StringView(DeprecatedFlyString&&) = delete; #endif [[nodiscard]] constexpr bool is_null() const diff --git a/Tests/AK/TestDeprecatedString.cpp b/Tests/AK/TestDeprecatedString.cpp index 0502df68385..6442379642e 100644 --- a/Tests/AK/TestDeprecatedString.cpp +++ b/Tests/AK/TestDeprecatedString.cpp @@ -6,8 +6,8 @@ #include +#include #include -#include #include #include #include @@ -145,18 +145,18 @@ TEST_CASE(to_uppercase) TEST_CASE(flystring) { { - FlyString a("foo"); - FlyString b("foo"); + DeprecatedFlyString a("foo"); + DeprecatedFlyString b("foo"); EXPECT_EQ(a.impl(), b.impl()); } { DeprecatedString a = "foo"; - FlyString b = a; + DeprecatedFlyString b = a; StringBuilder builder; builder.append('f'); builder.append("oo"sv); - FlyString c = builder.to_deprecated_string(); + DeprecatedFlyString c = builder.to_deprecated_string(); EXPECT_EQ(a.impl(), b.impl()); EXPECT_EQ(a.impl(), c.impl()); } diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index d7f4418b9e9..d590b727874 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -410,7 +410,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path auto const& frame = stack_array.at(i); auto ptr = frame.to_number(); u32 offset = 0; - FlyString object_name; + DeprecatedFlyString object_name; DeprecatedString symbol; if (maybe_kernel_base.has_value() && ptr >= maybe_kernel_base.value()) { @@ -610,7 +610,7 @@ ProfileNode::ProfileNode(Process const& process) { } -ProfileNode::ProfileNode(Process const& process, FlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) +ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) : m_process(process) , m_symbol(move(symbol)) , m_pid(pid) diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h index 5c89d88fe15..c8c4d24d915 100644 --- a/Userland/DevTools/Profiler/Profile.h +++ b/Userland/DevTools/Profiler/Profile.h @@ -15,7 +15,7 @@ #include "SignpostsModel.h" #include "SourceModel.h" #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ extern OwnPtr g_kernel_debug_info; class ProfileNode : public RefCounted { public: - static NonnullRefPtr create(Process const& process, FlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) + static NonnullRefPtr create(Process const& process, DeprecatedFlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) { return adopt_ref(*new ProfileNode(process, object_name, move(symbol), address, offset, timestamp, pid)); } @@ -53,7 +53,7 @@ public: bool has_seen_event(size_t event_index) const { return m_seen_events.get(event_index); } void did_see_event(size_t event_index) { m_seen_events.set(event_index, true); } - FlyString const& object_name() const { return m_object_name; } + DeprecatedFlyString const& object_name() const { return m_object_name; } DeprecatedString const& symbol() const { return m_symbol; } FlatPtr address() const { return m_address; } u32 offset() const { return m_offset; } @@ -74,7 +74,7 @@ public: m_children.append(child); } - ProfileNode& find_or_create_child(FlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) + ProfileNode& find_or_create_child(DeprecatedFlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) { for (size_t i = 0; i < m_children.size(); ++i) { auto& child = m_children[i]; @@ -112,12 +112,12 @@ public: private: explicit ProfileNode(Process const&); - explicit ProfileNode(Process const&, FlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t); + explicit ProfileNode(Process const&, DeprecatedFlyString const& object_name, DeprecatedString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t); bool m_root { false }; Process const& m_process; ProfileNode* m_parent { nullptr }; - FlyString m_object_name; + DeprecatedFlyString m_object_name; DeprecatedString m_symbol; pid_t m_pid { 0 }; FlatPtr m_address { 0 }; @@ -166,7 +166,7 @@ public: Vector> const& roots() const { return m_roots; } struct Frame { - FlyString object_name; + DeprecatedFlyString object_name; DeprecatedString symbol; FlatPtr address { 0 }; u32 offset { 0 }; diff --git a/Userland/Libraries/LibAudio/FlacLoader.cpp b/Userland/Libraries/LibAudio/FlacLoader.cpp index edc9fe77588..2d697a538f2 100644 --- a/Userland/Libraries/LibAudio/FlacLoader.cpp +++ b/Userland/Libraries/LibAudio/FlacLoader.cpp @@ -5,9 +5,9 @@ */ #include +#include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibAudio/LoaderError.h b/Userland/Libraries/LibAudio/LoaderError.h index 78e47e5e6c4..2464d5cb64c 100644 --- a/Userland/Libraries/LibAudio/LoaderError.h +++ b/Userland/Libraries/LibAudio/LoaderError.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include namespace Audio { @@ -28,20 +28,20 @@ struct LoaderError { Category category { Category::Unknown }; // Binary index: where in the file the error occurred. size_t index { 0 }; - FlyString description { DeprecatedString::empty() }; + DeprecatedFlyString description { DeprecatedString::empty() }; constexpr LoaderError() = default; - LoaderError(Category category, size_t index, FlyString description) + LoaderError(Category category, size_t index, DeprecatedFlyString description) : category(category) , index(index) , description(move(description)) { } - LoaderError(FlyString description) + LoaderError(DeprecatedFlyString description) : description(move(description)) { } - LoaderError(Category category, FlyString description) + LoaderError(Category category, DeprecatedFlyString description) : category(category) , description(move(description)) { diff --git a/Userland/Libraries/LibCpp/AST.h b/Userland/Libraries/LibCpp/AST.h index 095306e585c..1b997c05310 100644 --- a/Userland/Libraries/LibCpp/AST.h +++ b/Userland/Libraries/LibCpp/AST.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include #include #include @@ -47,7 +47,7 @@ public: VERIFY(m_end.has_value()); return m_end.value(); } - FlyString const& filename() const + DeprecatedFlyString const& filename() const { return m_filename; } @@ -78,7 +78,7 @@ private: ASTNode* m_parent { nullptr }; Optional m_start; Optional m_end; - FlyString m_filename; + DeprecatedFlyString m_filename; }; class TranslationUnit : public ASTNode { diff --git a/Userland/Libraries/LibCpp/Preprocessor.h b/Userland/Libraries/LibCpp/Preprocessor.h index de56ca997d5..eb98146a5a5 100644 --- a/Userland/Libraries/LibCpp/Preprocessor.h +++ b/Userland/Libraries/LibCpp/Preprocessor.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include #include #include @@ -28,7 +28,7 @@ public: DeprecatedString key; Vector parameters; DeprecatedString value; - FlyString filename; + DeprecatedFlyString filename; size_t line { 0 }; size_t column { 0 }; }; diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index 25d976d4175..4df6cb3fb35 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -86,8 +86,8 @@ void DebugInfo::prepare_lines() all_lines.extend(unit.line_program().lines()); }); - HashMap> memoized_full_paths; - auto compute_full_path = [&](FlyString const& file_path) -> Optional { + HashMap> memoized_full_paths; + auto compute_full_path = [&](DeprecatedFlyString const& file_path) -> Optional { if (file_path.view().contains("Toolchain/"sv) || file_path.view().contains("libgcc"sv)) return {}; if (file_path.view().starts_with("./"sv) && !m_source_root.is_null()) diff --git a/Userland/Libraries/LibDebug/DebugInfo.h b/Userland/Libraries/LibDebug/DebugInfo.h index b73c272ca95..7bb8ff1de50 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.h +++ b/Userland/Libraries/LibDebug/DebugInfo.h @@ -29,7 +29,7 @@ public: ELF::Image const& elf() const { return m_elf; } struct SourcePosition { - FlyString file_path; + DeprecatedFlyString file_path; size_t line_number { 0 }; Optional address_of_first_statement; diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp index b1d4bfb4a1f..55d339100da 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp @@ -138,7 +138,7 @@ void LineProgram::append_to_line_info() full_path.append('/'); full_path.append(m_source_files[m_file_index].name); - m_lines.append({ m_address, FlyString { full_path.string_view() }, m_line }); + m_lines.append({ m_address, DeprecatedFlyString { full_path.string_view() }, m_line }); } void LineProgram::reset_registers() diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h index f09727c0058..089a9098956 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -112,20 +112,20 @@ public: struct LineInfo { FlatPtr address { 0 }; - FlyString file; + DeprecatedFlyString file; size_t line { 0 }; }; Vector const& lines() const { return m_lines; } struct DirectoryAndFile { - FlyString directory; - FlyString filename; + DeprecatedFlyString directory; + DeprecatedFlyString filename; }; DirectoryAndFile get_directory_and_file(size_t file_index) const; struct FileEntry { - FlyString name; + DeprecatedFlyString name; size_t directory_index { 0 }; }; Vector const& source_files() const { return m_source_files; } diff --git a/Userland/Libraries/LibGfx/Font/FontDatabase.cpp b/Userland/Libraries/LibGfx/Font/FontDatabase.cpp index 42c66122fcf..d9e5d058c16 100644 --- a/Userland/Libraries/LibGfx/Font/FontDatabase.cpp +++ b/Userland/Libraries/LibGfx/Font/FontDatabase.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include @@ -118,7 +118,7 @@ Font& FontDatabase::default_fixed_width_font() struct FontDatabase::Private { HashMap> full_name_to_font_map; - HashMap>> typefaces; + HashMap>> typefaces; }; void FontDatabase::load_all_fonts_from_path(DeprecatedString const& root) @@ -214,7 +214,7 @@ RefPtr FontDatabase::get_by_name(StringView name) return it->value; } -RefPtr FontDatabase::get(FlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch allow_inexact_size_match) +RefPtr FontDatabase::get(DeprecatedFlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch allow_inexact_size_match) { auto it = m_private->typefaces.find(family); if (it == m_private->typefaces.end()) @@ -226,7 +226,7 @@ RefPtr FontDatabase::get(FlyString const& family, float point_size, u return nullptr; } -RefPtr FontDatabase::get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match) +RefPtr FontDatabase::get(DeprecatedFlyString const& family, DeprecatedFlyString const& variant, float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match) { auto it = m_private->typefaces.find(family); if (it == m_private->typefaces.end()) diff --git a/Userland/Libraries/LibGfx/Font/FontDatabase.h b/Userland/Libraries/LibGfx/Font/FontDatabase.h index f46e47b395b..64b9376e532 100644 --- a/Userland/Libraries/LibGfx/Font/FontDatabase.h +++ b/Userland/Libraries/LibGfx/Font/FontDatabase.h @@ -48,8 +48,8 @@ public: static void set_fixed_width_font_query(DeprecatedString); static void set_default_fonts_lookup_path(DeprecatedString); - RefPtr get(FlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No); - RefPtr get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No); + RefPtr get(DeprecatedFlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No); + RefPtr get(DeprecatedFlyString const& family, DeprecatedFlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No); RefPtr get_by_name(StringView); void for_each_font(Function); void for_each_fixed_width_font(Function); diff --git a/Userland/Libraries/LibGfx/Font/Typeface.h b/Userland/Libraries/LibGfx/Font/Typeface.h index 0e445bf76d4..67e3d71436e 100644 --- a/Userland/Libraries/LibGfx/Font/Typeface.h +++ b/Userland/Libraries/LibGfx/Font/Typeface.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -24,8 +24,8 @@ public: { } - FlyString const& family() const { return m_family; } - FlyString const& variant() const { return m_variant; } + DeprecatedFlyString const& family() const { return m_family; } + DeprecatedFlyString const& variant() const { return m_variant; } unsigned weight() const; u8 slope() const; @@ -39,8 +39,8 @@ public: RefPtr get_font(float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No) const; private: - FlyString m_family; - FlyString m_variant; + DeprecatedFlyString m_family; + DeprecatedFlyString m_variant; Vector> m_bitmap_fonts; RefPtr m_vector_font; diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 551c2e7a9b0..37832debcd8 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -85,7 +85,7 @@ static void print_indent(int indent) out("{}", DeprecatedString::repeated(' ', indent * 2)); } -static void update_function_name(Value value, FlyString const& name) +static void update_function_name(Value value, DeprecatedFlyString const& name) { if (!value.is_function()) return; @@ -116,7 +116,7 @@ Completion ScopeNode::evaluate_statements(Interpreter& interpreter) const // 14.13.4 Runtime Semantics: LabelledEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-labelledevaluation // BreakableStatement : IterationStatement -static Completion labelled_evaluation(Interpreter& interpreter, IterationStatement const& statement, Vector const& label_set) +static Completion labelled_evaluation(Interpreter& interpreter, IterationStatement const& statement, Vector const& label_set) { // 1. Let stmtResult be Completion(LoopEvaluation of IterationStatement with argument labelSet). auto result = statement.loop_evaluation(interpreter, label_set); @@ -137,7 +137,7 @@ static Completion labelled_evaluation(Interpreter& interpreter, IterationStateme // 14.13.4 Runtime Semantics: LabelledEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-labelledevaluation // BreakableStatement : SwitchStatement -static Completion labelled_evaluation(Interpreter& interpreter, SwitchStatement const& statement, Vector const&) +static Completion labelled_evaluation(Interpreter& interpreter, SwitchStatement const& statement, Vector const&) { // 1. Let stmtResult be the result of evaluating SwitchStatement. auto result = statement.execute_impl(interpreter); @@ -158,7 +158,7 @@ static Completion labelled_evaluation(Interpreter& interpreter, SwitchStatement // 14.13.4 Runtime Semantics: LabelledEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-labelledevaluation // LabelledStatement : LabelIdentifier : LabelledItem -static Completion labelled_evaluation(Interpreter& interpreter, LabelledStatement const& statement, Vector const& label_set) +static Completion labelled_evaluation(Interpreter& interpreter, LabelledStatement const& statement, Vector const& label_set) { auto const& labelled_item = *statement.labelled_item(); @@ -167,7 +167,7 @@ static Completion labelled_evaluation(Interpreter& interpreter, LabelledStatemen // 2. Let newLabelSet be the list-concatenation of labelSet and « label ». // Optimization: Avoid vector copy if possible. - Optional> new_label_set; + Optional> new_label_set; if (is(labelled_item) || is(labelled_item) || is(labelled_item)) { new_label_set = label_set; new_label_set->append(label); @@ -298,7 +298,7 @@ Completion FunctionExpression::execute(Interpreter& interpreter) const } // 15.2.5 Runtime Semantics: InstantiateOrdinaryFunctionExpression, https://tc39.es/ecma262/#sec-runtime-semantics-instantiateordinaryfunctionexpression -Value FunctionExpression::instantiate_ordinary_function_expression(Interpreter& interpreter, FlyString given_name) const +Value FunctionExpression::instantiate_ordinary_function_expression(Interpreter& interpreter, DeprecatedFlyString given_name) const { auto& vm = interpreter.vm(); auto& realm = *vm.current_realm(); @@ -637,7 +637,7 @@ Completion WithStatement::execute(Interpreter& interpreter) const } // 14.7.1.1 LoopContinues ( completion, labelSet ), https://tc39.es/ecma262/#sec-loopcontinues -static bool loop_continues(Completion const& completion, Vector const& label_set) +static bool loop_continues(Completion const& completion, Vector const& label_set) { // 1. If completion.[[Type]] is normal, return true. if (completion.type() == Completion::Type::Normal) @@ -669,7 +669,7 @@ Completion WhileStatement::execute(Interpreter& interpreter) const } // 14.7.3.2 Runtime Semantics: WhileLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-whileloopevaluation -Completion WhileStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion WhileStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; @@ -711,7 +711,7 @@ Completion DoWhileStatement::execute(Interpreter& interpreter) const } // 14.7.2.2 Runtime Semantics: DoWhileLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-dowhileloopevaluation -Completion DoWhileStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion DoWhileStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; @@ -753,7 +753,7 @@ Completion ForStatement::execute(Interpreter& interpreter) const } // 14.7.4.2 Runtime Semantics: ForLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-forloopevaluation -Completion ForStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion ForStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; auto& vm = interpreter.vm(); @@ -1055,7 +1055,7 @@ Completion ForInStatement::execute(Interpreter& interpreter) const } // 14.7.5.5 Runtime Semantics: ForInOfLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation -Completion ForInStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion ForInStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; auto& vm = interpreter.vm(); @@ -1121,7 +1121,7 @@ Completion ForOfStatement::execute(Interpreter& interpreter) const } // 14.7.5.5 Runtime Semantics: ForInOfLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation -Completion ForOfStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion ForOfStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; auto& vm = interpreter.vm(); @@ -1185,7 +1185,7 @@ Completion ForAwaitOfStatement::execute(Interpreter& interpreter) const } // 14.7.5.5 Runtime Semantics: ForInOfLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation -Completion ForAwaitOfStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const +Completion ForAwaitOfStatement::loop_evaluation(Interpreter& interpreter, Vector const& label_set) const { InterpreterNodeScope node_scope { interpreter, *this }; auto& vm = interpreter.vm(); @@ -1653,7 +1653,7 @@ ThrowCompletionOr ClassMethod::class_element_evaluatio // 10.2.1.3 Runtime Semantics: EvaluateBody, https://tc39.es/ecma262/#sec-runtime-semantics-evaluatebody class ClassFieldInitializerStatement : public Statement { public: - ClassFieldInitializerStatement(SourceRange source_range, NonnullRefPtr expression, FlyString field_name) + ClassFieldInitializerStatement(SourceRange source_range, NonnullRefPtr expression, DeprecatedFlyString field_name) : Statement(source_range) , m_expression(move(expression)) , m_class_field_identifier_name(move(field_name)) @@ -1687,7 +1687,7 @@ public: private: NonnullRefPtr m_expression; - FlyString m_class_field_identifier_name; // [[ClassFieldIdentifierName]] + DeprecatedFlyString m_class_field_identifier_name; // [[ClassFieldIdentifierName]] }; // 15.7.10 Runtime Semantics: ClassFieldDefinitionEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-classfielddefinitionevaluation @@ -1722,19 +1722,19 @@ ThrowCompletionOr ClassField::class_element_evaluation }; } -static Optional nullopt_or_private_identifier_description(Expression const& expression) +static Optional nullopt_or_private_identifier_description(Expression const& expression) { if (is(expression)) return static_cast(expression).string(); return {}; } -Optional ClassField::private_bound_identifier() const +Optional ClassField::private_bound_identifier() const { return nullopt_or_private_identifier_description(*m_key); } -Optional ClassMethod::private_bound_identifier() const +Optional ClassMethod::private_bound_identifier() const { return nullopt_or_private_identifier_description(*m_key); } @@ -1834,7 +1834,7 @@ Completion ClassDeclaration::execute(Interpreter& interpreter) const } // 15.7.14 Runtime Semantics: ClassDefinitionEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-classdefinitionevaluation -ThrowCompletionOr ClassExpression::class_definition_evaluation(Interpreter& interpreter, FlyString const& binding_name, FlyString const& class_name) const +ThrowCompletionOr ClassExpression::class_definition_evaluation(Interpreter& interpreter, DeprecatedFlyString const& binding_name, DeprecatedFlyString const& class_name) const { auto& vm = interpreter.vm(); auto& realm = *vm.current_realm(); @@ -2201,7 +2201,7 @@ void ClassDeclaration::dump(int indent) const m_class_expression->dump(indent + 1); } -ThrowCompletionOr ClassDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr ClassDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const { if (m_class_expression->name().is_empty()) return {}; @@ -2331,7 +2331,7 @@ bool BindingPattern::contains_expression() const return false; } -ThrowCompletionOr BindingPattern::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr BindingPattern::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const { for (auto const& entry : entries) { auto const& alias = entry.alias; @@ -2411,7 +2411,7 @@ void FunctionNode::dump(int indent, DeprecatedString const& class_name) const if (parameter.is_rest) out("..."); parameter.binding.visit( - [&](FlyString const& name) { + [&](DeprecatedFlyString const& name) { outln("{}", name); }, [&](BindingPattern const& pattern) { @@ -2431,7 +2431,7 @@ void FunctionDeclaration::dump(int indent) const FunctionNode::dump(indent, class_name()); } -ThrowCompletionOr FunctionDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr FunctionDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const { if (name().is_empty()) return {}; @@ -2975,7 +2975,7 @@ Completion VariableDeclarator::execute(Interpreter& interpreter) const VERIFY_NOT_REACHED(); } -ThrowCompletionOr VariableDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr VariableDeclaration::for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const { for (auto const& entry : declarations()) { TRY(entry.target().visit( @@ -3808,7 +3808,7 @@ void CatchClause::dump(int indent) const { print_indent(indent); m_parameter.visit( - [&](FlyString const& parameter) { + [&](DeprecatedFlyString const& parameter) { if (parameter.is_null()) outln("CatchClause"); else @@ -3845,7 +3845,7 @@ Completion TryStatement::execute(Interpreter& interpreter) const auto catch_environment = new_declarative_environment(*old_environment); m_handler->parameter().visit( - [&](FlyString const& parameter) { + [&](DeprecatedFlyString const& parameter) { // 3. For each element argName of the BoundNames of CatchParameter, do // a. Perform ! catchEnv.CreateMutableBinding(argName, false). MUST(catch_environment->create_mutable_binding(vm, parameter, false)); @@ -3863,7 +3863,7 @@ Completion TryStatement::execute(Interpreter& interpreter) const // 5. Let status be Completion(BindingInitialization of CatchParameter with arguments thrownValue and catchEnv). auto status = m_handler->parameter().visit( - [&](FlyString const& parameter) { + [&](DeprecatedFlyString const& parameter) { return catch_environment->initialize_binding(vm, parameter, thrown_value); }, [&](NonnullRefPtr const& pattern) { @@ -4333,7 +4333,7 @@ ThrowCompletionOr ScopeNode::for_each_lexically_scoped_declaration(ThrowCo return {}; } -ThrowCompletionOr ScopeNode::for_each_lexically_declared_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr ScopeNode::for_each_lexically_declared_name(ThrowCompletionOrVoidCallback&& callback) const { for (auto const& declaration : m_lexical_declarations) { TRY(declaration.for_each_bound_name([&](auto const& name) { @@ -4343,7 +4343,7 @@ ThrowCompletionOr ScopeNode::for_each_lexically_declared_name(ThrowComplet return {}; } -ThrowCompletionOr ScopeNode::for_each_var_declared_name(ThrowCompletionOrVoidCallback&& callback) const +ThrowCompletionOr ScopeNode::for_each_var_declared_name(ThrowCompletionOrVoidCallback&& callback) const { for (auto& declaration : m_var_declarations) { TRY(declaration.for_each_bound_name([&](auto const& name) { @@ -4407,7 +4407,7 @@ Completion ImportStatement::execute(Interpreter& interpreter) const return Optional {}; } -FlyString ExportStatement::local_name_for_default = "*default*"; +DeprecatedFlyString ExportStatement::local_name_for_default = "*default*"; // 16.2.3.7 Runtime Semantics: Evaluation, https://tc39.es/ecma262/#sec-exports-runtime-semantics-evaluation Completion ExportStatement::execute(Interpreter& interpreter) const @@ -4557,7 +4557,7 @@ void ImportStatement::dump(int indent) const } } -bool ExportStatement::has_export(FlyString const& export_name) const +bool ExportStatement::has_export(DeprecatedFlyString const& export_name) const { return any_of(m_entries.begin(), m_entries.end(), [&](auto& entry) { // Make sure that empty exported names does not overlap with anything @@ -4567,7 +4567,7 @@ bool ExportStatement::has_export(FlyString const& export_name) const }); } -bool ImportStatement::has_bound_name(FlyString const& name) const +bool ImportStatement::has_bound_name(DeprecatedFlyString const& name) const { return any_of(m_entries.begin(), m_entries.end(), [&](auto& entry) { return entry.local_name == name; @@ -4613,7 +4613,7 @@ ThrowCompletionOr Program::global_declaration_instantiation(Interpreter& i // 1. Let lexNames be the LexicallyDeclaredNames of script. // 2. Let varNames be the VarDeclaredNames of script. // 3. For each element name of lexNames, do - TRY(for_each_lexically_declared_name([&](FlyString const& name) -> ThrowCompletionOr { + TRY(for_each_lexically_declared_name([&](DeprecatedFlyString const& name) -> ThrowCompletionOr { // a. If env.HasVarDeclaration(name) is true, throw a SyntaxError exception. if (global_environment.has_var_declaration(name)) return vm.throw_completion(ErrorType::TopLevelVariableAlreadyDeclared, name); @@ -4646,7 +4646,7 @@ ThrowCompletionOr Program::global_declaration_instantiation(Interpreter& i Vector functions_to_initialize; // 7. Let declaredFunctionNames be a new empty List. - HashTable declared_function_names; + HashTable declared_function_names; // 8. For each element d of varDeclarations, in reverse List order, do @@ -4681,7 +4681,7 @@ ThrowCompletionOr Program::global_declaration_instantiation(Interpreter& i })); // 9. Let declaredVarNames be a new empty List. - HashTable declared_var_names; + HashTable declared_var_names; // 10. For each element d of varDeclarations, do TRY(for_each_var_scoped_variable_declaration([&](Declaration const& declaration) { @@ -4808,7 +4808,7 @@ ThrowCompletionOr Program::global_declaration_instantiation(Interpreter& i return {}; } -ModuleRequest::ModuleRequest(FlyString module_specifier_, Vector assertions_) +ModuleRequest::ModuleRequest(DeprecatedFlyString module_specifier_, Vector assertions_) : module_specifier(move(module_specifier_)) , assertions(move(assertions_)) { diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 8c53cdeff66..8f55a475ccd 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -8,8 +8,8 @@ #pragma once +#include #include -#include #include #include #include @@ -152,7 +152,7 @@ public: // 14.13 Labelled Statements, https://tc39.es/ecma262/#sec-labelled-statements class LabelledStatement : public Statement { public: - LabelledStatement(SourceRange source_range, FlyString label, NonnullRefPtr labelled_item) + LabelledStatement(SourceRange source_range, DeprecatedFlyString label, NonnullRefPtr labelled_item) : Statement(source_range) , m_label(move(label)) , m_labelled_item(move(labelled_item)) @@ -162,17 +162,17 @@ public: virtual Completion execute(Interpreter&) const override; virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; - FlyString const& label() const { return m_label; } - FlyString& label() { return m_label; } + DeprecatedFlyString const& label() const { return m_label; } + DeprecatedFlyString& label() { return m_label; } NonnullRefPtr const& labelled_item() const { return m_labelled_item; } NonnullRefPtr& labelled_item() { return m_labelled_item; } private: virtual bool is_labelled_statement() const final { return true; } - FlyString m_label; + DeprecatedFlyString m_label; NonnullRefPtr m_labelled_item; }; @@ -180,19 +180,19 @@ class LabelableStatement : public Statement { public: using Statement::Statement; - Vector const& labels() const { return m_labels; } - virtual void add_label(FlyString string) { m_labels.append(move(string)); } + Vector const& labels() const { return m_labels; } + virtual void add_label(DeprecatedFlyString string) { m_labels.append(move(string)); } protected: - Vector m_labels; + Vector m_labels; }; class IterationStatement : public Statement { public: using Statement::Statement; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const = 0; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const = 0; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; private: virtual bool is_iteration_statement() const final { return true; } @@ -305,9 +305,9 @@ public: [[nodiscard]] size_t lexical_declaration_count() const { return m_lexical_declarations.size(); } ThrowCompletionOr for_each_lexically_scoped_declaration(ThrowCompletionOrVoidCallback&& callback) const; - ThrowCompletionOr for_each_lexically_declared_name(ThrowCompletionOrVoidCallback&& callback) const; + ThrowCompletionOr for_each_lexically_declared_name(ThrowCompletionOrVoidCallback&& callback) const; - ThrowCompletionOr for_each_var_declared_name(ThrowCompletionOrVoidCallback&& callback) const; + ThrowCompletionOr for_each_var_declared_name(ThrowCompletionOrVoidCallback&& callback) const; ThrowCompletionOr for_each_var_function_declaration_in_reverse_order(ThrowCompletionOrVoidCallback&& callback) const; ThrowCompletionOr for_each_var_scoped_variable_declaration(ThrowCompletionOrVoidCallback&& callback) const; @@ -334,11 +334,11 @@ private: // ImportEntry Record, https://tc39.es/ecma262/#table-importentry-record-fields struct ImportEntry { - FlyString import_name; // [[ImportName]] if a String - FlyString local_name; // [[LocalName]] - bool is_namespace { false }; // [[ImportName]] if `namespace-object` + DeprecatedFlyString import_name; // [[ImportName]] if a String + DeprecatedFlyString local_name; // [[LocalName]] + bool is_namespace { false }; // [[ImportName]] if `namespace-object` - ImportEntry(FlyString import_name_, FlyString local_name_, bool is_namespace_ = false) + ImportEntry(DeprecatedFlyString import_name_, DeprecatedFlyString local_name_, bool is_namespace_ = false) : import_name(move(import_name_)) , local_name(move(local_name_)) , is_namespace(is_namespace_) @@ -372,7 +372,7 @@ public: virtual void dump(int indent) const override; - bool has_bound_name(FlyString const& name) const; + bool has_bound_name(DeprecatedFlyString const& name) const; Vector const& entries() const { return m_entries; } ModuleRequest const& module_request() const { return m_module_request; } ModuleRequest& module_request() { return m_module_request; } @@ -395,10 +395,10 @@ struct ExportEntry { EmptyNamedExport, } kind; - FlyString export_name; // [[ExportName]] - FlyString local_or_import_name; // Either [[ImportName]] or [[LocalName]] + DeprecatedFlyString export_name; // [[ExportName]] + DeprecatedFlyString local_or_import_name; // Either [[ImportName]] or [[LocalName]] - ExportEntry(Kind export_kind, FlyString export_name_, FlyString local_or_import_name_) + ExportEntry(Kind export_kind, DeprecatedFlyString export_name_, DeprecatedFlyString local_or_import_name_) : kind(export_kind) , export_name(move(export_name_)) , local_or_import_name(move(local_or_import_name_)) @@ -410,7 +410,7 @@ struct ExportEntry { return m_module_request != nullptr; } - static ExportEntry indirect_export_entry(ModuleRequest const& module_request, FlyString export_name, FlyString import_name) + static ExportEntry indirect_export_entry(ModuleRequest const& module_request, DeprecatedFlyString export_name, DeprecatedFlyString import_name) { ExportEntry entry { Kind::NamedExport, move(export_name), move(import_name) }; entry.m_module_request = &module_request; @@ -428,7 +428,7 @@ private: friend class ExportStatement; public: - static ExportEntry named_export(FlyString export_name, FlyString local_name) + static ExportEntry named_export(DeprecatedFlyString export_name, DeprecatedFlyString local_name) { return ExportEntry { Kind::NamedExport, move(export_name), move(local_name) }; } @@ -438,7 +438,7 @@ public: return ExportEntry { Kind::ModuleRequestAllButDefault, {}, {} }; } - static ExportEntry all_module_request(FlyString export_name) + static ExportEntry all_module_request(DeprecatedFlyString export_name) { return ExportEntry { Kind::ModuleRequestAll, move(export_name), {} }; } @@ -451,7 +451,7 @@ public: class ExportStatement final : public Statement { public: - static FlyString local_name_for_default; + static DeprecatedFlyString local_name_for_default; ExportStatement(SourceRange source_range, RefPtr statement, Vector entries, bool is_default_export, ModuleRequest module_request) : Statement(source_range) @@ -470,7 +470,7 @@ public: virtual void dump(int indent) const override; - bool has_export(FlyString const& export_name) const; + bool has_export(DeprecatedFlyString const& export_name) const; bool has_statement() const { return m_statement; } Vector const& entries() const { return m_entries; } @@ -592,7 +592,7 @@ public: { } - virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const = 0; + virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const = 0; // 8.1.3 Static Semantics: IsConstantDeclaration, https://tc39.es/ecma262/#sec-static-semantics-isconstantdeclaration virtual bool is_constant_declaration() const { return false; } @@ -608,7 +608,7 @@ public: } Completion execute(Interpreter&) const override { return {}; } - ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&&) const override + ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&&) const override { VERIFY_NOT_REACHED(); } @@ -633,7 +633,7 @@ struct BindingPattern : RefCounted { void dump(int indent) const; - ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const; + ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const; bool contains_expression() const; @@ -642,14 +642,14 @@ struct BindingPattern : RefCounted { }; struct FunctionParameter { - Variant> binding; + Variant> binding; RefPtr default_value; bool is_rest { false }; }; class FunctionNode { public: - FlyString const& name() const { return m_name; } + DeprecatedFlyString const& name() const { return m_name; } DeprecatedString const& source_text() const { return m_source_text; } Statement const& body() const { return *m_body; } Vector const& parameters() const { return m_parameters; }; @@ -661,7 +661,7 @@ public: FunctionKind kind() const { return m_kind; } protected: - FunctionNode(FlyString name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function) + FunctionNode(DeprecatedFlyString name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function) : m_name(move(name)) , m_source_text(move(source_text)) , m_body(move(body)) @@ -680,7 +680,7 @@ protected: void dump(int indent, DeprecatedString const& class_name) const; private: - FlyString m_name; + DeprecatedFlyString m_name; DeprecatedString m_source_text; NonnullRefPtr m_body; Vector const m_parameters; @@ -698,7 +698,7 @@ class FunctionDeclaration final public: static bool must_have_name() { return true; } - FunctionDeclaration(SourceRange source_range, FlyString const& name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval) + FunctionDeclaration(SourceRange source_range, DeprecatedFlyString const& name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval) : Declaration(source_range) , FunctionNode(name, move(source_text), move(body), move(parameters), function_length, kind, is_strict_mode, might_need_arguments_object, contains_direct_call_to_eval, false) { @@ -708,7 +708,7 @@ public: virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; + virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; virtual bool is_function_declaration() const override { return true; } @@ -724,7 +724,7 @@ class FunctionExpression final public: static bool must_have_name() { return false; } - FunctionExpression(SourceRange source_range, FlyString const& name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function = false) + FunctionExpression(SourceRange source_range, DeprecatedFlyString const& name, DeprecatedString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function = false) : Expression(source_range) , FunctionNode(name, move(source_text), move(body), move(parameters), function_length, kind, is_strict_mode, might_need_arguments_object, contains_direct_call_to_eval, is_arrow_function) { @@ -737,7 +737,7 @@ public: bool has_name() const { return !name().is_empty(); } - Value instantiate_ordinary_function_expression(Interpreter&, FlyString given_name) const; + Value instantiate_ordinary_function_expression(Interpreter&, DeprecatedFlyString given_name) const; private: virtual bool is_function_expression() const override { return true; } @@ -845,10 +845,10 @@ public: Statement const& body() const { return *m_body; } virtual Completion execute(Interpreter&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; private: NonnullRefPtr m_test; @@ -868,10 +868,10 @@ public: Statement const& body() const { return *m_body; } virtual Completion execute(Interpreter&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; private: NonnullRefPtr m_test; @@ -916,10 +916,10 @@ public: Statement const& body() const { return *m_body; } virtual Completion execute(Interpreter&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; private: RefPtr m_init; @@ -944,8 +944,8 @@ public: virtual Completion execute(Interpreter&) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; private: @@ -970,8 +970,8 @@ public: virtual Completion execute(Interpreter&) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; private: @@ -991,7 +991,7 @@ public: } virtual Completion execute(Interpreter&) const override; - virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; + virtual Completion loop_evaluation(Interpreter&, Vector const&) const override; virtual void dump(int indent) const override; private: @@ -1236,13 +1236,13 @@ private: class Identifier final : public Expression { public: - explicit Identifier(SourceRange source_range, FlyString string) + explicit Identifier(SourceRange source_range, DeprecatedFlyString string) : Expression(source_range) , m_string(move(string)) { } - FlyString const& string() const { return m_string; } + DeprecatedFlyString const& string() const { return m_string; } virtual Completion execute(Interpreter&) const override; virtual void dump(int indent) const override; @@ -1252,19 +1252,19 @@ public: private: virtual bool is_identifier() const override { return true; } - FlyString m_string; + DeprecatedFlyString m_string; mutable EnvironmentCoordinate m_cached_environment_coordinate; }; class PrivateIdentifier final : public Expression { public: - explicit PrivateIdentifier(SourceRange source_range, FlyString string) + explicit PrivateIdentifier(SourceRange source_range, DeprecatedFlyString string) : Expression(source_range) , m_string(move(string)) { } - FlyString const& string() const { return m_string; } + DeprecatedFlyString const& string() const { return m_string; } virtual Completion execute(Interpreter&) const override; virtual void dump(int indent) const override; @@ -1272,7 +1272,7 @@ public: virtual bool is_private_identifier() const override { return true; } private: - FlyString m_string; + DeprecatedFlyString m_string; }; class ClassElement : public ASTNode { @@ -1298,7 +1298,7 @@ public: using ClassValue = Variant; virtual ThrowCompletionOr class_element_evaluation(Interpreter&, Object& home_object) const = 0; - virtual Optional private_bound_identifier() const { return {}; }; + virtual Optional private_bound_identifier() const { return {}; }; private: bool m_is_static { false }; @@ -1326,7 +1326,7 @@ public: virtual void dump(int indent) const override; virtual ThrowCompletionOr class_element_evaluation(Interpreter&, Object& home_object) const override; - virtual Optional private_bound_identifier() const override; + virtual Optional private_bound_identifier() const override; private: virtual bool is_class_method() const override { return true; } @@ -1353,7 +1353,7 @@ public: virtual void dump(int indent) const override; virtual ThrowCompletionOr class_element_evaluation(Interpreter&, Object& home_object) const override; - virtual Optional private_bound_identifier() const override; + virtual Optional private_bound_identifier() const override; private: NonnullRefPtr m_key; @@ -1415,7 +1415,7 @@ public: bool has_name() const { return !m_name.is_empty(); } - ThrowCompletionOr class_definition_evaluation(Interpreter&, FlyString const& binding_name = {}, FlyString const& class_name = {}) const; + ThrowCompletionOr class_definition_evaluation(Interpreter&, DeprecatedFlyString const& binding_name = {}, DeprecatedFlyString const& class_name = {}) const; private: virtual bool is_class_expression() const override { return true; } @@ -1439,7 +1439,7 @@ public: virtual void dump(int indent) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; + virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; virtual bool is_lexical_declaration() const override { return true; } @@ -1706,7 +1706,7 @@ public: NonnullRefPtrVector const& declarations() const { return m_declarations; } - virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; + virtual ThrowCompletionOr for_each_bound_name(ThrowCompletionOrVoidCallback&& callback) const override; virtual bool is_constant_declaration() const override { return m_declaration_kind == DeclarationKind::Const; }; @@ -1985,7 +1985,7 @@ private: class CatchClause final : public ASTNode { public: - CatchClause(SourceRange source_range, FlyString parameter, NonnullRefPtr body) + CatchClause(SourceRange source_range, DeprecatedFlyString parameter, NonnullRefPtr body) : ASTNode(source_range) , m_parameter(move(parameter)) , m_body(move(body)) @@ -2006,7 +2006,7 @@ public: virtual Completion execute(Interpreter&) const override; private: - Variant> m_parameter; + Variant> m_parameter; NonnullRefPtr m_body; }; @@ -2080,7 +2080,7 @@ public: virtual void dump(int indent) const override; virtual Completion execute(Interpreter&) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; + virtual Bytecode::CodeGenerationErrorOr generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const; Completion execute_impl(Interpreter&) const; void add_case(NonnullRefPtr switch_case) { m_cases.append(move(switch_case)); } @@ -2092,7 +2092,7 @@ private: class BreakStatement final : public Statement { public: - BreakStatement(SourceRange source_range, FlyString target_label) + BreakStatement(SourceRange source_range, DeprecatedFlyString target_label) : Statement(source_range) , m_target_label(move(target_label)) { @@ -2100,16 +2100,16 @@ public: virtual Completion execute(Interpreter&) const override; - FlyString const& target_label() const { return m_target_label; } + DeprecatedFlyString const& target_label() const { return m_target_label; } virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; private: - FlyString m_target_label; + DeprecatedFlyString m_target_label; }; class ContinueStatement final : public Statement { public: - ContinueStatement(SourceRange source_range, FlyString target_label) + ContinueStatement(SourceRange source_range, DeprecatedFlyString target_label) : Statement(source_range) , m_target_label(move(target_label)) { @@ -2118,10 +2118,10 @@ public: virtual Completion execute(Interpreter&) const override; virtual Bytecode::CodeGenerationErrorOr generate_bytecode(Bytecode::Generator&) const override; - FlyString const& target_label() const { return m_target_label; } + DeprecatedFlyString const& target_label() const { return m_target_label; } private: - FlyString m_target_label; + DeprecatedFlyString m_target_label; }; class DebuggerStatement final : public Statement { diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 18596af3ea0..e338a2031e8 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -109,7 +109,7 @@ Bytecode::CodeGenerationErrorOr ScopeNode::generate_bytecode(Bytecode::Gen Vector functions_to_initialize; // 7. Let declaredFunctionNames be a new empty List. - HashTable declared_function_names; + HashTable declared_function_names; // 8. For each element d of varDeclarations, in reverse List order, do (void)for_each_var_function_declaration_in_reverse_order([&](FunctionDeclaration const& function) -> ThrowCompletionOr { @@ -135,7 +135,7 @@ Bytecode::CodeGenerationErrorOr ScopeNode::generate_bytecode(Bytecode::Gen }); // 9. Let declaredVarNames be a new empty List. - HashTable declared_var_names; + HashTable declared_var_names; // 10. For each element d of varDeclarations, do (void)for_each_var_scoped_variable_declaration([&](Declaration const& declaration) { @@ -803,7 +803,7 @@ Bytecode::CodeGenerationErrorOr LabelledStatement::generate_bytecode(Bytec // 14.13.4 Runtime Semantics: LabelledEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-labelledevaluation // LabelledStatement : LabelIdentifier : LabelledItem -Bytecode::CodeGenerationErrorOr LabelledStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr LabelledStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { // Convert the m_labelled_item NNRP to a reference early so we don't have to do it every single time we want to use it. auto const& labelled_item = *m_labelled_item; @@ -853,7 +853,7 @@ Bytecode::CodeGenerationErrorOr LabelledStatement::generate_labelled_evalu return {}; } -Bytecode::CodeGenerationErrorOr IterationStatement::generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const +Bytecode::CodeGenerationErrorOr IterationStatement::generate_labelled_evaluation(Bytecode::Generator&, Vector const&) const { return Bytecode::CodeGenerationError { this, @@ -866,7 +866,7 @@ Bytecode::CodeGenerationErrorOr WhileStatement::generate_bytecode(Bytecode return generate_labelled_evaluation(generator, {}); } -Bytecode::CodeGenerationErrorOr WhileStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr WhileStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { // test // jump if_false (true) end (false) body @@ -916,7 +916,7 @@ Bytecode::CodeGenerationErrorOr DoWhileStatement::generate_bytecode(Byteco return generate_labelled_evaluation(generator, {}); } -Bytecode::CodeGenerationErrorOr DoWhileStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr DoWhileStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { // jump always (true) body // test @@ -967,7 +967,7 @@ Bytecode::CodeGenerationErrorOr ForStatement::generate_bytecode(Bytecode:: return generate_labelled_evaluation(generator, {}); } -Bytecode::CodeGenerationErrorOr ForStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr ForStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { // init // jump always (true) test @@ -2215,7 +2215,7 @@ Bytecode::CodeGenerationErrorOr TryStatement::generate_bytecode(Bytecode:: generator.begin_variable_scope(Bytecode::Generator::BindingMode::Lexical, Bytecode::Generator::SurroundingScopeKind::Block); TRY(m_handler->parameter().visit( - [&](FlyString const& parameter) -> Bytecode::CodeGenerationErrorOr { + [&](DeprecatedFlyString const& parameter) -> Bytecode::CodeGenerationErrorOr { if (!parameter.is_empty()) { auto parameter_identifier = generator.intern_identifier(parameter); generator.register_binding(parameter_identifier); @@ -2283,7 +2283,7 @@ Bytecode::CodeGenerationErrorOr SwitchStatement::generate_bytecode(Bytecod return generate_labelled_evaluation(generator, {}); } -Bytecode::CodeGenerationErrorOr SwitchStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr SwitchStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { auto discriminant_reg = generator.allocate_register(); TRY(m_discriminant->generate_bytecode(generator)); @@ -2516,7 +2516,7 @@ static Bytecode::CodeGenerationErrorOr for_in_of_he } // 14.7.5.7 ForIn/OfBodyEvaluation ( lhs, stmt, iteratorRecord, iterationKind, lhsKind, labelSet [ , iteratorKind ] ), https://tc39.es/ecma262/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset -static Bytecode::CodeGenerationErrorOr for_in_of_body_evaluation(Bytecode::Generator& generator, ASTNode const& node, Variant, NonnullRefPtr> const& lhs, ASTNode const& body, ForInOfHeadEvaluationResult const& head_result, Vector const& label_set, Bytecode::BasicBlock& loop_end, Bytecode::BasicBlock& loop_update) +static Bytecode::CodeGenerationErrorOr for_in_of_body_evaluation(Bytecode::Generator& generator, ASTNode const& node, Variant, NonnullRefPtr> const& lhs, ASTNode const& body, ForInOfHeadEvaluationResult const& head_result, Vector const& label_set, Bytecode::BasicBlock& loop_end, Bytecode::BasicBlock& loop_update) { auto iterator_register = generator.allocate_register(); generator.emit(iterator_register); @@ -2719,7 +2719,7 @@ Bytecode::CodeGenerationErrorOr ForInStatement::generate_bytecode(Bytecode } // 14.7.5.5 Runtime Semantics: ForInOfLoopEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation -Bytecode::CodeGenerationErrorOr ForInStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr ForInStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { auto& loop_end = generator.make_block(); auto& loop_update = generator.make_block(); @@ -2736,7 +2736,7 @@ Bytecode::CodeGenerationErrorOr ForOfStatement::generate_bytecode(Bytecode return generate_labelled_evaluation(generator, {}); } -Bytecode::CodeGenerationErrorOr ForOfStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const +Bytecode::CodeGenerationErrorOr ForOfStatement::generate_labelled_evaluation(Bytecode::Generator& generator, Vector const& label_set) const { auto& loop_end = generator.make_block(); auto& loop_update = generator.make_block(); diff --git a/Userland/Libraries/LibJS/Bytecode/Executable.h b/Userland/Libraries/LibJS/Bytecode/Executable.h index 8d454047b18..f69ed9bd210 100644 --- a/Userland/Libraries/LibJS/Bytecode/Executable.h +++ b/Userland/Libraries/LibJS/Bytecode/Executable.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -15,7 +15,7 @@ namespace JS::Bytecode { struct Executable { - FlyString name; + DeprecatedFlyString name; NonnullOwnPtrVector basic_blocks; NonnullOwnPtr string_table; NonnullOwnPtr identifier_table; @@ -23,7 +23,7 @@ struct Executable { bool is_strict_mode { false }; DeprecatedString const& get_string(StringTableIndex index) const { return string_table->get(index); } - FlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); } + DeprecatedFlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); } void dump() const; }; diff --git a/Userland/Libraries/LibJS/Bytecode/Generator.cpp b/Userland/Libraries/LibJS/Bytecode/Generator.cpp index 555c6751495..8205f1e895d 100644 --- a/Userland/Libraries/LibJS/Bytecode/Generator.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Generator.cpp @@ -113,7 +113,7 @@ void Generator::end_variable_scope() } } -void Generator::begin_continuable_scope(Label continue_target, Vector const& language_label_set) +void Generator::begin_continuable_scope(Label continue_target, Vector const& language_label_set) { m_continuable_scopes.append({ continue_target, language_label_set }); start_boundary(BlockBoundaryType::Continue); @@ -130,7 +130,7 @@ Label Generator::nearest_breakable_scope() const return m_breakable_scopes.last().bytecode_target; } -void Generator::begin_breakable_scope(Label breakable_target, Vector const& language_label_set) +void Generator::begin_breakable_scope(Label breakable_target, Vector const& language_label_set) { m_breakable_scopes.append({ breakable_target, language_label_set }); start_boundary(BlockBoundaryType::Break); @@ -262,7 +262,7 @@ CodeGenerationErrorOr Generator::emit_delete_reference(JS::ASTNode const& return {}; } -Label Generator::perform_needed_unwinds_for_labelled_break_and_return_target_block(FlyString const& break_label) +Label Generator::perform_needed_unwinds_for_labelled_break_and_return_target_block(DeprecatedFlyString const& break_label) { size_t current_boundary = m_boundaries.size(); for (auto& breakable_scope : m_breakable_scopes.in_reverse()) { @@ -294,7 +294,7 @@ Label Generator::perform_needed_unwinds_for_labelled_break_and_return_target_blo VERIFY_NOT_REACHED(); } -Label Generator::perform_needed_unwinds_for_labelled_continue_and_return_target_block(FlyString const& continue_label) +Label Generator::perform_needed_unwinds_for_labelled_continue_and_return_target_block(DeprecatedFlyString const& continue_label) { size_t current_boundary = m_boundaries.size(); for (auto& continuable_scope : m_continuable_scopes.in_reverse()) { diff --git a/Userland/Libraries/LibJS/Bytecode/Generator.h b/Userland/Libraries/LibJS/Bytecode/Generator.h index a326b473abf..3f966bcb8d8 100644 --- a/Userland/Libraries/LibJS/Bytecode/Generator.h +++ b/Userland/Libraries/LibJS/Bytecode/Generator.h @@ -84,9 +84,9 @@ public: CodeGenerationErrorOr emit_store_to_reference(JS::ASTNode const&); CodeGenerationErrorOr emit_delete_reference(JS::ASTNode const&); - void begin_continuable_scope(Label continue_target, Vector const& language_label_set); + void begin_continuable_scope(Label continue_target, Vector const& language_label_set); void end_continuable_scope(); - void begin_breakable_scope(Label breakable_target, Vector const& language_label_set); + void begin_breakable_scope(Label breakable_target, Vector const& language_label_set); void end_breakable_scope(); [[nodiscard]] Label nearest_continuable_scope() const; @@ -117,7 +117,7 @@ public: return m_string_table->insert(move(string)); } - IdentifierTableIndex intern_identifier(FlyString string) + IdentifierTableIndex intern_identifier(DeprecatedFlyString string) { return m_identifier_table->insert(move(string)); } @@ -213,8 +213,8 @@ public: } } - Label perform_needed_unwinds_for_labelled_break_and_return_target_block(FlyString const& break_label); - Label perform_needed_unwinds_for_labelled_continue_and_return_target_block(FlyString const& continue_label); + Label perform_needed_unwinds_for_labelled_break_and_return_target_block(DeprecatedFlyString const& break_label); + Label perform_needed_unwinds_for_labelled_continue_and_return_target_block(DeprecatedFlyString const& continue_label); void start_boundary(BlockBoundaryType type) { m_boundaries.append(type); } void end_boundary(BlockBoundaryType type) @@ -232,7 +232,7 @@ private: struct LabelableScope { Label bytecode_target; - Vector language_label_set; + Vector language_label_set; }; BasicBlock* m_current_basic_block { nullptr }; diff --git a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.cpp b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.cpp index 72998174381..95fed273a2c 100644 --- a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.cpp +++ b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.cpp @@ -8,7 +8,7 @@ namespace JS::Bytecode { -IdentifierTableIndex IdentifierTable::insert(FlyString string) +IdentifierTableIndex IdentifierTable::insert(DeprecatedFlyString string) { for (size_t i = 0; i < m_identifiers.size(); i++) { if (m_identifiers[i] == string) @@ -18,7 +18,7 @@ IdentifierTableIndex IdentifierTable::insert(FlyString string) return m_identifiers.size() - 1; } -FlyString const& IdentifierTable::get(IdentifierTableIndex index) const +DeprecatedFlyString const& IdentifierTable::get(IdentifierTableIndex index) const { return m_identifiers[index.value()]; } diff --git a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h index ca9dfe49878..b22a8538798 100644 --- a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h +++ b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include namespace JS::Bytecode { @@ -21,13 +21,13 @@ class IdentifierTable { public: IdentifierTable() = default; - IdentifierTableIndex insert(FlyString); - FlyString const& get(IdentifierTableIndex) const; + IdentifierTableIndex insert(DeprecatedFlyString); + DeprecatedFlyString const& get(IdentifierTableIndex) const; void dump() const; bool is_empty() const { return m_identifiers.is_empty(); } private: - Vector m_identifiers; + Vector m_identifiers; }; } diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp index 40c9ef80225..abda1f3be21 100644 --- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -51,7 +51,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e if (vm().execution_context_stack().is_empty() || !vm().running_execution_context().lexical_environment) { // The "normal" interpreter pushes an execution context without environment so in that case we also want to push one. execution_context.this_value = &m_realm.global_object(); - static FlyString global_execution_context_name = "(*BC* global execution context)"; + static DeprecatedFlyString global_execution_context_name = "(*BC* global execution context)"; execution_context.function_name = global_execution_context_name; execution_context.lexical_environment = &m_realm.global_environment(); execution_context.variable_environment = &m_realm.global_environment(); diff --git a/Userland/Libraries/LibJS/Interpreter.h b/Userland/Libraries/LibJS/Interpreter.h index d84e93ff3be..ab441e4644a 100644 --- a/Userland/Libraries/LibJS/Interpreter.h +++ b/Userland/Libraries/LibJS/Interpreter.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include #include @@ -54,7 +54,7 @@ public: nullptr)); // NOTE: These are not in the spec. - static FlyString global_execution_context_name = "(global execution context)"; + static DeprecatedFlyString global_execution_context_name = "(global execution context)"; interpreter->m_global_execution_context->function_name = global_execution_context_name; interpreter->m_realm = make_handle(realm); diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp index 3526a779c5a..ee3deb2517d 100644 --- a/Userland/Libraries/LibJS/Lexer.cpp +++ b/Userland/Libraries/LibJS/Lexer.cpp @@ -16,7 +16,7 @@ namespace JS { -HashMap Lexer::s_keywords; +HashMap Lexer::s_keywords; HashMap Lexer::s_three_char_tokens; HashMap Lexer::s_two_char_tokens; HashMap Lexer::s_single_char_tokens; @@ -574,7 +574,7 @@ Token Lexer::next() // bunch of Invalid* tokens (bad numeric literals, unterminated comments etc.) DeprecatedString token_message; - Optional identifier; + Optional identifier; size_t identifier_length = 0; if (m_current_token.type() == TokenType::RegexLiteral && !is_eof() && is_ascii_alpha(m_current_char) && !did_consume_whitespace_or_comments) { diff --git a/Userland/Libraries/LibJS/Lexer.h b/Userland/Libraries/LibJS/Lexer.h index 02f010f41cf..889c78a5ffd 100644 --- a/Userland/Libraries/LibJS/Lexer.h +++ b/Userland/Libraries/LibJS/Lexer.h @@ -79,7 +79,7 @@ private: Optional m_hit_invalid_unicode; - static HashMap s_keywords; + static HashMap s_keywords; static HashMap s_three_char_tokens; static HashMap s_two_char_tokens; static HashMap s_single_char_tokens; @@ -87,7 +87,7 @@ private: struct ParsedIdentifiers : public RefCounted { // Resolved identifiers must be kept alive for the duration of the parsing stage, otherwise // the only references to these strings are deleted by the Token destructor. - HashTable identifiers; + HashTable identifiers; }; RefPtr m_parsed_identifiers; diff --git a/Userland/Libraries/LibJS/Module.cpp b/Userland/Libraries/LibJS/Module.cpp index bba073a044c..38ad302488f 100644 --- a/Userland/Libraries/LibJS/Module.cpp +++ b/Userland/Libraries/LibJS/Module.cpp @@ -77,7 +77,7 @@ ThrowCompletionOr Module::get_module_namespace(VM& vm) auto exported_names = TRY(get_exported_names(vm)); // b. Let unambiguousNames be a new empty List. - Vector unambiguous_names; + Vector unambiguous_names; // c. For each element name of exportedNames, do for (auto& name : exported_names) { @@ -100,7 +100,7 @@ ThrowCompletionOr Module::get_module_namespace(VM& vm) } // 10.4.6.12 ModuleNamespaceCreate ( module, exports ), https://tc39.es/ecma262/#sec-modulenamespacecreate -Object* Module::module_namespace_create(VM& vm, Vector unambiguous_names) +Object* Module::module_namespace_create(VM& vm, Vector unambiguous_names) { auto& realm = this->realm(); diff --git a/Userland/Libraries/LibJS/Module.h b/Userland/Libraries/LibJS/Module.h index 12345118304..21ac8363663 100644 --- a/Userland/Libraries/LibJS/Module.h +++ b/Userland/Libraries/LibJS/Module.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -37,7 +37,7 @@ struct ResolvedBinding { Type type { Null }; Module* module { nullptr }; - FlyString export_name; + DeprecatedFlyString export_name; bool is_valid() const { @@ -76,8 +76,8 @@ public: virtual ThrowCompletionOr link(VM& vm) = 0; virtual ThrowCompletionOr evaluate(VM& vm) = 0; - virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set = {}) = 0; - virtual ThrowCompletionOr resolve_export(VM& vm, FlyString const& export_name, Vector resolve_set = {}) = 0; + virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set = {}) = 0; + virtual ThrowCompletionOr resolve_export(VM& vm, DeprecatedFlyString const& export_name, Vector resolve_set = {}) = 0; virtual ThrowCompletionOr inner_module_linking(VM& vm, Vector& stack, u32 index); virtual ThrowCompletionOr inner_module_evaluation(VM& vm, Vector& stack, u32 index); @@ -93,7 +93,7 @@ protected: } private: - Object* module_namespace_create(VM& vm, Vector unambiguous_names); + Object* module_namespace_create(VM& vm, Vector unambiguous_names); // These handles are only safe as long as the VM they live in is valid. // But evaluated modules SHOULD be stored in the VM so unless you intentionally diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index d5d311afe28..e8e5f8bf259 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -65,7 +65,7 @@ public: scope_pusher.m_function_parameters = parameters; for (auto& parameter : parameters) { parameter.binding.visit( - [&](FlyString const& name) { + [&](DeprecatedFlyString const& name) { scope_pusher.m_forbidden_lexical_names.set(name); }, [&](NonnullRefPtr const& binding_pattern) { @@ -102,7 +102,7 @@ public: return scope_pusher; } - static ScopePusher catch_scope(Parser& parser, RefPtr const& pattern, FlyString const& parameter) + static ScopePusher catch_scope(Parser& parser, RefPtr const& pattern, DeprecatedFlyString const& parameter) { ScopePusher scope_pusher(parser, nullptr, ScopeLevel::NotTopLevel); if (pattern) { @@ -208,7 +208,7 @@ public: ScopePusher* parent_scope() { return m_parent_scope; } ScopePusher const* parent_scope() const { return m_parent_scope; } - [[nodiscard]] bool has_declaration(FlyString const& name) const + [[nodiscard]] bool has_declaration(DeprecatedFlyString const& name) const { return m_lexical_names.contains(name) || m_var_names.contains(name) || !m_functions_to_hoist.find_if([&name](auto& function) { return function->name() == name; }).is_end(); } @@ -254,7 +254,7 @@ public: } private: - void throw_identifier_declared(FlyString const& name, NonnullRefPtr const& declaration) + void throw_identifier_declared(DeprecatedFlyString const& name, NonnullRefPtr const& declaration) { m_parser.syntax_error(DeprecatedString::formatted("Identifier '{}' already declared", name), declaration->source_range().start); } @@ -266,12 +266,12 @@ private: ScopePusher* m_parent_scope { nullptr }; ScopePusher* m_top_level_scope { nullptr }; - HashTable m_lexical_names; - HashTable m_var_names; - HashTable m_function_names; + HashTable m_lexical_names; + HashTable m_var_names; + HashTable m_function_names; - HashTable m_forbidden_lexical_names; - HashTable m_forbidden_var_names; + HashTable m_forbidden_lexical_names; + HashTable m_forbidden_var_names; NonnullRefPtrVector m_functions_to_hoist; Optional> m_function_parameters; @@ -707,7 +707,7 @@ static bool is_strict_reserved_word(StringView str) static bool is_simple_parameter_list(Vector const& parameters) { return all_of(parameters, [](FunctionParameter const& parameter) { - return !parameter.is_rest && parameter.default_value.is_null() && parameter.binding.has(); + return !parameter.is_rest && parameter.default_value.is_null() && parameter.binding.has(); }); } @@ -782,7 +782,7 @@ RefPtr Parser::try_parse_arrow_function_expression(bool expe syntax_error("BindingIdentifier may not be 'arguments' or 'eval' in strict mode"); if (is_async && token.value() == "await"sv) syntax_error("'await' is a reserved identifier in async functions"); - parameters.append({ FlyString { token.value() }, {} }); + parameters.append({ DeprecatedFlyString { token.value() }, {} }); } // If there's a newline between the closing paren and arrow it's not a valid arrow function, // ASI should kick in instead (it'll then fail with "Unexpected token Arrow") @@ -844,7 +844,7 @@ RefPtr Parser::try_parse_arrow_function_expression(bool expe if (body->in_strict_mode()) { for (auto& parameter : parameters) { parameter.binding.visit( - [&](FlyString const& name) { + [&](DeprecatedFlyString const& name) { check_identifier_name_for_assignment_validity(name, true); }, [&](auto const&) {}); @@ -1046,10 +1046,10 @@ NonnullRefPtr Parser::parse_class_expression(bool expect_class_ NonnullRefPtrVector elements; RefPtr super_class; RefPtr constructor; - HashTable found_private_names; + HashTable found_private_names; - FlyString class_name = expect_class_name || match_identifier() || match(TokenType::Yield) || match(TokenType::Await) - ? consume_identifier_reference().flystring_value() + DeprecatedFlyString class_name = expect_class_name || match_identifier() || match(TokenType::Yield) || match(TokenType::Await) + ? consume_identifier_reference().DeprecatedFlyString_value() : ""; check_identifier_name_for_assignment_validity(class_name, true); @@ -1331,7 +1331,7 @@ NonnullRefPtr Parser::parse_class_expression(bool expect_class_ // this function does not. // So we use a custom version of SuperCall which doesn't use the @@iterator // method on %Array.prototype% visibly. - FlyString argument_name = "args"; + DeprecatedFlyString argument_name = "args"; auto super_call = create_ast_node( { m_source_code, rule_start.position(), position() }, SuperCall::IsPartOfSyntheticConstructor::Yes, @@ -1728,7 +1728,7 @@ NonnullRefPtr Parser::parse_object_expression() property_key = parse_property_key(); } else { property_key = create_ast_node({ m_source_code, rule_start.position(), position() }, identifier.value()); - property_value = create_ast_node({ m_source_code, rule_start.position(), position() }, identifier.flystring_value()); + property_value = create_ast_node({ m_source_code, rule_start.position(), position() }, identifier.DeprecatedFlyString_value()); } } else { property_key = parse_property_key(); @@ -2145,7 +2145,7 @@ Parser::ExpressionResult Parser::parse_secondary_expression(NonnullRefPtr({ m_source_code, rule_start.position(), position() }, move(lhs), create_ast_node({ m_source_code, rule_start.position(), position() }, consume().flystring_value())); + return create_ast_node({ m_source_code, rule_start.position(), position() }, move(lhs), create_ast_node({ m_source_code, rule_start.position(), position() }, consume().DeprecatedFlyString_value())); case TokenType::BracketOpen: { consume(TokenType::BracketOpen); auto expression = create_ast_node({ m_source_code, rule_start.position(), position() }, move(lhs), parse_expression(0), true); @@ -2322,7 +2322,7 @@ NonnullRefPtr Parser::parse_identifier() syntax_error("'arguments' is not allowed in class field initializer"); return create_ast_node( { m_source_code, identifier_start, position() }, - token.flystring_value()); + token.DeprecatedFlyString_value()); } Vector Parser::parse_arguments() @@ -2501,7 +2501,7 @@ NonnullRefPtr Parser::parse_function_body(Vector parameter_names; for (auto& parameter : parameters) { parameter.binding.visit( - [&](FlyString const& parameter_name) { + [&](DeprecatedFlyString const& parameter_name) { check_identifier_name_for_assignment_validity(parameter_name, function_body->in_strict_mode()); if (function_kind == FunctionKind::Generator && parameter_name == "yield"sv) syntax_error("Parameter name 'yield' not allowed in this context"); @@ -2579,7 +2579,7 @@ NonnullRefPtr Parser::parse_function_node(u16 parse_options, O function_kind = FunctionKind::Async; else function_kind = FunctionKind::Normal; - FlyString name; + DeprecatedFlyString name; if (parse_options & FunctionNodeParseOptions::CheckForFunctionAndName) { if (function_kind == FunctionKind::Normal && match(TokenType::Async) && !next_token().trivia_contains_line_terminator()) { function_kind = FunctionKind::Async; @@ -2596,9 +2596,9 @@ NonnullRefPtr Parser::parse_function_node(u16 parse_options, O if (parse_options & FunctionNodeParseOptions::HasDefaultExportName) name = ExportStatement::local_name_for_default; else if (FunctionNodeType::must_have_name() || match_identifier()) - name = consume_identifier().flystring_value(); + name = consume_identifier().DeprecatedFlyString_value(); else if (is_function_expression && (match(TokenType::Yield) || match(TokenType::Await))) - name = consume().flystring_value(); + name = consume().DeprecatedFlyString_value(); check_identifier_name_for_assignment_validity(name); @@ -2656,18 +2656,18 @@ Vector Parser::parse_formal_parameters(int& function_length, Vector parameters; - auto consume_identifier_or_binding_pattern = [&]() -> Variant> { + auto consume_identifier_or_binding_pattern = [&]() -> Variant> { if (auto pattern = parse_binding_pattern(AllowDuplicates::No, AllowMemberExpressions::No)) return pattern.release_nonnull(); auto token = consume_identifier(); - auto parameter_name = token.flystring_value(); + auto parameter_name = token.DeprecatedFlyString_value(); check_identifier_name_for_assignment_validity(parameter_name); for (auto& parameter : parameters) { bool has_same_name = parameter.binding.visit( - [&](FlyString const& name) { + [&](DeprecatedFlyString const& name) { return name == parameter_name; }, [&](NonnullRefPtr const& bindings) { @@ -2695,7 +2695,7 @@ Vector Parser::parse_formal_parameters(int& function_length, syntax_error(message, Position { token.line_number(), token.line_column() }); break; } - return FlyString { token.value() }; + return DeprecatedFlyString { token.value() }; }; while (match(TokenType::CurlyOpen) || match(TokenType::BracketOpen) || match_identifier() || match(TokenType::TripleDot)) { @@ -2743,7 +2743,7 @@ Vector Parser::parse_formal_parameters(int& function_length, return parameters; } -static AK::Array s_reserved_words = { "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "null", "return", "super", "switch", "this", "throw", "true", "try", "typeof", "var", "void", "while", "with" }; +static AK::Array s_reserved_words = { "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "null", "return", "super", "switch", "this", "throw", "true", "try", "typeof", "var", "void", "while", "with" }; RefPtr Parser::parse_binding_pattern(Parser::AllowDuplicates allow_duplicates, Parser::AllowMemberExpressions allow_member_expressions) { @@ -2806,15 +2806,15 @@ RefPtr Parser::parse_binding_pattern(Parser::AllowDuplicates all { m_source_code, rule_start.position(), position() }, string_literal->value()); } else if (match(TokenType::BigIntLiteral)) { - auto string_value = consume().flystring_value(); + auto string_value = consume().DeprecatedFlyString_value(); VERIFY(string_value.ends_with("n"sv)); name = create_ast_node( { m_source_code, rule_start.position(), position() }, - FlyString(string_value.view().substring_view(0, string_value.length() - 1))); + DeprecatedFlyString(string_value.view().substring_view(0, string_value.length() - 1))); } else { name = create_ast_node( { m_source_code, rule_start.position(), position() }, - consume().flystring_value()); + consume().DeprecatedFlyString_value()); } } else if (match(TokenType::BracketOpen)) { consume(); @@ -2852,7 +2852,7 @@ RefPtr Parser::parse_binding_pattern(Parser::AllowDuplicates all } else if (match_identifier_name()) { alias = create_ast_node( { m_source_code, rule_start.position(), position() }, - consume().flystring_value()); + consume().DeprecatedFlyString_value()); } else { expected("identifier or binding pattern"); @@ -2888,7 +2888,7 @@ RefPtr Parser::parse_binding_pattern(Parser::AllowDuplicates all alias = pattern.release_nonnull(); } else if (match_identifier_name()) { // BindingElement must always have an Empty name field - auto identifier_name = consume_identifier().flystring_value(); + auto identifier_name = consume_identifier().DeprecatedFlyString_value(); alias = create_ast_node( { m_source_code, rule_start.position(), position() }, identifier_name); @@ -2974,7 +2974,7 @@ NonnullRefPtr Parser::parse_variable_declaration(bool for_l Variant, NonnullRefPtr, Empty> target {}; if (match_identifier()) { auto identifier_start = push_start(); - auto name = consume_identifier().flystring_value(); + auto name = consume_identifier().DeprecatedFlyString_value(); target = create_ast_node( { m_source_code, rule_start.position(), position() }, name); @@ -2996,14 +2996,14 @@ NonnullRefPtr Parser::parse_variable_declaration(bool for_l target = create_ast_node( { m_source_code, rule_start.position(), position() }, - consume().flystring_value()); + consume().DeprecatedFlyString_value()); } else if (!m_state.await_expression_is_valid && match(TokenType::Async)) { if (m_program_type == Program::Type::Module) syntax_error("Identifier must not be a reserved word in modules ('async')"); target = create_ast_node( { m_source_code, rule_start.position(), position() }, - consume().flystring_value()); + consume().DeprecatedFlyString_value()); } if (target.has()) { @@ -3070,7 +3070,7 @@ NonnullRefPtr Parser::parse_break_statement() { auto rule_start = push_start(); consume(TokenType::Break); - FlyString target_label; + DeprecatedFlyString target_label; if (match(TokenType::Semicolon)) { consume(); } else { @@ -3097,7 +3097,7 @@ NonnullRefPtr Parser::parse_continue_statement() syntax_error("'continue' not allow outside of a loop"); consume(TokenType::Continue); - FlyString target_label; + DeprecatedFlyString target_label; if (match(TokenType::Semicolon)) { consume(); return create_ast_node({ m_source_code, rule_start.position(), position() }, target_label); @@ -3166,7 +3166,7 @@ NonnullRefPtr Parser::parse_optional_chain(NonnullRefPtr({ m_source_code, start, position() }, identifier.flystring_value()), + create_ast_node({ m_source_code, start, position() }, identifier.DeprecatedFlyString_value()), OptionalChain::Mode::Optional, }); } else { @@ -3192,7 +3192,7 @@ NonnullRefPtr Parser::parse_optional_chain(NonnullRefPtr({ m_source_code, start, position() }, identifier.flystring_value()), + create_ast_node({ m_source_code, start, position() }, identifier.DeprecatedFlyString_value()), OptionalChain::Mode::NotOptional, }); } else { @@ -3356,7 +3356,7 @@ NonnullRefPtr Parser::parse_catch_clause() auto rule_start = push_start(); consume(TokenType::Catch); - FlyString parameter; + DeprecatedFlyString parameter; RefPtr pattern_parameter; auto should_expect_parameter = false; if (match(TokenType::ParenOpen)) { @@ -3375,7 +3375,7 @@ NonnullRefPtr Parser::parse_catch_clause() if (should_expect_parameter && parameter.is_empty() && !pattern_parameter) expected("an identifier or a binding pattern"); - HashTable bound_names; + HashTable bound_names; if (pattern_parameter) { pattern_parameter->for_each_bound_name( @@ -3504,7 +3504,7 @@ NonnullRefPtr Parser::parse_for_statement() m_state.current_scope_pusher->add_declaration(declaration); } else { // This does not follow the normal declaration structure so we need additional checks. - HashTable bound_names; + HashTable bound_names; declaration->for_each_bound_name([&](auto const& name) { if (bound_names.set(name) != AK::HashSetResult::InsertedNewEntry) syntax_error(DeprecatedString::formatted("Identifier '{}' already declared in for loop initializer", name), declaration->source_range().start); @@ -4055,7 +4055,7 @@ void Parser::discard_saved_state() m_saved_state.take_last(); } -void Parser::check_identifier_name_for_assignment_validity(FlyString const& name, bool force_strict) +void Parser::check_identifier_name_for_assignment_validity(DeprecatedFlyString const& name, bool force_strict) { // FIXME: this is now called from multiple places maybe the error message should be dynamic? if (any_of(s_reserved_words, [&](auto& value) { return name == value; })) { @@ -4073,11 +4073,11 @@ bool Parser::match_assert_clause() const return !m_state.current_token.trivia_contains_line_terminator() && m_state.current_token.original_value() == "assert"sv; } -FlyString Parser::consume_string_value() +DeprecatedFlyString Parser::consume_string_value() { VERIFY(match(TokenType::StringLiteral)); auto string_token = consume(); - FlyString value = parse_string_literal(string_token)->value(); + DeprecatedFlyString value = parse_string_literal(string_token)->value(); // This also checks IsStringWellFormedUnicode which makes sure there is no unpaired surrogate // Surrogates are at least 3 bytes @@ -4148,7 +4148,7 @@ ModuleRequest Parser::parse_module_request() return request; } -static FlyString default_string_value = "default"; +static DeprecatedFlyString default_string_value = "default"; NonnullRefPtr Parser::parse_import_statement(Program& program) { @@ -4237,13 +4237,13 @@ NonnullRefPtr Parser::parse_import_statement(Program& program) // ImportSpecifier : ImportedBinding auto require_as = !match_imported_binding(); auto name_position = position(); - auto name = consume().flystring_value(); + auto name = consume().DeprecatedFlyString_value(); if (match_as()) { consume(TokenType::Identifier); auto alias_position = position(); - auto alias = consume_identifier().flystring_value(); + auto alias = consume_identifier().DeprecatedFlyString_value(); check_identifier_name_for_assignment_validity(alias); entries_with_location.append({ { name, alias }, alias_position }); @@ -4264,7 +4264,7 @@ NonnullRefPtr Parser::parse_import_statement(Program& program) consume(TokenType::Identifier); auto alias_position = position(); - auto alias = consume_identifier().flystring_value(); + auto alias = consume_identifier().DeprecatedFlyString_value(); check_identifier_name_for_assignment_validity(alias); entries_with_location.append({ { move(name), alias }, alias_position }); @@ -4351,7 +4351,7 @@ NonnullRefPtr Parser::parse_export_statement(Program& program) auto default_position = position(); consume(TokenType::Default); - FlyString local_name; + DeprecatedFlyString local_name; auto lookahead_token = next_token(); @@ -4466,7 +4466,7 @@ NonnullRefPtr Parser::parse_export_statement(Program& program) Required } check_for_from { FromSpecifier::NotAllowed }; - auto parse_module_export_name = [&](bool lhs) -> FlyString { + auto parse_module_export_name = [&](bool lhs) -> DeprecatedFlyString { // https://tc39.es/ecma262/#prod-ModuleExportName // ModuleExportName : // IdentifierName diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index 7fd192f5e68..e0f399b84d5 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -234,7 +234,7 @@ private: Token next_token(size_t steps = 1) const; - void check_identifier_name_for_assignment_validity(FlyString const&, bool force_strict = false); + void check_identifier_name_for_assignment_validity(DeprecatedFlyString const&, bool force_strict = false); bool try_parse_arrow_function_expression_failed_at_position(Position const&) const; void set_try_parse_arrow_function_expression_failed_at_position(Position const&, bool); @@ -244,7 +244,7 @@ private: bool parse_directive(ScopeNode& body); void parse_statement_list(ScopeNode& output_node, AllowLabelledFunction allow_labelled_functions = AllowLabelledFunction::No); - FlyString consume_string_value(); + DeprecatedFlyString consume_string_value(); ModuleRequest parse_module_request(); struct RulePosition { @@ -320,7 +320,7 @@ private: NonnullRefPtr m_source_code; Vector m_rule_starts; ParserState m_state; - FlyString m_filename; + DeprecatedFlyString m_filename; Vector m_saved_state; HashMap m_token_memoizations; Program::Type m_program_type; diff --git a/Userland/Libraries/LibJS/Print.cpp b/Userland/Libraries/LibJS/Print.cpp index 0452a201e21..dd1b2bb6f0f 100644 --- a/Userland/Libraries/LibJS/Print.cpp +++ b/Userland/Libraries/LibJS/Print.cpp @@ -102,7 +102,7 @@ ErrorOr js_out(JS::PrintContext& print_context, CheckedFormatString print_type(JS::PrintContext& print_context, FlyString const& name) +ErrorOr print_type(JS::PrintContext& print_context, DeprecatedFlyString const& name) { return js_out(print_context, "[\033[36;1m{}\033[0m]", name); } diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index d1ea5e18b52..9a539019caf 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -201,7 +201,7 @@ ThrowCompletionOr get_function_realm(VM& vm, FunctionObject const& funct } // 8.5.2.1 InitializeBoundName ( name, value, environment ), https://tc39.es/ecma262/#sec-initializeboundname -ThrowCompletionOr initialize_bound_name(VM& vm, FlyString const& name, Value value, Environment* environment) +ThrowCompletionOr initialize_bound_name(VM& vm, DeprecatedFlyString const& name, Value value, Environment* environment) { // 1. If environment is not undefined, then if (environment) { @@ -794,7 +794,7 @@ ThrowCompletionOr eval_declaration_instantiation(VM& vm, Program const& pr Vector functions_to_initialize; // 9. Let declaredFunctionNames be a new empty List. - HashTable declared_function_names; + HashTable declared_function_names; // 10. For each element d of varDeclarations, in reverse List order, do TRY(program.for_each_var_function_declaration_in_reverse_order([&](FunctionDeclaration const& function) -> ThrowCompletionOr { @@ -835,7 +835,7 @@ ThrowCompletionOr eval_declaration_instantiation(VM& vm, Program const& pr if (!strict) { // a. Let declaredFunctionOrVarNames be the list-concatenation of declaredFunctionNames and declaredVarNames. // The spec here uses 'declaredVarNames' but that has not been declared yet. - HashTable hoisted_functions; + HashTable hoisted_functions; // b. For each FunctionDeclaration f that is directly contained in the StatementList of a Block, CaseClause, or DefaultClause Contained within body, do TRY(program.for_each_function_hoistable_with_annexB_extension([&](FunctionDeclaration& function_declaration) -> ThrowCompletionOr { @@ -926,7 +926,7 @@ ThrowCompletionOr eval_declaration_instantiation(VM& vm, Program const& pr } // 12. Let declaredVarNames be a new empty List. - HashTable declared_var_names; + HashTable declared_var_names; // 13. For each element d of varDeclarations, do TRY(program.for_each_var_scoped_variable_declaration([&](VariableDeclaration const& declaration) { @@ -1119,14 +1119,14 @@ Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, Vector< MUST(object->define_property_or_throw(vm.names.length, { .value = Value(length), .writable = true, .enumerable = false, .configurable = true })); // 17. Let mappedNames be a new empty List. - HashTable mapped_names; + HashTable mapped_names; // 18. Set index to numberOfParameters - 1. // 19. Repeat, while index ≥ 0, VERIFY(formals.size() <= NumericLimits::max()); for (i32 index = static_cast(formals.size()) - 1; index >= 0; --index) { // a. Let name be parameterNames[index]. - auto const& name = formals[index].binding.get(); + auto const& name = formals[index].binding.get(); // b. If name is not an element of mappedNames, then if (mapped_names.contains(name)) diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h index 4a9ea38d34d..8dd573dc6b8 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h @@ -35,7 +35,7 @@ ThrowCompletionOr length_of_array_like(VM&, Object const&); ThrowCompletionOr> create_list_from_array_like(VM&, Value, Function(Value)> = {}); ThrowCompletionOr species_constructor(VM&, Object const&, FunctionObject& default_constructor); ThrowCompletionOr get_function_realm(VM&, FunctionObject const&); -ThrowCompletionOr initialize_bound_name(VM&, FlyString const&, Value, Environment*); +ThrowCompletionOr initialize_bound_name(VM&, DeprecatedFlyString const&, Value, Environment*); bool is_compatible_property_descriptor(bool extensible, PropertyDescriptor const&, Optional const& current); bool validate_and_apply_property_descriptor(Object*, PropertyKey const&, bool extensible, PropertyDescriptor const&, Optional const& current); ThrowCompletionOr get_prototype_from_constructor(VM&, FunctionObject const& constructor, Object* (Intrinsics::*intrinsic_default_prototype)()); diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.h b/Userland/Libraries/LibJS/Runtime/BoundFunction.h index b139dcae44f..bf2b251eb8e 100644 --- a/Userland/Libraries/LibJS/Runtime/BoundFunction.h +++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.h @@ -22,7 +22,7 @@ public: virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; virtual ThrowCompletionOr> internal_construct(MarkedVector arguments_list, FunctionObject& new_target) override; - virtual FlyString const& name() const override { return m_name; } + virtual DeprecatedFlyString const& name() const override { return m_name; } virtual bool is_strict_mode() const override { return m_bound_target_function->is_strict_mode(); } virtual bool has_constructor() const override { return m_bound_target_function->has_constructor(); } @@ -39,7 +39,7 @@ private: Value m_bound_this; // [[BoundThis]] Vector m_bound_arguments; // [[BoundArguments]] - FlyString m_name; + DeprecatedFlyString m_name; }; } diff --git a/Userland/Libraries/LibJS/Runtime/CommonPropertyNames.h b/Userland/Libraries/LibJS/Runtime/CommonPropertyNames.h index 8e9301cbeac..34f7dfed23f 100644 --- a/Userland/Libraries/LibJS/Runtime/CommonPropertyNames.h +++ b/Userland/Libraries/LibJS/Runtime/CommonPropertyNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index 0203b642f6f..d1f226e6472 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -40,7 +40,7 @@ public: Throw, }; - ALWAYS_INLINE Completion(Type type, Optional value, Optional target) + ALWAYS_INLINE Completion(Type type, Optional value, Optional target) : m_type(type) , m_value(move(value)) , m_target(move(target)) @@ -81,8 +81,8 @@ public: } [[nodiscard]] Optional& value() { return m_value; } [[nodiscard]] Optional const& value() const { return m_value; } - [[nodiscard]] Optional& target() { return m_target; } - [[nodiscard]] Optional const& target() const { return m_target; } + [[nodiscard]] Optional& target() { return m_target; } + [[nodiscard]] Optional const& target() const { return m_target; } // "abrupt completion refers to any completion with a [[Type]] value other than normal" [[nodiscard]] bool is_abrupt() const { return m_type != Type::Normal; } @@ -127,9 +127,9 @@ private: return m_type == Type::Empty; } - Type m_type { Type::Normal }; // [[Type]] - Optional m_value; // [[Value]] - Optional m_target; // [[Target]] + Type m_type { Type::Normal }; // [[Type]] + Optional m_value; // [[Value]] + Optional m_target; // [[Target]] }; } diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp index 0449887535c..d427780ed99 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp @@ -45,7 +45,7 @@ void DeclarativeEnvironment::visit_edges(Visitor& visitor) } // 9.1.1.1.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-declarative-environment-records-hasbinding-n -ThrowCompletionOr DeclarativeEnvironment::has_binding(FlyString const& name, Optional* out_index) const +ThrowCompletionOr DeclarativeEnvironment::has_binding(DeprecatedFlyString const& name, Optional* out_index) const { auto binding_and_index = find_binding_and_index(name); if (!binding_and_index.has_value()) @@ -56,7 +56,7 @@ ThrowCompletionOr DeclarativeEnvironment::has_binding(FlyString const& nam } // 9.1.1.1.2 CreateMutableBinding ( N, D ), https://tc39.es/ecma262/#sec-declarative-environment-records-createmutablebinding-n-d -ThrowCompletionOr DeclarativeEnvironment::create_mutable_binding(VM&, FlyString const& name, bool can_be_deleted) +ThrowCompletionOr DeclarativeEnvironment::create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) { // 1. Assert: envRec does not already have a binding for N. // NOTE: We skip this to avoid O(n) traversal of m_bindings. @@ -76,7 +76,7 @@ ThrowCompletionOr DeclarativeEnvironment::create_mutable_binding(VM&, FlyS } // 9.1.1.1.3 CreateImmutableBinding ( N, S ), https://tc39.es/ecma262/#sec-declarative-environment-records-createimmutablebinding-n-s -ThrowCompletionOr DeclarativeEnvironment::create_immutable_binding(VM&, FlyString const& name, bool strict) +ThrowCompletionOr DeclarativeEnvironment::create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) { // 1. Assert: envRec does not already have a binding for N. // NOTE: We skip this to avoid O(n) traversal of m_bindings. @@ -96,7 +96,7 @@ ThrowCompletionOr DeclarativeEnvironment::create_immutable_binding(VM&, Fl } // 9.1.1.1.4 InitializeBinding ( N, V ), https://tc39.es/ecma262/#sec-declarative-environment-records-initializebinding-n-v -ThrowCompletionOr DeclarativeEnvironment::initialize_binding(VM& vm, FlyString const& name, Value value) +ThrowCompletionOr DeclarativeEnvironment::initialize_binding(VM& vm, DeprecatedFlyString const& name, Value value) { auto binding_and_index = find_binding_and_index(name); VERIFY(binding_and_index.has_value()); @@ -120,7 +120,7 @@ ThrowCompletionOr DeclarativeEnvironment::initialize_binding_direct(VM&, B } // 9.1.1.1.5 SetMutableBinding ( N, V, S ), https://tc39.es/ecma262/#sec-declarative-environment-records-setmutablebinding-n-v-s -ThrowCompletionOr DeclarativeEnvironment::set_mutable_binding(VM& vm, FlyString const& name, Value value, bool strict) +ThrowCompletionOr DeclarativeEnvironment::set_mutable_binding(VM& vm, DeprecatedFlyString const& name, Value value, bool strict) { // 1. If envRec does not have a binding for N, then auto binding_and_index = find_binding_and_index(name); @@ -170,7 +170,7 @@ ThrowCompletionOr DeclarativeEnvironment::set_mutable_binding_direct(VM& v } // 9.1.1.1.6 GetBindingValue ( N, S ), https://tc39.es/ecma262/#sec-declarative-environment-records-getbindingvalue-n-s -ThrowCompletionOr DeclarativeEnvironment::get_binding_value(VM& vm, FlyString const& name, bool strict) +ThrowCompletionOr DeclarativeEnvironment::get_binding_value(VM& vm, DeprecatedFlyString const& name, bool strict) { // 1. Assert: envRec has a binding for N. auto binding_and_index = find_binding_and_index(name); @@ -196,7 +196,7 @@ ThrowCompletionOr DeclarativeEnvironment::get_binding_value_direct(VM&, B } // 9.1.1.1.7 DeleteBinding ( N ), https://tc39.es/ecma262/#sec-declarative-environment-records-deletebinding-n -ThrowCompletionOr DeclarativeEnvironment::delete_binding(VM&, FlyString const& name) +ThrowCompletionOr DeclarativeEnvironment::delete_binding(VM&, DeprecatedFlyString const& name) { // 1. Assert: envRec has a binding for the name that is the value of N. auto binding_and_index = find_binding_and_index(name); @@ -214,7 +214,7 @@ ThrowCompletionOr DeclarativeEnvironment::delete_binding(VM&, FlyString co return true; } -ThrowCompletionOr DeclarativeEnvironment::initialize_or_set_mutable_binding(VM& vm, FlyString const& name, Value value) +ThrowCompletionOr DeclarativeEnvironment::initialize_or_set_mutable_binding(VM& vm, DeprecatedFlyString const& name, Value value) { auto binding_and_index = find_binding_and_index(name); VERIFY(binding_and_index.has_value()); @@ -226,7 +226,7 @@ ThrowCompletionOr DeclarativeEnvironment::initialize_or_set_mutable_bindin return {}; } -void DeclarativeEnvironment::initialize_or_set_mutable_binding(Badge, VM& vm, FlyString const& name, Value value) +void DeclarativeEnvironment::initialize_or_set_mutable_binding(Badge, VM& vm, DeprecatedFlyString const& name, Value value) { MUST(initialize_or_set_mutable_binding(vm, name, value)); } diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h index 18a905d5311..c4c844e0a8d 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -18,7 +18,7 @@ class DeclarativeEnvironment : public Environment { JS_ENVIRONMENT(DeclarativeEnvironment, Environment); struct Binding { - FlyString name; + DeprecatedFlyString name; Value value; bool strict { false }; bool mutable_ { false }; @@ -31,21 +31,21 @@ public: virtual ~DeclarativeEnvironment() override = default; - virtual ThrowCompletionOr has_binding(FlyString const& name, Optional* = nullptr) const override; - virtual ThrowCompletionOr create_mutable_binding(VM&, FlyString const& name, bool can_be_deleted) override; - virtual ThrowCompletionOr create_immutable_binding(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr initialize_binding(VM&, FlyString const& name, Value) override; - virtual ThrowCompletionOr set_mutable_binding(VM&, FlyString const& name, Value, bool strict) override; - virtual ThrowCompletionOr get_binding_value(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr delete_binding(VM&, FlyString const& name) override; + virtual ThrowCompletionOr has_binding(DeprecatedFlyString const& name, Optional* = nullptr) const override; + virtual ThrowCompletionOr create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) override; + virtual ThrowCompletionOr create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr initialize_binding(VM&, DeprecatedFlyString const& name, Value) override; + virtual ThrowCompletionOr set_mutable_binding(VM&, DeprecatedFlyString const& name, Value, bool strict) override; + virtual ThrowCompletionOr get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr delete_binding(VM&, DeprecatedFlyString const& name) override; - void initialize_or_set_mutable_binding(Badge, VM&, FlyString const& name, Value value); - ThrowCompletionOr initialize_or_set_mutable_binding(VM&, FlyString const& name, Value value); + void initialize_or_set_mutable_binding(Badge, VM&, DeprecatedFlyString const& name, Value value); + ThrowCompletionOr initialize_or_set_mutable_binding(VM&, DeprecatedFlyString const& name, Value value); // This is not a method defined in the spec! Do not use this in any LibJS (or other spec related) code. - [[nodiscard]] Vector bindings() const + [[nodiscard]] Vector bindings() const { - Vector names; + Vector names; names.ensure_capacity(m_bindings.size()); for (auto const& binding : m_bindings) @@ -101,7 +101,7 @@ protected: friend class ModuleEnvironment; - virtual Optional find_binding_and_index(FlyString const& name) const + virtual Optional find_binding_and_index(DeprecatedFlyString const& name) const { auto it = m_bindings.find_if([&](auto const& binding) { return binding.name == name; diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index a5a9cdfbbdf..2c7c2708865 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -28,7 +28,7 @@ namespace JS { -NonnullGCPtr ECMAScriptFunctionObject::create(Realm& realm, FlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) +NonnullGCPtr ECMAScriptFunctionObject::create(Realm& realm, DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) { Object* prototype = nullptr; switch (kind) { @@ -48,12 +48,12 @@ NonnullGCPtr ECMAScriptFunctionObject::create(Realm& r return realm.heap().allocate(realm, move(name), move(source_text), ecmascript_code, move(parameters), m_function_length, parent_environment, private_environment, *prototype, kind, is_strict, might_need_arguments_object, contains_direct_call_to_eval, is_arrow_function, move(class_field_initializer_name)); } -NonnullGCPtr ECMAScriptFunctionObject::create(Realm& realm, FlyString name, Object& prototype, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) +NonnullGCPtr ECMAScriptFunctionObject::create(Realm& realm, DeprecatedFlyString name, Object& prototype, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) { return realm.heap().allocate(realm, move(name), move(source_text), ecmascript_code, move(parameters), m_function_length, parent_environment, private_environment, prototype, kind, is_strict, might_need_arguments_object, contains_direct_call_to_eval, is_arrow_function, move(class_field_initializer_name)); } -ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector formal_parameters, i32 function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind kind, bool strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) +ECMAScriptFunctionObject::ECMAScriptFunctionObject(DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector formal_parameters, i32 function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind kind, bool strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) : FunctionObject(prototype) , m_name(move(name)) , m_function_length(function_length) @@ -91,7 +91,7 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, DeprecatedStr return false; if (parameter.default_value) return false; - if (!parameter.binding.template has()) + if (!parameter.binding.template has()) return false; return true; }); @@ -338,13 +338,13 @@ ThrowCompletionOr ECMAScriptFunctionObject::function_declaration_instantia // FIXME: Maybe compute has duplicates at parse time? (We need to anyway since it's an error in some cases) bool has_duplicates = false; - HashTable parameter_names; + HashTable parameter_names; for (auto& parameter : m_formal_parameters) { if (parameter.default_value) has_parameter_expressions = true; parameter.binding.visit( - [&](FlyString const& name) { + [&](DeprecatedFlyString const& name) { if (parameter_names.set(name) != AK::HashSetResult::InsertedNewEntry) has_duplicates = true; }, @@ -367,7 +367,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::function_declaration_instantia if (parameter_names.contains(vm.names.arguments.as_string())) arguments_object_needed = false; - HashTable function_names; + HashTable function_names; Vector functions_to_initialize; if (scope_body) { @@ -463,7 +463,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::function_declaration_instantia Environment* used_environment = has_duplicates ? nullptr : environment; - if constexpr (IsSame) { + if constexpr (IsSame) { Reference reference = TRY(vm.resolve_binding(param, used_environment)); // Here the difference from hasDuplicates is important if (has_duplicates) @@ -479,7 +479,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::function_declaration_instantia GCPtr var_environment; - HashTable instantiated_var_names; + HashTable instantiated_var_names; if (scope_body) instantiated_var_names.ensure_capacity(scope_body->var_declaration_count()); @@ -911,7 +911,7 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body() VERIFY_NOT_REACHED(); } -void ECMAScriptFunctionObject::set_name(FlyString const& name) +void ECMAScriptFunctionObject::set_name(DeprecatedFlyString const& name) { VERIFY(!name.is_null()); auto& vm = this->vm(); diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h index ca7c82ccd6e..ef196ebf557 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h @@ -32,8 +32,8 @@ public: Global, }; - static NonnullGCPtr create(Realm&, FlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); - static NonnullGCPtr create(Realm&, FlyString name, Object& prototype, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); + static NonnullGCPtr create(Realm&, DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); + static NonnullGCPtr create(Realm&, DeprecatedFlyString name, Object& prototype, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); virtual void initialize(Realm&) override; virtual ~ECMAScriptFunctionObject() override = default; @@ -46,8 +46,8 @@ public: Statement const& ecmascript_code() const { return m_ecmascript_code; } Vector const& formal_parameters() const { return m_formal_parameters; }; - virtual FlyString const& name() const override { return m_name; }; - void set_name(FlyString const& name); + virtual DeprecatedFlyString const& name() const override { return m_name; }; + void set_name(DeprecatedFlyString const& name); void set_is_class_constructor() { m_is_class_constructor = true; }; @@ -93,7 +93,7 @@ protected: virtual Completion ordinary_call_evaluate_body(); private: - ECMAScriptFunctionObject(FlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name); + ECMAScriptFunctionObject(DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name); virtual bool is_ecmascript_function_object() const override { return true; } virtual void visit_edges(Visitor&) override; @@ -105,7 +105,7 @@ private: ThrowCompletionOr function_declaration_instantiation(Interpreter*); - FlyString m_name; + DeprecatedFlyString m_name; OwnPtr m_bytecode_executable; Vector> m_default_parameter_bytecode_executables; i32 m_function_length { 0 }; diff --git a/Userland/Libraries/LibJS/Runtime/Environment.h b/Userland/Libraries/LibJS/Runtime/Environment.h index 9073eeab053..74388d74291 100644 --- a/Userland/Libraries/LibJS/Runtime/Environment.h +++ b/Userland/Libraries/LibJS/Runtime/Environment.h @@ -28,13 +28,13 @@ public: virtual Object* with_base_object() const { return nullptr; } - virtual ThrowCompletionOr has_binding([[maybe_unused]] FlyString const& name, [[maybe_unused]] Optional* out_index = nullptr) const { return false; } - virtual ThrowCompletionOr create_mutable_binding(VM&, [[maybe_unused]] FlyString const& name, [[maybe_unused]] bool can_be_deleted) { return {}; } - virtual ThrowCompletionOr create_immutable_binding(VM&, [[maybe_unused]] FlyString const& name, [[maybe_unused]] bool strict) { return {}; } - virtual ThrowCompletionOr initialize_binding(VM&, [[maybe_unused]] FlyString const& name, Value) { return {}; } - virtual ThrowCompletionOr set_mutable_binding(VM&, [[maybe_unused]] FlyString const& name, Value, [[maybe_unused]] bool strict) { return {}; } - virtual ThrowCompletionOr get_binding_value(VM&, [[maybe_unused]] FlyString const& name, [[maybe_unused]] bool strict) { return Value {}; } - virtual ThrowCompletionOr delete_binding(VM&, [[maybe_unused]] FlyString const& name) { return false; } + virtual ThrowCompletionOr has_binding([[maybe_unused]] DeprecatedFlyString const& name, [[maybe_unused]] Optional* out_index = nullptr) const { return false; } + virtual ThrowCompletionOr create_mutable_binding(VM&, [[maybe_unused]] DeprecatedFlyString const& name, [[maybe_unused]] bool can_be_deleted) { return {}; } + virtual ThrowCompletionOr create_immutable_binding(VM&, [[maybe_unused]] DeprecatedFlyString const& name, [[maybe_unused]] bool strict) { return {}; } + virtual ThrowCompletionOr initialize_binding(VM&, [[maybe_unused]] DeprecatedFlyString const& name, Value) { return {}; } + virtual ThrowCompletionOr set_mutable_binding(VM&, [[maybe_unused]] DeprecatedFlyString const& name, Value, [[maybe_unused]] bool strict) { return {}; } + virtual ThrowCompletionOr get_binding_value(VM&, [[maybe_unused]] DeprecatedFlyString const& name, [[maybe_unused]] bool strict) { return Value {}; } + virtual ThrowCompletionOr delete_binding(VM&, [[maybe_unused]] DeprecatedFlyString const& name) { return false; } // [[OuterEnv]] Environment* outer_environment() { return m_outer_environment; } diff --git a/Userland/Libraries/LibJS/Runtime/Error.h b/Userland/Libraries/LibJS/Runtime/Error.h index 994aa767599..0422003e167 100644 --- a/Userland/Libraries/LibJS/Runtime/Error.h +++ b/Userland/Libraries/LibJS/Runtime/Error.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -15,7 +15,7 @@ namespace JS { struct TracebackFrame { - FlyString function_name; + DeprecatedFlyString function_name; SourceRange source_range; }; diff --git a/Userland/Libraries/LibJS/Runtime/ExecutionContext.h b/Userland/Libraries/LibJS/Runtime/ExecutionContext.h index 4397604b0bc..aea49861609 100644 --- a/Userland/Libraries/LibJS/Runtime/ExecutionContext.h +++ b/Userland/Libraries/LibJS/Runtime/ExecutionContext.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -43,7 +43,7 @@ public: Cell* context_owner { nullptr }; ASTNode const* current_node { nullptr }; - FlyString function_name; + DeprecatedFlyString function_name; Value this_value; MarkedVector arguments; bool is_strict_mode { false }; diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.h b/Userland/Libraries/LibJS/Runtime/FunctionObject.h index b039b89ea42..6fc6991a793 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.h @@ -27,7 +27,7 @@ public: virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) = 0; virtual ThrowCompletionOr> internal_construct([[maybe_unused]] MarkedVector arguments_list, [[maybe_unused]] FunctionObject& new_target) { VERIFY_NOT_REACHED(); } - virtual FlyString const& name() const = 0; + virtual DeprecatedFlyString const& name() const = 0; void set_function_name(Variant const& name_arg, Optional const& prefix = {}); void set_function_length(double length); diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h index 0fd04665ed8..77919d5abc1 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h @@ -18,7 +18,7 @@ public: virtual ~FunctionPrototype() override = default; virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; - virtual FlyString const& name() const override { return m_name; } + virtual DeprecatedFlyString const& name() const override { return m_name; } private: explicit FunctionPrototype(Realm&); @@ -31,7 +31,7 @@ private: // Totally unnecessary, but sadly still necessary. // TODO: Get rid of the pointless name() method. - FlyString m_name { "FunctionPrototype" }; + DeprecatedFlyString m_name { "FunctionPrototype" }; }; } diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp index 64d766525db..2fada09a3d0 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp @@ -39,7 +39,7 @@ ThrowCompletionOr GlobalEnvironment::get_this_binding(VM&) const } // 9.1.1.4.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-global-environment-records-hasbinding-n -ThrowCompletionOr GlobalEnvironment::has_binding(FlyString const& name, Optional* out_index) const +ThrowCompletionOr GlobalEnvironment::has_binding(DeprecatedFlyString const& name, Optional* out_index) const { if (out_index) *out_index = EnvironmentCoordinate::global_marker; @@ -55,7 +55,7 @@ ThrowCompletionOr GlobalEnvironment::has_binding(FlyString const& name, Op } // 9.1.1.4.2 CreateMutableBinding ( N, D ), https://tc39.es/ecma262/#sec-global-environment-records-createmutablebinding-n-d -ThrowCompletionOr GlobalEnvironment::create_mutable_binding(VM& vm, FlyString const& name, bool can_be_deleted) +ThrowCompletionOr GlobalEnvironment::create_mutable_binding(VM& vm, DeprecatedFlyString const& name, bool can_be_deleted) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, throw a TypeError exception. @@ -67,7 +67,7 @@ ThrowCompletionOr GlobalEnvironment::create_mutable_binding(VM& vm, FlyStr } // 9.1.1.4.3 CreateImmutableBinding ( N, S ), https://tc39.es/ecma262/#sec-global-environment-records-createimmutablebinding-n-s -ThrowCompletionOr GlobalEnvironment::create_immutable_binding(VM& vm, FlyString const& name, bool strict) +ThrowCompletionOr GlobalEnvironment::create_immutable_binding(VM& vm, DeprecatedFlyString const& name, bool strict) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, throw a TypeError exception. @@ -79,7 +79,7 @@ ThrowCompletionOr GlobalEnvironment::create_immutable_binding(VM& vm, FlyS } // 9.1.1.4.4 InitializeBinding ( N, V ), https://tc39.es/ecma262/#sec-global-environment-records-initializebinding-n-v -ThrowCompletionOr GlobalEnvironment::initialize_binding(VM& vm, FlyString const& name, Value value) +ThrowCompletionOr GlobalEnvironment::initialize_binding(VM& vm, DeprecatedFlyString const& name, Value value) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, then @@ -95,7 +95,7 @@ ThrowCompletionOr GlobalEnvironment::initialize_binding(VM& vm, FlyString } // 9.1.1.4.5 SetMutableBinding ( N, V, S ), https://tc39.es/ecma262/#sec-global-environment-records-setmutablebinding-n-v-s -ThrowCompletionOr GlobalEnvironment::set_mutable_binding(VM& vm, FlyString const& name, Value value, bool strict) +ThrowCompletionOr GlobalEnvironment::set_mutable_binding(VM& vm, DeprecatedFlyString const& name, Value value, bool strict) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, then @@ -110,7 +110,7 @@ ThrowCompletionOr GlobalEnvironment::set_mutable_binding(VM& vm, FlyString } // 9.1.1.4.6 GetBindingValue ( N, S ), https://tc39.es/ecma262/#sec-global-environment-records-getbindingvalue-n-s -ThrowCompletionOr GlobalEnvironment::get_binding_value(VM& vm, FlyString const& name, bool strict) +ThrowCompletionOr GlobalEnvironment::get_binding_value(VM& vm, DeprecatedFlyString const& name, bool strict) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, then @@ -125,7 +125,7 @@ ThrowCompletionOr GlobalEnvironment::get_binding_value(VM& vm, FlyString } // 9.1.1.4.7 DeleteBinding ( N ), https://tc39.es/ecma262/#sec-global-environment-records-deletebinding-n -ThrowCompletionOr GlobalEnvironment::delete_binding(VM& vm, FlyString const& name) +ThrowCompletionOr GlobalEnvironment::delete_binding(VM& vm, DeprecatedFlyString const& name) { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. If ! DclRec.HasBinding(N) is true, then @@ -161,7 +161,7 @@ ThrowCompletionOr GlobalEnvironment::delete_binding(VM& vm, FlyString cons } // 9.1.1.4.12 HasVarDeclaration ( N ), https://tc39.es/ecma262/#sec-hasvardeclaration -bool GlobalEnvironment::has_var_declaration(FlyString const& name) const +bool GlobalEnvironment::has_var_declaration(DeprecatedFlyString const& name) const { // 1. Let varDeclaredNames be envRec.[[VarNames]]. // 2. If varDeclaredNames contains N, return true. @@ -170,7 +170,7 @@ bool GlobalEnvironment::has_var_declaration(FlyString const& name) const } // 9.1.1.4.13 HasLexicalDeclaration ( N ), https://tc39.es/ecma262/#sec-haslexicaldeclaration -bool GlobalEnvironment::has_lexical_declaration(FlyString const& name) const +bool GlobalEnvironment::has_lexical_declaration(DeprecatedFlyString const& name) const { // 1. Let DclRec be envRec.[[DeclarativeRecord]]. // 2. Return ! DclRec.HasBinding(N). @@ -178,7 +178,7 @@ bool GlobalEnvironment::has_lexical_declaration(FlyString const& name) const } // 9.1.1.4.14 HasRestrictedGlobalProperty ( N ), https://tc39.es/ecma262/#sec-hasrestrictedglobalproperty -ThrowCompletionOr GlobalEnvironment::has_restricted_global_property(FlyString const& name) const +ThrowCompletionOr GlobalEnvironment::has_restricted_global_property(DeprecatedFlyString const& name) const { // 1. Let ObjRec be envRec.[[ObjectRecord]]. // 2. Let globalObject be ObjRec.[[BindingObject]]. @@ -200,7 +200,7 @@ ThrowCompletionOr GlobalEnvironment::has_restricted_global_property(FlyStr } // 9.1.1.4.15 CanDeclareGlobalVar ( N ), https://tc39.es/ecma262/#sec-candeclareglobalvar -ThrowCompletionOr GlobalEnvironment::can_declare_global_var(FlyString const& name) const +ThrowCompletionOr GlobalEnvironment::can_declare_global_var(DeprecatedFlyString const& name) const { // 1. Let ObjRec be envRec.[[ObjectRecord]]. // 2. Let globalObject be ObjRec.[[BindingObject]]. @@ -218,7 +218,7 @@ ThrowCompletionOr GlobalEnvironment::can_declare_global_var(FlyString cons } // 9.1.1.4.16 CanDeclareGlobalFunction ( N ), https://tc39.es/ecma262/#sec-candeclareglobalfunction -ThrowCompletionOr GlobalEnvironment::can_declare_global_function(FlyString const& name) const +ThrowCompletionOr GlobalEnvironment::can_declare_global_function(DeprecatedFlyString const& name) const { // 1. Let ObjRec be envRec.[[ObjectRecord]]. // 2. Let globalObject be ObjRec.[[BindingObject]]. @@ -244,7 +244,7 @@ ThrowCompletionOr GlobalEnvironment::can_declare_global_function(FlyString } // 9.1.1.4.17 CreateGlobalVarBinding ( N, D ), https://tc39.es/ecma262/#sec-createglobalvarbinding -ThrowCompletionOr GlobalEnvironment::create_global_var_binding(FlyString const& name, bool can_be_deleted) +ThrowCompletionOr GlobalEnvironment::create_global_var_binding(DeprecatedFlyString const& name, bool can_be_deleted) { auto& vm = this->vm(); @@ -279,7 +279,7 @@ ThrowCompletionOr GlobalEnvironment::create_global_var_binding(FlyString c } // 9.1.1.4.18 CreateGlobalFunctionBinding ( N, V, D ), https://tc39.es/ecma262/#sec-createglobalfunctionbinding -ThrowCompletionOr GlobalEnvironment::create_global_function_binding(FlyString const& name, Value value, bool can_be_deleted) +ThrowCompletionOr GlobalEnvironment::create_global_function_binding(DeprecatedFlyString const& name, Value value, bool can_be_deleted) { // 1. Let ObjRec be envRec.[[ObjectRecord]]. // 2. Let globalObject be ObjRec.[[BindingObject]]. diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h index 8f7cf688f78..65ed8437250 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h @@ -17,25 +17,25 @@ public: virtual bool has_this_binding() const final { return true; } virtual ThrowCompletionOr get_this_binding(VM&) const final; - virtual ThrowCompletionOr has_binding(FlyString const& name, Optional* = nullptr) const override; - virtual ThrowCompletionOr create_mutable_binding(VM&, FlyString const& name, bool can_be_deleted) override; - virtual ThrowCompletionOr create_immutable_binding(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr initialize_binding(VM&, FlyString const& name, Value) override; - virtual ThrowCompletionOr set_mutable_binding(VM&, FlyString const& name, Value, bool strict) override; - virtual ThrowCompletionOr get_binding_value(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr delete_binding(VM&, FlyString const& name) override; + virtual ThrowCompletionOr has_binding(DeprecatedFlyString const& name, Optional* = nullptr) const override; + virtual ThrowCompletionOr create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) override; + virtual ThrowCompletionOr create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr initialize_binding(VM&, DeprecatedFlyString const& name, Value) override; + virtual ThrowCompletionOr set_mutable_binding(VM&, DeprecatedFlyString const& name, Value, bool strict) override; + virtual ThrowCompletionOr get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr delete_binding(VM&, DeprecatedFlyString const& name) override; ObjectEnvironment& object_record() { return *m_object_record; } Object& global_this_value() { return *m_global_this_value; } DeclarativeEnvironment& declarative_record() { return *m_declarative_record; } - bool has_var_declaration(FlyString const& name) const; - bool has_lexical_declaration(FlyString const& name) const; - ThrowCompletionOr has_restricted_global_property(FlyString const& name) const; - ThrowCompletionOr can_declare_global_var(FlyString const& name) const; - ThrowCompletionOr can_declare_global_function(FlyString const& name) const; - ThrowCompletionOr create_global_var_binding(FlyString const& name, bool can_be_deleted); - ThrowCompletionOr create_global_function_binding(FlyString const& name, Value, bool can_be_deleted); + bool has_var_declaration(DeprecatedFlyString const& name) const; + bool has_lexical_declaration(DeprecatedFlyString const& name) const; + ThrowCompletionOr has_restricted_global_property(DeprecatedFlyString const& name) const; + ThrowCompletionOr can_declare_global_var(DeprecatedFlyString const& name) const; + ThrowCompletionOr can_declare_global_function(DeprecatedFlyString const& name) const; + ThrowCompletionOr create_global_var_binding(DeprecatedFlyString const& name, bool can_be_deleted); + ThrowCompletionOr create_global_function_binding(DeprecatedFlyString const& name, Value, bool can_be_deleted); private: GlobalEnvironment(Object&, Object& this_value); @@ -46,7 +46,7 @@ private: ObjectEnvironment* m_object_record { nullptr }; // [[ObjectRecord]] Object* m_global_this_value { nullptr }; // [[GlobalThisValue]] DeclarativeEnvironment* m_declarative_record { nullptr }; // [[DeclarativeRecord]] - Vector m_var_names; // [[VarNames]] + Vector m_var_names; // [[VarNames]] }; template<> diff --git a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp index 8c2c7f5270b..ba2a2fa38b4 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp @@ -18,7 +18,7 @@ ModuleEnvironment::ModuleEnvironment(Environment* outer_environment) } // 9.1.1.5.1 GetBindingValue ( N, S ), https://tc39.es/ecma262/#sec-module-environment-records-getbindingvalue-n-s -ThrowCompletionOr ModuleEnvironment::get_binding_value(VM& vm, FlyString const& name, bool strict) +ThrowCompletionOr ModuleEnvironment::get_binding_value(VM& vm, DeprecatedFlyString const& name, bool strict) { // 1. Assert: S is true. VERIFY(strict); @@ -49,7 +49,7 @@ ThrowCompletionOr ModuleEnvironment::get_binding_value(VM& vm, FlyString } // 9.1.1.5.2 DeleteBinding ( N ), https://tc39.es/ecma262/#sec-module-environment-records-deletebinding-n -ThrowCompletionOr ModuleEnvironment::delete_binding(VM&, FlyString const&) +ThrowCompletionOr ModuleEnvironment::delete_binding(VM&, DeprecatedFlyString const&) { // The DeleteBinding concrete method of a module Environment Record is never used within this specification. VERIFY_NOT_REACHED(); @@ -63,7 +63,7 @@ ThrowCompletionOr ModuleEnvironment::get_this_binding(VM&) const } // 9.1.1.5.5 CreateImportBinding ( N, M, N2 ), https://tc39.es/ecma262/#sec-createimportbinding -ThrowCompletionOr ModuleEnvironment::create_import_binding(FlyString name, Module* module, FlyString binding_name) +ThrowCompletionOr ModuleEnvironment::create_import_binding(DeprecatedFlyString name, Module* module, DeprecatedFlyString binding_name) { // 1. Assert: envRec does not already have a binding for N. VERIFY(!get_indirect_binding(name)); @@ -80,7 +80,7 @@ ThrowCompletionOr ModuleEnvironment::create_import_binding(FlyString name, return {}; } -ModuleEnvironment::IndirectBinding const* ModuleEnvironment::get_indirect_binding(FlyString const& name) const +ModuleEnvironment::IndirectBinding const* ModuleEnvironment::get_indirect_binding(DeprecatedFlyString const& name) const { auto binding_or_end = m_indirect_bindings.find_if([&](IndirectBinding const& binding) { return binding.name == name; @@ -91,7 +91,7 @@ ModuleEnvironment::IndirectBinding const* ModuleEnvironment::get_indirect_bindin return &(*binding_or_end); } -Optional ModuleEnvironment::find_binding_and_index(FlyString const& name) const +Optional ModuleEnvironment::find_binding_and_index(DeprecatedFlyString const& name) const { auto* indirect_binding = get_indirect_binding(name); if (indirect_binding != nullptr) { diff --git a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h index 181da9134e5..03eee4b39fe 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h @@ -21,11 +21,11 @@ public: // in Table 18 and share the same specifications for all of those methods except for // GetBindingValue, DeleteBinding, HasThisBinding and GetThisBinding. // In addition, module Environment Records support the methods listed in Table 24. - virtual ThrowCompletionOr get_binding_value(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr delete_binding(VM&, FlyString const& name) override; + virtual ThrowCompletionOr get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr delete_binding(VM&, DeprecatedFlyString const& name) override; virtual bool has_this_binding() const final { return true; } virtual ThrowCompletionOr get_this_binding(VM&) const final; - ThrowCompletionOr create_import_binding(FlyString name, Module* module, FlyString binding_name); + ThrowCompletionOr create_import_binding(DeprecatedFlyString name, Module* module, DeprecatedFlyString binding_name); private: explicit ModuleEnvironment(Environment* outer_environment); @@ -33,13 +33,13 @@ private: virtual void visit_edges(Visitor&) override; struct IndirectBinding { - FlyString name; + DeprecatedFlyString name; Module* module; - FlyString binding_name; + DeprecatedFlyString binding_name; }; - IndirectBinding const* get_indirect_binding(FlyString const& name) const; + IndirectBinding const* get_indirect_binding(DeprecatedFlyString const& name) const; - virtual Optional find_binding_and_index(FlyString const& name) const override; + virtual Optional find_binding_and_index(DeprecatedFlyString const& name) const override; // FIXME: Since we always access this via the name this could be a map. Vector m_indirect_bindings; diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp index 99244730496..7b5a18aed31 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp @@ -10,14 +10,14 @@ namespace JS { -ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector exports) +ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector exports) : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype()) , m_module(module) , m_exports(move(exports)) { // Note: We just perform step 6 of 10.4.6.12 ModuleNamespaceCreate ( module, exports ), https://tc39.es/ecma262/#sec-modulenamespacecreate // 6. Let sortedExports be a List whose elements are the elements of exports ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using undefined as comparefn. - quick_sort(m_exports, [&](FlyString const& lhs, FlyString const& rhs) { + quick_sort(m_exports, [&](DeprecatedFlyString const& lhs, DeprecatedFlyString const& rhs) { return lhs.view() < rhs.view(); }); } diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h index 8c72cfd4365..97f9e7440b4 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h @@ -32,11 +32,11 @@ public: virtual void initialize(Realm&) override; private: - ModuleNamespaceObject(Realm&, Module* module, Vector exports); + ModuleNamespaceObject(Realm&, Module* module, Vector exports); // FIXME: UHHH how do we want to store this to avoid cycles but be safe?? - Module* m_module; // [[Module]] - Vector m_exports; // [[Exports]] + Module* m_module; // [[Module]] + Vector m_exports; // [[Exports]] }; } diff --git a/Userland/Libraries/LibJS/Runtime/ModuleRequest.h b/Userland/Libraries/LibJS/Runtime/ModuleRequest.h index 90fb7ab5f57..98dae53d0fe 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleRequest.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleRequest.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include namespace JS { @@ -20,20 +20,20 @@ struct ModuleRequest { ModuleRequest() = default; - explicit ModuleRequest(FlyString specifier) + explicit ModuleRequest(DeprecatedFlyString specifier) : module_specifier(move(specifier)) { } - ModuleRequest(FlyString module_specifier, Vector assertions); + ModuleRequest(DeprecatedFlyString module_specifier, Vector assertions); void add_assertion(DeprecatedString key, DeprecatedString value) { assertions.empend(move(key), move(value)); } - FlyString module_specifier; // [[Specifier]] - Vector assertions; // [[Assertions]] + DeprecatedFlyString module_specifier; // [[Specifier]] + Vector assertions; // [[Assertions]] }; } diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp index 21c31d92a45..bb8427e2fcc 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp @@ -51,7 +51,7 @@ NonnullGCPtr NativeFunction::create(Realm& allocating_realm, Saf return function; } -NonnullGCPtr NativeFunction::create(Realm& realm, FlyString const& name, SafeFunction(VM&)> function) +NonnullGCPtr NativeFunction::create(Realm& realm, DeprecatedFlyString const& name, SafeFunction(VM&)> function) { return realm.heap().allocate(realm, name, move(function), *realm.intrinsics().function_prototype()); } @@ -73,7 +73,7 @@ NativeFunction::NativeFunction(Object& prototype) { } -NativeFunction::NativeFunction(FlyString name, SafeFunction(VM&)> native_function, Object& prototype) +NativeFunction::NativeFunction(DeprecatedFlyString name, SafeFunction(VM&)> native_function, Object& prototype) : FunctionObject(prototype) , m_name(move(name)) , m_native_function(move(native_function)) @@ -81,7 +81,7 @@ NativeFunction::NativeFunction(FlyString name, SafeFunction create(Realm&, SafeFunction(VM&)> behaviour, i32 length, PropertyKey const& name, Optional = {}, Optional prototype = {}, Optional const& prefix = {}); - static NonnullGCPtr create(Realm&, FlyString const& name, SafeFunction(VM&)>); + static NonnullGCPtr create(Realm&, DeprecatedFlyString const& name, SafeFunction(VM&)>); virtual void initialize(Realm&) override { } virtual ~NativeFunction() override = default; @@ -34,25 +34,25 @@ public: virtual ThrowCompletionOr call(); virtual ThrowCompletionOr> construct(FunctionObject& new_target); - virtual FlyString const& name() const override { return m_name; }; + virtual DeprecatedFlyString const& name() const override { return m_name; }; virtual bool is_strict_mode() const override; virtual bool has_constructor() const override { return false; } virtual Realm* realm() const override { return m_realm; } - Optional const& initial_name() const { return m_initial_name; } - void set_initial_name(Badge, FlyString initial_name) { m_initial_name = move(initial_name); } + Optional const& initial_name() const { return m_initial_name; } + void set_initial_name(Badge, DeprecatedFlyString initial_name) { m_initial_name = move(initial_name); } protected: - NativeFunction(FlyString name, Object& prototype); + NativeFunction(DeprecatedFlyString name, Object& prototype); NativeFunction(SafeFunction(VM&)>, Object* prototype, Realm& realm); - NativeFunction(FlyString name, SafeFunction(VM&)>, Object& prototype); + NativeFunction(DeprecatedFlyString name, SafeFunction(VM&)>, Object& prototype); explicit NativeFunction(Object& prototype); private: virtual bool is_native_function() const final { return true; } - FlyString m_name; - Optional m_initial_name; // [[InitialName]] + DeprecatedFlyString m_name; + Optional m_initial_name; // [[InitialName]] SafeFunction(VM&)> m_native_function; Realm* m_realm { nullptr }; }; diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 3ae26f30909..489a8387338 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -24,7 +24,7 @@ namespace JS { -static HashMap> s_intrinsics; +static HashMap> s_intrinsics; // 10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] ), https://tc39.es/ecma262/#sec-ordinaryobjectcreate NonnullGCPtr Object::create(Realm& realm, Object* prototype) @@ -1259,7 +1259,7 @@ Optional Object::enumerate_object_properties(Function visited; + HashTable visited; auto const* target = this; while (target) { @@ -1267,7 +1267,7 @@ Optional Object::enumerate_object_properties(Functioninternal_get_own_property(property_key)); diff --git a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp index 29501bcbe95..cdc4f1e74bf 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp @@ -24,7 +24,7 @@ void ObjectEnvironment::visit_edges(Cell::Visitor& visitor) } // 9.1.1.2.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-object-environment-records-hasbinding-n -ThrowCompletionOr ObjectEnvironment::has_binding(FlyString const& name, Optional*) const +ThrowCompletionOr ObjectEnvironment::has_binding(DeprecatedFlyString const& name, Optional*) const { auto& vm = this->vm(); @@ -59,7 +59,7 @@ ThrowCompletionOr ObjectEnvironment::has_binding(FlyString const& name, Op } // 9.1.1.2.2 CreateMutableBinding ( N, D ), https://tc39.es/ecma262/#sec-object-environment-records-createmutablebinding-n-d -ThrowCompletionOr ObjectEnvironment::create_mutable_binding(VM&, FlyString const& name, bool can_be_deleted) +ThrowCompletionOr ObjectEnvironment::create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) { // 1. Let bindingObject be envRec.[[BindingObject]]. // 2. Perform ? DefinePropertyOrThrow(bindingObject, N, PropertyDescriptor { [[Value]]: undefined, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: D }). @@ -70,14 +70,14 @@ ThrowCompletionOr ObjectEnvironment::create_mutable_binding(VM&, FlyString } // 9.1.1.2.3 CreateImmutableBinding ( N, S ), https://tc39.es/ecma262/#sec-object-environment-records-createimmutablebinding-n-s -ThrowCompletionOr ObjectEnvironment::create_immutable_binding(VM&, FlyString const&, bool) +ThrowCompletionOr ObjectEnvironment::create_immutable_binding(VM&, DeprecatedFlyString const&, bool) { // "The CreateImmutableBinding concrete method of an object Environment Record is never used within this specification." VERIFY_NOT_REACHED(); } // 9.1.1.2.4 InitializeBinding ( N, V ), https://tc39.es/ecma262/#sec-object-environment-records-initializebinding-n-v -ThrowCompletionOr ObjectEnvironment::initialize_binding(VM& vm, FlyString const& name, Value value) +ThrowCompletionOr ObjectEnvironment::initialize_binding(VM& vm, DeprecatedFlyString const& name, Value value) { // 1. Perform ? envRec.SetMutableBinding(N, V, false). TRY(set_mutable_binding(vm, name, value, false)); @@ -87,7 +87,7 @@ ThrowCompletionOr ObjectEnvironment::initialize_binding(VM& vm, FlyString } // 9.1.1.2.5 SetMutableBinding ( N, V, S ), https://tc39.es/ecma262/#sec-object-environment-records-setmutablebinding-n-v-s -ThrowCompletionOr ObjectEnvironment::set_mutable_binding(VM&, FlyString const& name, Value value, bool strict) +ThrowCompletionOr ObjectEnvironment::set_mutable_binding(VM&, DeprecatedFlyString const& name, Value value, bool strict) { auto& vm = this->vm(); @@ -129,7 +129,7 @@ ThrowCompletionOr ObjectEnvironment::set_mutable_binding(VM&, FlyString co } // 9.1.1.2.6 GetBindingValue ( N, S ), https://tc39.es/ecma262/#sec-object-environment-records-getbindingvalue-n-s -ThrowCompletionOr ObjectEnvironment::get_binding_value(VM&, FlyString const& name, bool strict) +ThrowCompletionOr ObjectEnvironment::get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) { auto& vm = this->vm(); @@ -158,7 +158,7 @@ ThrowCompletionOr ObjectEnvironment::get_binding_value(VM&, FlyString con } // 9.1.1.2.7 DeleteBinding ( N ), https://tc39.es/ecma262/#sec-object-environment-records-deletebinding-n -ThrowCompletionOr ObjectEnvironment::delete_binding(VM&, FlyString const& name) +ThrowCompletionOr ObjectEnvironment::delete_binding(VM&, DeprecatedFlyString const& name) { // 1. Let bindingObject be envRec.[[BindingObject]]. // 2. Return ? bindingObject.[[Delete]](N). diff --git a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h index 813a711ccd4..bd3bbc7729b 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h @@ -19,13 +19,13 @@ public: Yes, }; - virtual ThrowCompletionOr has_binding(FlyString const& name, Optional* = nullptr) const override; - virtual ThrowCompletionOr create_mutable_binding(VM&, FlyString const& name, bool can_be_deleted) override; - virtual ThrowCompletionOr create_immutable_binding(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr initialize_binding(VM&, FlyString const& name, Value) override; - virtual ThrowCompletionOr set_mutable_binding(VM&, FlyString const& name, Value, bool strict) override; - virtual ThrowCompletionOr get_binding_value(VM&, FlyString const& name, bool strict) override; - virtual ThrowCompletionOr delete_binding(VM&, FlyString const& name) override; + virtual ThrowCompletionOr has_binding(DeprecatedFlyString const& name, Optional* = nullptr) const override; + virtual ThrowCompletionOr create_mutable_binding(VM&, DeprecatedFlyString const& name, bool can_be_deleted) override; + virtual ThrowCompletionOr create_immutable_binding(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr initialize_binding(VM&, DeprecatedFlyString const& name, Value) override; + virtual ThrowCompletionOr set_mutable_binding(VM&, DeprecatedFlyString const& name, Value, bool strict) override; + virtual ThrowCompletionOr get_binding_value(VM&, DeprecatedFlyString const& name, bool strict) override; + virtual ThrowCompletionOr delete_binding(VM&, DeprecatedFlyString const& name) override; // 9.1.1.2.10 WithBaseObject ( ), https://tc39.es/ecma262/#sec-object-environment-records-withbaseobject virtual Object* with_base_object() const override diff --git a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp index 8785cea00c3..551508a352d 100644 --- a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp @@ -19,7 +19,7 @@ PrivateEnvironment::PrivateEnvironment(PrivateEnvironment* parent) // Note: we start at one such that 0 can be invalid / default initialized. u64 PrivateEnvironment::s_next_id = 1u; -PrivateName PrivateEnvironment::resolve_private_identifier(FlyString const& identifier) const +PrivateName PrivateEnvironment::resolve_private_identifier(DeprecatedFlyString const& identifier) const { auto name_or_end = find_private_name(identifier); @@ -32,7 +32,7 @@ PrivateName PrivateEnvironment::resolve_private_identifier(FlyString const& iden return m_outer_environment->resolve_private_identifier(identifier); } -void PrivateEnvironment::add_private_name(Badge, FlyString description) +void PrivateEnvironment::add_private_name(Badge, DeprecatedFlyString description) { if (!find_private_name(description).is_end()) return; diff --git a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h index f9c6d07b052..055b5b5e808 100644 --- a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -15,14 +15,14 @@ namespace JS { struct PrivateName { PrivateName() = default; - PrivateName(u64 unique_id, FlyString description) + PrivateName(u64 unique_id, DeprecatedFlyString description) : unique_id(unique_id) , description(move(description)) { } u64 unique_id { 0 }; - FlyString description; + DeprecatedFlyString description; bool operator==(PrivateName const& rhs) const; }; @@ -31,16 +31,16 @@ class PrivateEnvironment : public Cell { JS_CELL(PrivateEnvironment, Cell); public: - PrivateName resolve_private_identifier(FlyString const& identifier) const; + PrivateName resolve_private_identifier(DeprecatedFlyString const& identifier) const; - void add_private_name(Badge, FlyString description); + void add_private_name(Badge, DeprecatedFlyString description); private: explicit PrivateEnvironment(PrivateEnvironment* parent); virtual void visit_edges(Visitor&) override; - auto find_private_name(FlyString const& description) const + auto find_private_name(DeprecatedFlyString const& description) const { return m_private_names.find_if([&](PrivateName const& private_name) { return private_name.description == description; diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index 34cd41f4fe4..e88bbb1e90d 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -61,18 +61,18 @@ public: PropertyKey(char const* chars) : m_type(Type::String) - , m_string(FlyString(chars)) + , m_string(DeprecatedFlyString(chars)) { } PropertyKey(DeprecatedString const& string) : m_type(Type::String) - , m_string(FlyString(string)) + , m_string(DeprecatedFlyString(string)) { VERIFY(!m_string.is_null()); } - PropertyKey(FlyString string, StringMayBeNumber string_may_be_number = StringMayBeNumber::Yes) + PropertyKey(DeprecatedFlyString string, StringMayBeNumber string_may_be_number = StringMayBeNumber::Yes) : m_string_may_be_number(string_may_be_number == StringMayBeNumber::Yes) , m_type(Type::String) , m_string(move(string)) @@ -152,7 +152,7 @@ public: return m_number; } - FlyString const& as_string() const + DeprecatedFlyString const& as_string() const { VERIFY(is_string()); return m_string; @@ -186,7 +186,7 @@ private: bool m_string_may_be_number { true }; Type m_type { Type::Invalid }; u32 m_number { 0 }; - FlyString m_string; + DeprecatedFlyString m_string; Handle m_symbol; }; diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index 5d883a1c924..a71a76d8a35 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -832,7 +832,7 @@ void ProxyObject::visit_edges(Cell::Visitor& visitor) visitor.visit(&m_handler); } -FlyString const& ProxyObject::name() const +DeprecatedFlyString const& ProxyObject::name() const { VERIFY(is_function()); return static_cast(m_target).name(); diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h index 7aa955e26d8..7d5cba3346f 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h @@ -20,7 +20,7 @@ public: virtual ~ProxyObject() override = default; - virtual FlyString const& name() const override; + virtual DeprecatedFlyString const& name() const override; virtual bool has_constructor() const override; Object const& target() const { return m_target; } diff --git a/Userland/Libraries/LibJS/Runtime/Reference.cpp b/Userland/Libraries/LibJS/Runtime/Reference.cpp index 21af7d06b45..06a16337a21 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.cpp +++ b/Userland/Libraries/LibJS/Runtime/Reference.cpp @@ -239,7 +239,7 @@ ThrowCompletionOr Reference::initialize_referenced_binding(VM& vm, Value v } // 6.2.4.9 MakePrivateReference ( baseValue, privateIdentifier ), https://tc39.es/ecma262/#sec-makeprivatereference -Reference make_private_reference(VM& vm, Value base_value, FlyString const& private_identifier) +Reference make_private_reference(VM& vm, Value base_value, DeprecatedFlyString const& private_identifier) { // 1. Let privEnv be the running execution context's PrivateEnvironment. auto* private_environment = vm.running_execution_context().private_environment; diff --git a/Userland/Libraries/LibJS/Runtime/Reference.h b/Userland/Libraries/LibJS/Runtime/Reference.h index 10c19fc04b6..f0d716b2963 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.h +++ b/Userland/Libraries/LibJS/Runtime/Reference.h @@ -14,7 +14,7 @@ namespace JS { -Reference make_private_reference(VM&, Value base_value, FlyString const& private_identifier); +Reference make_private_reference(VM&, Value base_value, DeprecatedFlyString const& private_identifier); class Reference { public: @@ -47,7 +47,7 @@ public: } } - Reference(Environment& base, FlyString referenced_name, bool strict = false, Optional environment_coordinate = {}) + Reference(Environment& base, DeprecatedFlyString referenced_name, bool strict = false, Optional environment_coordinate = {}) : m_base_type(BaseType::Environment) , m_base_environment(&base) , m_name(move(referenced_name)) diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 0b056697d32..e1dd4cb73bb 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -95,7 +95,7 @@ static Value get_match_index_par(VM& vm, Utf16View const& string, Match const& m } // 22.2.5.2.8 MakeMatchIndicesIndexPairArray ( S, indices, groupNames, hasGroups ), https://tc39.es/ecma262/#sec-makematchindicesindexpairarray -static Value make_match_indices_index_pair_array(VM& vm, Utf16View const& string, Vector> const& indices, HashMap const& group_names, bool has_groups) +static Value make_match_indices_index_pair_array(VM& vm, Utf16View const& string, Vector> const& indices, HashMap const& group_names, bool has_groups) { // Note: This implementation differs from the spec, but has the same behavior. // @@ -268,7 +268,7 @@ static ThrowCompletionOr regexp_builtin_exec(VM& vm, RegExpObject& regexp Vector captured_values; // 25. Let groupNames be a new empty List. - HashMap group_names; + HashMap group_names; // 26. Add match as the last element of indices. indices.append(move(match_indices)); diff --git a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h index 1da6be44df4..c58076d0819 100644 --- a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -18,16 +18,16 @@ public: StringOrSymbol() = default; StringOrSymbol(char const* chars) - : StringOrSymbol(FlyString(chars)) + : StringOrSymbol(DeprecatedFlyString(chars)) { } StringOrSymbol(DeprecatedString const& string) - : StringOrSymbol(FlyString(string)) + : StringOrSymbol(DeprecatedFlyString(string)) { } - StringOrSymbol(FlyString const& string) + StringOrSymbol(DeprecatedFlyString const& string) : m_ptr(string.impl()) { VERIFY(!string.is_null()); @@ -62,10 +62,10 @@ public: ALWAYS_INLINE bool is_symbol() const { return is_valid() && (bits() & 1ul); } ALWAYS_INLINE bool is_string() const { return is_valid() && !(bits() & 1ul); } - ALWAYS_INLINE FlyString as_string() const + ALWAYS_INLINE DeprecatedFlyString as_string() const { VERIFY(is_string()); - return FlyString::from_fly_impl(as_string_impl()); + return DeprecatedFlyString::from_fly_impl(as_string_impl()); } ALWAYS_INLINE Symbol const* as_symbol() const diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 9ecad32e6df..b1ef270f05d 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -453,7 +453,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor) { \ } \ \ - FlyString const& ClassName::element_name() const \ + DeprecatedFlyString const& ClassName::element_name() const \ { \ return vm().names.ClassName.as_string(); \ } \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index d4701df3ee9..7096bfc019f 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -47,7 +47,7 @@ public: void set_viewed_array_buffer(ArrayBuffer* array_buffer) { m_viewed_array_buffer = array_buffer; } virtual size_t element_size() const = 0; - virtual FlyString const& element_name() const = 0; + virtual DeprecatedFlyString const& element_name() const = 0; // 25.1.2.6 IsUnclampedIntegerElementType ( type ), https://tc39.es/ecma262/#sec-isunclampedintegerelementtype virtual bool is_unclamped_integer_element_type() const = 0; @@ -470,7 +470,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu static ThrowCompletionOr> create(Realm&, u32 length, FunctionObject& new_target); \ static ThrowCompletionOr> create(Realm&, u32 length); \ static NonnullGCPtr create(Realm&, u32 length, ArrayBuffer& buffer); \ - virtual FlyString const& element_name() const override; \ + virtual DeprecatedFlyString const& element_name() const override; \ \ protected: \ ClassName(Object& prototype, u32 length, ArrayBuffer& array_buffer); \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp index 4e0bf473767..14748455d06 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp @@ -11,7 +11,7 @@ namespace JS { -TypedArrayConstructor::TypedArrayConstructor(FlyString const& name, Object& prototype) +TypedArrayConstructor::TypedArrayConstructor(DeprecatedFlyString const& name, Object& prototype) : NativeFunction(name, prototype) { } diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h index c4c66209e4e..3d9ae5a08e7 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h @@ -22,7 +22,7 @@ public: virtual ThrowCompletionOr> construct(FunctionObject& new_target) override; protected: - TypedArrayConstructor(FlyString const& name, Object& prototype); + TypedArrayConstructor(DeprecatedFlyString const& name, Object& prototype); private: virtual bool has_constructor() const override { return true; } diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index c325456d64c..836c9bfb883 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -231,7 +231,7 @@ void VM::gather_roots(HashTable& roots) roots.set(finalization_registry); } -ThrowCompletionOr VM::named_evaluation_if_anonymous_function(ASTNode const& expression, FlyString const& name) +ThrowCompletionOr VM::named_evaluation_if_anonymous_function(ASTNode const& expression, DeprecatedFlyString const& name) { // 8.3.3 Static Semantics: IsAnonymousFunctionDefinition ( expr ), https://tc39.es/ecma262/#sec-isanonymousfunctiondefinition // And 8.3.5 Runtime Semantics: NamedEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-namedevaluation @@ -260,7 +260,7 @@ ThrowCompletionOr VM::destructuring_assignment_evaluation(NonnullRefPtr VM::binding_initialization(FlyString const& target, Value value, Environment* environment) +ThrowCompletionOr VM::binding_initialization(DeprecatedFlyString const& target, Value value, Environment* environment) { // 1. Let name be StringValue of Identifier. // 2. Return ? InitializeBoundName(name, value, environment). @@ -541,7 +541,7 @@ ThrowCompletionOr VM::iterator_binding_initialization(BindingPattern const } // 9.1.2.1 GetIdentifierReference ( env, name, strict ), https://tc39.es/ecma262/#sec-getidentifierreference -ThrowCompletionOr VM::get_identifier_reference(Environment* environment, FlyString name, bool strict, size_t hops) +ThrowCompletionOr VM::get_identifier_reference(Environment* environment, DeprecatedFlyString name, bool strict, size_t hops) { // 1. If env is the value null, then if (!environment) { @@ -575,7 +575,7 @@ ThrowCompletionOr VM::get_identifier_reference(Environment* environme } // 9.4.2 ResolveBinding ( name [ , env ] ), https://tc39.es/ecma262/#sec-resolvebinding -ThrowCompletionOr VM::resolve_binding(FlyString const& name, Environment* environment) +ThrowCompletionOr VM::resolve_binding(DeprecatedFlyString const& name, Environment* environment) { // 1. If env is not present or if env is undefined, then if (!environment) { diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index e22a90f649d..7ff9087d10d 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -175,8 +175,8 @@ public: u32 execution_generation() const { return m_execution_generation; } void finish_execution_generation() { ++m_execution_generation; } - ThrowCompletionOr resolve_binding(FlyString const&, Environment* = nullptr); - ThrowCompletionOr get_identifier_reference(Environment*, FlyString, bool strict, size_t hops = 0); + ThrowCompletionOr resolve_binding(DeprecatedFlyString const&, Environment* = nullptr); + ThrowCompletionOr get_identifier_reference(Environment*, DeprecatedFlyString, bool strict, size_t hops = 0); // 5.2.3.2 Throw an Exception, https://tc39.es/ecma262/#sec-throw-an-exception template @@ -213,10 +213,10 @@ public: CustomData* custom_data() { return m_custom_data; } ThrowCompletionOr destructuring_assignment_evaluation(NonnullRefPtr const& target, Value value); - ThrowCompletionOr binding_initialization(FlyString const& target, Value value, Environment* environment); + ThrowCompletionOr binding_initialization(DeprecatedFlyString const& target, Value value, Environment* environment); ThrowCompletionOr binding_initialization(NonnullRefPtr const& target, Value value, Environment* environment); - ThrowCompletionOr named_evaluation_if_anonymous_function(ASTNode const& expression, FlyString const& name); + ThrowCompletionOr named_evaluation_if_anonymous_function(ASTNode const& expression, DeprecatedFlyString const& name); void save_execution_context_stack(); void restore_execution_context_stack(); diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h index 555835327d9..9d8e67bb636 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h @@ -22,7 +22,7 @@ public: virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; // FIXME: Remove this (and stop inventing random internal slots that shouldn't exist, jeez) - virtual FlyString const& name() const override { return m_wrapped_target_function.name(); } + virtual DeprecatedFlyString const& name() const override { return m_wrapped_target_function.name(); } virtual Realm* realm() const override { return &m_realm; } diff --git a/Userland/Libraries/LibJS/SourceTextModule.cpp b/Userland/Libraries/LibJS/SourceTextModule.cpp index ca4c2c8d2dc..2664002911f 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.cpp +++ b/Userland/Libraries/LibJS/SourceTextModule.cpp @@ -260,7 +260,7 @@ Result, Vector> SourceTextModule::pa } // 16.2.1.6.2 GetExportedNames ( [ exportStarSet ] ), https://tc39.es/ecma262/#sec-getexportednames -ThrowCompletionOr> SourceTextModule::get_exported_names(VM& vm, Vector export_star_set) +ThrowCompletionOr> SourceTextModule::get_exported_names(VM& vm, Vector export_star_set) { dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] get_export_names of {}", filename()); // 1. If exportStarSet is not present, set exportStarSet to a new empty List. @@ -272,14 +272,14 @@ ThrowCompletionOr> SourceTextModule::get_exported_names(VM& vm // FIXME: How do we check that? // b. Return a new empty List. - return Vector {}; + return Vector {}; } // 3. Append module to exportStarSet. export_star_set.append(this); // 4. Let exportedNames be a new empty List. - Vector exported_names; + Vector exported_names; // 5. For each ExportEntry Record e of module.[[LocalExportEntries]], do for (auto& entry : m_local_export_entries) { @@ -432,7 +432,7 @@ ThrowCompletionOr SourceTextModule::initialize_environment(VM& vm) // Note: We just loop through them in step 21. // 20. Let declaredVarNames be a new empty List. - Vector declared_var_names; + Vector declared_var_names; // 21. For each element d of varDeclarations, do // a. For each element dn of the BoundNames of d, do @@ -459,7 +459,7 @@ ThrowCompletionOr SourceTextModule::initialize_environment(VM& vm) // 24. For each element d of lexDeclarations, do m_ecmascript_code->for_each_lexically_scoped_declaration([&](Declaration const& declaration) { // a. For each element dn of the BoundNames of d, do - declaration.for_each_bound_name([&](FlyString const& name) { + declaration.for_each_bound_name([&](DeprecatedFlyString const& name) { // i. If IsConstantDeclaration of d is true, then if (declaration.is_constant_declaration()) { // 1. Perform ! env.CreateImmutableBinding(dn, true). @@ -479,7 +479,7 @@ ThrowCompletionOr SourceTextModule::initialize_environment(VM& vm) // 1. Let fo be InstantiateFunctionObject of d with arguments env and privateEnv. // NOTE: Special case if the function is a default export of an anonymous function // it has name "*default*" but internally should have name "default". - FlyString function_name = function_declaration.name(); + DeprecatedFlyString function_name = function_declaration.name(); if (function_name == ExportStatement::local_name_for_default) function_name = "default"sv; auto function = ECMAScriptFunctionObject::create(realm(), function_name, function_declaration.source_text(), function_declaration.body(), function_declaration.parameters(), function_declaration.function_length(), environment, private_environment, function_declaration.kind(), function_declaration.is_strict_mode(), function_declaration.might_need_arguments_object(), function_declaration.contains_direct_call_to_eval()); @@ -518,7 +518,7 @@ ThrowCompletionOr SourceTextModule::initialize_environment(VM& vm) } // 16.2.1.6.3 ResolveExport ( exportName [ , resolveSet ] ), https://tc39.es/ecma262/#sec-resolveexport -ThrowCompletionOr SourceTextModule::resolve_export(VM& vm, FlyString const& export_name, Vector resolve_set) +ThrowCompletionOr SourceTextModule::resolve_export(VM& vm, DeprecatedFlyString const& export_name, Vector resolve_set) { // 1. If resolveSet is not present, set resolveSet to a new empty List. // Note: This is done by the default argument. diff --git a/Userland/Libraries/LibJS/SourceTextModule.h b/Userland/Libraries/LibJS/SourceTextModule.h index a6720412801..28dea01f9b7 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.h +++ b/Userland/Libraries/LibJS/SourceTextModule.h @@ -22,8 +22,8 @@ public: Program const& parse_node() const { return *m_ecmascript_code; } - virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set) override; - virtual ThrowCompletionOr resolve_export(VM& vm, FlyString const& export_name, Vector resolve_set = {}) override; + virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set) override; + virtual ThrowCompletionOr resolve_export(VM& vm, DeprecatedFlyString const& export_name, Vector resolve_set = {}) override; Object* import_meta() { return m_import_meta; } void set_import_meta(Badge, Object* import_meta) { m_import_meta = import_meta; } diff --git a/Userland/Libraries/LibJS/SyntheticModule.cpp b/Userland/Libraries/LibJS/SyntheticModule.cpp index eb0fdbfeaaf..7e94f5a8a61 100644 --- a/Userland/Libraries/LibJS/SyntheticModule.cpp +++ b/Userland/Libraries/LibJS/SyntheticModule.cpp @@ -14,7 +14,7 @@ namespace JS { // 1.2.1 CreateSyntheticModule ( exportNames, evaluationSteps, realm, hostDefined ), https://tc39.es/proposal-json-modules/#sec-createsyntheticmodule -SyntheticModule::SyntheticModule(Vector export_names, SyntheticModule::EvaluationFunction evaluation_steps, Realm& realm, StringView filename) +SyntheticModule::SyntheticModule(Vector export_names, SyntheticModule::EvaluationFunction evaluation_steps, Realm& realm, StringView filename) : Module(realm, filename) , m_export_names(move(export_names)) , m_evaluation_steps(move(evaluation_steps)) @@ -23,14 +23,14 @@ SyntheticModule::SyntheticModule(Vector export_names, SyntheticModule } // 1.2.3.1 GetExportedNames( exportStarSet ), https://tc39.es/proposal-json-modules/#sec-smr-getexportednames -ThrowCompletionOr> SyntheticModule::get_exported_names(VM&, Vector) +ThrowCompletionOr> SyntheticModule::get_exported_names(VM&, Vector) { // 1. Return module.[[ExportNames]]. return m_export_names; } // 1.2.3.2 ResolveExport( exportName, resolveSet ), https://tc39.es/proposal-json-modules/#sec-smr-resolveexport -ThrowCompletionOr SyntheticModule::resolve_export(VM&, FlyString const& export_name, Vector) +ThrowCompletionOr SyntheticModule::resolve_export(VM&, DeprecatedFlyString const& export_name, Vector) { // 1. If module.[[ExportNames]] does not contain exportName, return null. if (!m_export_names.contains_slow(export_name)) @@ -119,7 +119,7 @@ ThrowCompletionOr SyntheticModule::evaluate(VM& vm) } // 1.2.2 SetSyntheticModuleExport ( module, exportName, exportValue ), https://tc39.es/proposal-json-modules/#sec-setsyntheticmoduleexport -ThrowCompletionOr SyntheticModule::set_synthetic_module_export(FlyString const& export_name, Value export_value) +ThrowCompletionOr SyntheticModule::set_synthetic_module_export(DeprecatedFlyString const& export_name, Value export_value) { auto& vm = this->realm().vm(); @@ -139,7 +139,7 @@ NonnullGCPtr SyntheticModule::create_default_export_synthetic_m }; // 2. Return CreateSyntheticModule("default", closure, realm) - return realm.heap().allocate_without_realm(Vector { "default" }, move(closure), realm, filename); + return realm.heap().allocate_without_realm(Vector { "default" }, move(closure), realm, filename); } // 1.4 ParseJSONModule ( source ), https://tc39.es/proposal-json-modules/#sec-parse-json-module diff --git a/Userland/Libraries/LibJS/SyntheticModule.h b/Userland/Libraries/LibJS/SyntheticModule.h index 94e5b8be3a5..18f4ea20842 100644 --- a/Userland/Libraries/LibJS/SyntheticModule.h +++ b/Userland/Libraries/LibJS/SyntheticModule.h @@ -19,18 +19,18 @@ public: static NonnullGCPtr create_default_export_synthetic_module(Value default_export, Realm& realm, StringView filename); - ThrowCompletionOr set_synthetic_module_export(FlyString const& export_name, Value export_value); + ThrowCompletionOr set_synthetic_module_export(DeprecatedFlyString const& export_name, Value export_value); virtual ThrowCompletionOr link(VM& vm) override; virtual ThrowCompletionOr evaluate(VM& vm) override; - virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set) override; - virtual ThrowCompletionOr resolve_export(VM& vm, FlyString const& export_name, Vector resolve_set) override; + virtual ThrowCompletionOr> get_exported_names(VM& vm, Vector export_star_set) override; + virtual ThrowCompletionOr resolve_export(VM& vm, DeprecatedFlyString const& export_name, Vector resolve_set) override; private: - SyntheticModule(Vector export_names, EvaluationFunction evaluation_steps, Realm& realm, StringView filename); + SyntheticModule(Vector export_names, EvaluationFunction evaluation_steps, Realm& realm, StringView filename); - Vector m_export_names; // [[ExportNames]] - EvaluationFunction m_evaluation_steps; // [[EvaluationSteps]] + Vector m_export_names; // [[ExportNames]] + EvaluationFunction m_evaluation_steps; // [[EvaluationSteps]] }; ThrowCompletionOr> parse_json_module(StringView source_text, Realm& realm, StringView filename); diff --git a/Userland/Libraries/LibJS/Token.h b/Userland/Libraries/LibJS/Token.h index aa2f8083e56..9ebc6c2f233 100644 --- a/Userland/Libraries/LibJS/Token.h +++ b/Userland/Libraries/LibJS/Token.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include #include @@ -207,16 +207,16 @@ public: { return m_value.visit( [](StringView view) { return view; }, - [](FlyString const& identifier) { return identifier.view(); }, + [](DeprecatedFlyString const& identifier) { return identifier.view(); }, [](Empty) -> StringView { VERIFY_NOT_REACHED(); }); } - FlyString flystring_value() const + DeprecatedFlyString DeprecatedFlyString_value() const { return m_value.visit( - [](StringView view) -> FlyString { return view; }, - [](FlyString const& identifier) -> FlyString { return identifier; }, - [](Empty) -> FlyString { VERIFY_NOT_REACHED(); }); + [](StringView view) -> DeprecatedFlyString { return view; }, + [](DeprecatedFlyString const& identifier) -> DeprecatedFlyString { return identifier; }, + [](Empty) -> DeprecatedFlyString { VERIFY_NOT_REACHED(); }); } StringView filename() const { return m_filename; } @@ -236,7 +236,7 @@ public: DeprecatedString string_value(StringValueStatus& status) const; DeprecatedString raw_template_value() const; - void set_identifier_value(FlyString value) + void set_identifier_value(DeprecatedFlyString value) { m_value = move(value); } @@ -249,7 +249,7 @@ private: DeprecatedString m_message; StringView m_trivia; StringView m_original_value; - Variant m_value {}; + Variant m_value {}; StringView m_filename; size_t m_line_number { 0 }; size_t m_line_column { 0 }; diff --git a/Userland/Libraries/LibPDF/ColorSpace.cpp b/Userland/Libraries/LibPDF/ColorSpace.cpp index 47ffbf181c1..5fbdfddb5d1 100644 --- a/Userland/Libraries/LibPDF/ColorSpace.cpp +++ b/Userland/Libraries/LibPDF/ColorSpace.cpp @@ -16,7 +16,7 @@ namespace PDF { ENUMERATE_COLOR_SPACE_FAMILIES(ENUMERATE); #undef ENUMERATE -PDFErrorOr ColorSpaceFamily::get(FlyString const& family_name) +PDFErrorOr ColorSpaceFamily::get(DeprecatedFlyString const& family_name) { #define ENUMERATE(f_name, ever_needs_parameters) \ if (family_name == f_name.name()) { \ @@ -27,7 +27,7 @@ PDFErrorOr ColorSpaceFamily::get(FlyString const& family_name) return Error(Error::Type::MalformedPDF, DeprecatedString::formatted("Unknown ColorSpace family {}", family_name)); } -PDFErrorOr> ColorSpace::create(FlyString const& name) +PDFErrorOr> ColorSpace::create(DeprecatedFlyString const& name) { // Simple color spaces with no parameters, which can be specified directly if (name == CommonNames::DeviceGray) @@ -305,7 +305,7 @@ PDFErrorOr> ICCBasedColorSpace::create(Document* docum auto dict = param.get>()->cast()->dict(); - FlyString name; + DeprecatedFlyString name; if (!dict->contains(CommonNames::Alternate)) { auto number_of_components = dict->get_value(CommonNames::N).to_int(); if (number_of_components == 1) diff --git a/Userland/Libraries/LibPDF/ColorSpace.h b/Userland/Libraries/LibPDF/ColorSpace.h index 9ff28aa0f1d..bbffb3db577 100644 --- a/Userland/Libraries/LibPDF/ColorSpace.h +++ b/Userland/Libraries/LibPDF/ColorSpace.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -28,28 +28,28 @@ namespace PDF { class ColorSpaceFamily { public: - ColorSpaceFamily(FlyString name, bool never_needs_paramaters_p) + ColorSpaceFamily(DeprecatedFlyString name, bool never_needs_paramaters_p) : m_name(move(name)) , m_never_needs_parameters(never_needs_paramaters_p) { } - FlyString name() const { return m_name; }; + DeprecatedFlyString name() const { return m_name; }; bool never_needs_parameters() const { return m_never_needs_parameters; }; - static PDFErrorOr get(FlyString const&); + static PDFErrorOr get(DeprecatedFlyString const&); #define ENUMERATE(name, ever_needs_parameters) static ColorSpaceFamily name; ENUMERATE_COLOR_SPACE_FAMILIES(ENUMERATE) #undef ENUMERATE private: - FlyString m_name; + DeprecatedFlyString m_name; bool m_never_needs_parameters; }; class ColorSpace : public RefCounted { public: - static PDFErrorOr> create(FlyString const&); + static PDFErrorOr> create(DeprecatedFlyString const&); static PDFErrorOr> create(Document*, NonnullRefPtr); virtual ~ColorSpace() = default; diff --git a/Userland/Libraries/LibPDF/CommonNames.cpp b/Userland/Libraries/LibPDF/CommonNames.cpp index 015f9ac932e..f0ac03a0ca5 100644 --- a/Userland/Libraries/LibPDF/CommonNames.cpp +++ b/Userland/Libraries/LibPDF/CommonNames.cpp @@ -8,10 +8,10 @@ namespace PDF { -#define ENUMERATE(name) FlyString CommonNames::name = #name; +#define ENUMERATE(name) DeprecatedFlyString CommonNames::name = #name; ENUMERATE_COMMON_NAMES(ENUMERATE) #undef ENUMERATE -FlyString CommonNames::IdentityH = "Identity-H"; +DeprecatedFlyString CommonNames::IdentityH = "Identity-H"; } diff --git a/Userland/Libraries/LibPDF/CommonNames.h b/Userland/Libraries/LibPDF/CommonNames.h index a3832ba2b3f..907f3ff5245 100644 --- a/Userland/Libraries/LibPDF/CommonNames.h +++ b/Userland/Libraries/LibPDF/CommonNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #define ENUMERATE_COMMON_NAMES(A) \ A(AIS) \ @@ -150,11 +150,11 @@ namespace PDF { class CommonNames { public: -#define ENUMERATE(name) static FlyString name; +#define ENUMERATE(name) static DeprecatedFlyString name; ENUMERATE_COMMON_NAMES(ENUMERATE) #undef ENUMERATE - static FlyString IdentityH; + static DeprecatedFlyString IdentityH; }; } diff --git a/Userland/Libraries/LibPDF/Document.cpp b/Userland/Libraries/LibPDF/Document.cpp index 6097122ffcc..02112b2ed05 100644 --- a/Userland/Libraries/LibPDF/Document.cpp +++ b/Userland/Libraries/LibPDF/Document.cpp @@ -199,7 +199,7 @@ PDFErrorOr Document::add_page_tree_node_to_page_tree(NonnullRefPtr> Document::find_in_name_tree(NonnullRefPtr tree, FlyString name) +PDFErrorOr> Document::find_in_name_tree(NonnullRefPtr tree, DeprecatedFlyString name) { if (tree->contains(CommonNames::Kids)) { return find_in_name_tree_nodes(tree->get_array(CommonNames::Kids), name); @@ -210,7 +210,7 @@ PDFErrorOr> Document::find_in_name_tree(NonnullRefPtr> Document::find_in_name_tree_nodes(NonnullRefPtr siblings, FlyString name) +PDFErrorOr> Document::find_in_name_tree_nodes(NonnullRefPtr siblings, DeprecatedFlyString name) { for (size_t i = 0; i < siblings->size(); i++) { auto sibling = TRY(resolve_to(siblings->at(i))); @@ -226,7 +226,7 @@ PDFErrorOr> Document::find_in_name_tree_nodes(NonnullRefPt return Error { Error::Type::MalformedPDF, DeprecatedString::formatted("Didn't find node in name tree containing name {}", name) }; } -PDFErrorOr> Document::find_in_key_value_array(NonnullRefPtr key_value_array, FlyString name) +PDFErrorOr> Document::find_in_key_value_array(NonnullRefPtr key_value_array, DeprecatedFlyString name) { if (key_value_array->size() % 2 == 1) return Error { Error::Type::MalformedPDF, "key/value array has dangling key" }; @@ -306,7 +306,7 @@ PDFErrorOr Document::create_destination_from_parameters(NonnullRefP return Destination { type, page_number_by_index_ref.get(page_ref.as_ref_index()), parameters }; } -PDFErrorOr> Document::get_inheritable_object(FlyString const& name, NonnullRefPtr object) +PDFErrorOr> Document::get_inheritable_object(DeprecatedFlyString const& name, NonnullRefPtr object) { if (!object->contains(name)) { auto parent = TRY(object->get_dict(this, CommonNames::Parent)); @@ -352,7 +352,7 @@ PDFErrorOr> Document::build_outline_item(NonnullRefPt auto dest_arr = dest_obj->cast(); outline_item->dest = TRY(create_destination_from_parameters(dest_arr, page_number_by_index_ref)); } else if (dest_obj->is() || dest_obj->is()) { - FlyString dest_name; + DeprecatedFlyString dest_name; if (dest_obj->is()) dest_name = dest_obj->cast()->name(); else diff --git a/Userland/Libraries/LibPDF/Document.h b/Userland/Libraries/LibPDF/Document.h index 2074af94558..85a64baa00b 100644 --- a/Userland/Libraries/LibPDF/Document.h +++ b/Userland/Libraries/LibPDF/Document.h @@ -138,11 +138,11 @@ private: PDFErrorOr create_destination_from_parameters(NonnullRefPtr, HashMap const&); PDFErrorOr create_destination_from_dictionary_entry(NonnullRefPtr const& entry, HashMap const& page_number_by_index_ref); - PDFErrorOr> get_inheritable_object(FlyString const& name, NonnullRefPtr); + PDFErrorOr> get_inheritable_object(DeprecatedFlyString const& name, NonnullRefPtr); - PDFErrorOr> find_in_name_tree(NonnullRefPtr root, FlyString name); - PDFErrorOr> find_in_name_tree_nodes(NonnullRefPtr siblings, FlyString name); - PDFErrorOr> find_in_key_value_array(NonnullRefPtr key_value_array, FlyString name); + PDFErrorOr> find_in_name_tree(NonnullRefPtr root, DeprecatedFlyString name); + PDFErrorOr> find_in_name_tree_nodes(NonnullRefPtr siblings, DeprecatedFlyString name); + PDFErrorOr> find_in_key_value_array(NonnullRefPtr key_value_array, DeprecatedFlyString name); NonnullRefPtr m_parser; RefPtr m_catalog; diff --git a/Userland/Libraries/LibPDF/Filter.cpp b/Userland/Libraries/LibPDF/Filter.cpp index 626cb1caa83..8898e010eb2 100644 --- a/Userland/Libraries/LibPDF/Filter.cpp +++ b/Userland/Libraries/LibPDF/Filter.cpp @@ -12,7 +12,7 @@ namespace PDF { -ErrorOr Filter::decode(ReadonlyBytes bytes, FlyString const& encoding_type, RefPtr decode_parms) +ErrorOr Filter::decode(ReadonlyBytes bytes, DeprecatedFlyString const& encoding_type, RefPtr decode_parms) { int predictor = 1; int columns = 1; diff --git a/Userland/Libraries/LibPDF/Filter.h b/Userland/Libraries/LibPDF/Filter.h index dd68eb36e64..e3d37705f0d 100644 --- a/Userland/Libraries/LibPDF/Filter.h +++ b/Userland/Libraries/LibPDF/Filter.h @@ -7,15 +7,15 @@ #pragma once #include +#include #include -#include #include namespace PDF { class Filter { public: - static ErrorOr decode(ReadonlyBytes bytes, FlyString const& encoding_type, RefPtr decode_parms); + static ErrorOr decode(ReadonlyBytes bytes, DeprecatedFlyString const& encoding_type, RefPtr decode_parms); private: static ErrorOr decode_ascii_hex(ReadonlyBytes bytes); diff --git a/Userland/Libraries/LibPDF/Fonts/PDFFont.cpp b/Userland/Libraries/LibPDF/Fonts/PDFFont.cpp index ab05e95904d..3be8446a7b1 100644 --- a/Userland/Libraries/LibPDF/Fonts/PDFFont.cpp +++ b/Userland/Libraries/LibPDF/Fonts/PDFFont.cpp @@ -14,7 +14,7 @@ namespace PDF { -static bool is_standard_latin_font(FlyString const& font) +static bool is_standard_latin_font(DeprecatedFlyString const& font) { return font.is_one_of( "Times-Roman", "TimesNewRoman", diff --git a/Userland/Libraries/LibPDF/Object.h b/Userland/Libraries/LibPDF/Object.h index 0b3237e4a79..e64458fa8fc 100644 --- a/Userland/Libraries/LibPDF/Object.h +++ b/Userland/Libraries/LibPDF/Object.h @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp index c86f59c2e48..7d59deaf57f 100644 --- a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp +++ b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp @@ -15,33 +15,33 @@ PDFErrorOr> ArrayObject::get_object_at(Document* document, return document->resolve_to(at(index)); } -PDFErrorOr> DictObject::get_object(Document* document, FlyString const& key) const +PDFErrorOr> DictObject::get_object(Document* document, DeprecatedFlyString const& key) const { return document->resolve_to(get_value(key)); } -#define DEFINE_ACCESSORS(class_name, snake_name) \ - PDFErrorOr> ArrayObject::get_##snake_name##_at(Document* document, size_t index) const \ - { \ - if (index >= m_elements.size()) \ - return Error { Error::Type::Internal, "Out of bounds array access" }; \ - return document->resolve_to(m_elements[index]); \ - } \ - \ - NonnullRefPtr ArrayObject::get_##snake_name##_at(size_t index) const \ - { \ - VERIFY(index < m_elements.size()); \ - return cast_to(m_elements[index]); \ - } \ - \ - PDFErrorOr> DictObject::get_##snake_name(Document* document, FlyString const& key) const \ - { \ - return document->resolve_to(get_value(key)); \ - } \ - \ - NonnullRefPtr DictObject::get_##snake_name(FlyString const& key) const \ - { \ - return cast_to(get_value(key)); \ +#define DEFINE_ACCESSORS(class_name, snake_name) \ + PDFErrorOr> ArrayObject::get_##snake_name##_at(Document* document, size_t index) const \ + { \ + if (index >= m_elements.size()) \ + return Error { Error::Type::Internal, "Out of bounds array access" }; \ + return document->resolve_to(m_elements[index]); \ + } \ + \ + NonnullRefPtr ArrayObject::get_##snake_name##_at(size_t index) const \ + { \ + VERIFY(index < m_elements.size()); \ + return cast_to(m_elements[index]); \ + } \ + \ + PDFErrorOr> DictObject::get_##snake_name(Document* document, DeprecatedFlyString const& key) const \ + { \ + return document->resolve_to(get_value(key)); \ + } \ + \ + NonnullRefPtr DictObject::get_##snake_name(DeprecatedFlyString const& key) const \ + { \ + return cast_to(get_value(key)); \ } ENUMERATE_OBJECT_TYPES(DEFINE_ACCESSORS) diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.h b/Userland/Libraries/LibPDF/ObjectDerivatives.h index 1078c7c9170..2cc5263f419 100644 --- a/Userland/Libraries/LibPDF/ObjectDerivatives.h +++ b/Userland/Libraries/LibPDF/ObjectDerivatives.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -44,14 +44,14 @@ private: class NameObject final : public Object { public: - explicit NameObject(FlyString name) + explicit NameObject(DeprecatedFlyString name) : m_name(move(name)) { } ~NameObject() override = default; - [[nodiscard]] ALWAYS_INLINE FlyString const& name() const { return m_name; } + [[nodiscard]] ALWAYS_INLINE DeprecatedFlyString const& name() const { return m_name; } char const* type_name() const override { return "name"; } DeprecatedString to_deprecated_string(int indent) const override; @@ -60,7 +60,7 @@ protected: bool is_name() const override { return true; } private: - FlyString m_name; + DeprecatedFlyString m_name; }; class ArrayObject final : public Object { @@ -106,14 +106,14 @@ private: class DictObject final : public Object { public: - explicit DictObject(HashMap map) + explicit DictObject(HashMap map) : m_map(move(map)) { } ~DictObject() override = default; - [[nodiscard]] ALWAYS_INLINE HashMap const& map() const { return m_map; } + [[nodiscard]] ALWAYS_INLINE HashMap const& map() const { return m_map; } template bool contains(Args&&... keys) const { return (m_map.contains(keys) && ...); } @@ -121,20 +121,20 @@ public: template bool contains_any_of(Args&&... keys) const { return (m_map.contains(keys) || ...); } - ALWAYS_INLINE Optional get(FlyString const& key) const { return m_map.get(key); } + ALWAYS_INLINE Optional get(DeprecatedFlyString const& key) const { return m_map.get(key); } - Value get_value(FlyString const& key) const + Value get_value(DeprecatedFlyString const& key) const { auto value = get(key); VERIFY(value.has_value()); return value.value(); } - PDFErrorOr> get_object(Document*, FlyString const& key) const; + PDFErrorOr> get_object(Document*, DeprecatedFlyString const& key) const; -#define DEFINE_GETTER(class_name, snake_name) \ - PDFErrorOr> get_##snake_name(Document*, FlyString const& key) const; \ - NonnullRefPtr get_##snake_name(FlyString const& key) const; +#define DEFINE_GETTER(class_name, snake_name) \ + PDFErrorOr> get_##snake_name(Document*, DeprecatedFlyString const& key) const; \ + NonnullRefPtr get_##snake_name(DeprecatedFlyString const& key) const; ENUMERATE_OBJECT_TYPES(DEFINE_GETTER) #undef DEFINE_GETTER @@ -148,7 +148,7 @@ protected: bool is_dict() const override { return true; } private: - HashMap m_map; + HashMap m_map; }; class StreamObject : public Object { diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index ba33e3d17e3..a51f0f8e53a 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -418,7 +418,7 @@ PDFErrorOr> Parser::parse_dict() return error("Expected dict to start with \"<<\""); m_reader.consume_whitespace(); - HashMap map; + HashMap map; while (!m_reader.done()) { if (m_reader.matches(">>")) @@ -479,7 +479,7 @@ PDFErrorOr> Parser::parse_stream(NonnullRefPtrsecurity_handler()->decrypt(stream_object, m_current_reference_stack.last()); if (dict->contains(CommonNames::Filter)) { - Vector filters; + Vector filters; // We may either get a single filter or an array of cascading filters auto filter_object = TRY(dict->get_object(m_document, CommonNames::Filter)); diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp index c41f1ba1243..20716237ffe 100644 --- a/Userland/Libraries/LibPDF/Renderer.cpp +++ b/Userland/Libraries/LibPDF/Renderer.cpp @@ -773,7 +773,7 @@ PDFErrorOr> Renderer::load_image(NonnullRefPtrget_value(CommonNames::Width).get(); auto height = image_dict->get_value(CommonNames::Height).get(); - auto is_filter = [&](FlyString const& name) { + auto is_filter = [&](DeprecatedFlyString const& name) { if (filter_object->is()) return filter_object->cast()->name() == name; auto filters = filter_object->cast(); diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index df05526e8a0..670e06e80d2 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -9,8 +9,8 @@ #include "Forward.h" #include "RegexOptions.h" +#include #include -#include #include #include #include @@ -558,7 +558,7 @@ private: class Match final { private: - Optional string; + Optional string; public: Match() = default; @@ -603,7 +603,7 @@ public: } RegexStringView view {}; - Optional capture_group_name {}; + Optional capture_group_name {}; size_t line { 0 }; size_t column { 0 }; size_t global_offset { 0 }; diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp index e939b4779bf..bc6c2fc7d08 100644 --- a/Userland/Libraries/LibRegex/RegexParser.cpp +++ b/Userland/Libraries/LibRegex/RegexParser.cpp @@ -2427,7 +2427,7 @@ bool ECMA262Parser::parse_unicode_property_escape(PropertyEscape& property, bool [](Empty&) -> bool { VERIFY_NOT_REACHED(); }); } -FlyString ECMA262Parser::read_capture_group_specifier(bool take_starting_angle_bracket) +DeprecatedFlyString ECMA262Parser::read_capture_group_specifier(bool take_starting_angle_bracket) { static auto id_start_category = Unicode::property_from_string("ID_Start"sv); static auto id_continue_category = Unicode::property_from_string("ID_Continue"sv); @@ -2530,7 +2530,7 @@ FlyString ECMA262Parser::read_capture_group_specifier(bool take_starting_angle_b builder.append_code_point(code_point); } - FlyString name = builder.build(); + DeprecatedFlyString name = builder.build(); if (!hit_end || name.is_empty()) set_error(Error::InvalidNameForCaptureGroup); diff --git a/Userland/Libraries/LibRegex/RegexParser.h b/Userland/Libraries/LibRegex/RegexParser.h index cfc0db56bf0..8ae30289f4a 100644 --- a/Userland/Libraries/LibRegex/RegexParser.h +++ b/Userland/Libraries/LibRegex/RegexParser.h @@ -53,7 +53,7 @@ public: size_t match_length_minimum; Error error; Token error_token; - Vector capture_groups; + Vector capture_groups; AllOptions options; }; @@ -111,7 +111,7 @@ protected: size_t repetition_mark_count { 0 }; AllOptions regex_options; HashMap capture_group_minimum_lengths; - HashMap named_capture_groups; + HashMap named_capture_groups; explicit ParserState(Lexer& lexer) : lexer(lexer) @@ -234,7 +234,7 @@ private: }; StringView read_digits_as_string(ReadDigitsInitialZeroState initial_zero = ReadDigitsInitialZeroState::Allow, bool hex = false, int max_count = -1, int min_count = -1); Optional read_digits(ReadDigitsInitialZeroState initial_zero = ReadDigitsInitialZeroState::Allow, bool hex = false, int max_count = -1, int min_count = -1); - FlyString read_capture_group_specifier(bool take_starting_angle_bracket = false); + DeprecatedFlyString read_capture_group_specifier(bool take_starting_angle_bracket = false); struct Script { Unicode::Script script {}; diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h index d827be8d02b..325cb32e120 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h @@ -7,8 +7,8 @@ #pragma once #include +#include #include -#include #include #include #include @@ -116,10 +116,10 @@ public: void set_track_uid(u64 track_uid) { m_track_uid = track_uid; } TrackType track_type() const { return m_track_type; } void set_track_type(TrackType track_type) { m_track_type = track_type; } - FlyString language() const { return m_language; } - void set_language(FlyString const& language) { m_language = language; } - FlyString codec_id() const { return m_codec_id; } - void set_codec_id(FlyString const& codec_id) { m_codec_id = codec_id; } + DeprecatedFlyString language() const { return m_language; } + void set_language(DeprecatedFlyString const& language) { m_language = language; } + DeprecatedFlyString codec_id() const { return m_codec_id; } + void set_codec_id(DeprecatedFlyString const& codec_id) { m_codec_id = codec_id; } double timestamp_scale() const { return m_timestamp_scale; } void set_timestamp_scale(double timestamp_scale) { m_timestamp_scale = timestamp_scale; } u64 codec_delay() const { return m_codec_delay; } @@ -145,8 +145,8 @@ private: u64 m_track_number { 0 }; u64 m_track_uid { 0 }; TrackType m_track_type { Invalid }; - FlyString m_language = "eng"; - FlyString m_codec_id; + DeprecatedFlyString m_language = "eng"; + DeprecatedFlyString m_codec_id; double m_timestamp_scale { 1 }; u64 m_codec_delay { 0 }; u64 m_timestamp_offset { 0 }; diff --git a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp index 29856802453..0c6776141e3 100644 --- a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp @@ -302,7 +302,7 @@ JS::Value LegacyPlatformObject::item_value(size_t) const return JS::js_undefined(); } -JS::Value LegacyPlatformObject::named_item_value(FlyString const&) const +JS::Value LegacyPlatformObject::named_item_value(DeprecatedFlyString const&) const { return JS::js_undefined(); } diff --git a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h index b04192c970b..bf8955fb3ca 100644 --- a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h +++ b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.h @@ -29,7 +29,7 @@ public: JS::ThrowCompletionOr> legacy_platform_object_get_own_property_for_set_slot(JS::PropertyKey const&) const; virtual JS::Value item_value(size_t index) const; - virtual JS::Value named_item_value(FlyString const& name) const; + virtual JS::Value named_item_value(DeprecatedFlyString const& name) const; virtual Vector supported_property_names() const; virtual bool is_supported_property_index(u32) const; diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index b8d994e77d9..ae44fe8c33e 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -5,7 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/CSS/FontFace.cpp b/Userland/Libraries/LibWeb/CSS/FontFace.cpp index 4618ccb6955..b4b585258c9 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFace.cpp +++ b/Userland/Libraries/LibWeb/CSS/FontFace.cpp @@ -8,7 +8,7 @@ namespace Web::CSS { -FontFace::FontFace(FlyString font_family, Vector sources, Vector unicode_ranges) +FontFace::FontFace(DeprecatedFlyString font_family, Vector sources, Vector unicode_ranges) : m_font_family(move(font_family)) , m_sources(move(sources)) , m_unicode_ranges(move(unicode_ranges)) diff --git a/Userland/Libraries/LibWeb/CSS/FontFace.h b/Userland/Libraries/LibWeb/CSS/FontFace.h index cbabd7a018f..77cd7f9e8fa 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFace.h +++ b/Userland/Libraries/LibWeb/CSS/FontFace.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -17,19 +17,19 @@ public: struct Source { AK::URL url; // FIXME: Do we need to keep this around, or is it only needed to discard unwanted formats during parsing? - Optional format; + Optional format; }; - FontFace(FlyString font_family, Vector sources, Vector unicode_ranges); + FontFace(DeprecatedFlyString font_family, Vector sources, Vector unicode_ranges); ~FontFace() = default; - FlyString font_family() const { return m_font_family; } + DeprecatedFlyString font_family() const { return m_font_family; } Vector const& sources() const { return m_sources; } Vector const& unicode_ranges() const { return m_unicode_ranges; } // FIXME: font-style, font-weight, font-stretch, font-feature-settings private: - FlyString m_font_family; + DeprecatedFlyString m_font_family; Vector m_sources; Vector m_unicode_ranges; }; diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.h b/Userland/Libraries/LibWeb/CSS/MediaQuery.h index 9ea69ee2eb9..ed31e57aa56 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp index 66977a579ca..f33518add55 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp @@ -10,12 +10,12 @@ namespace Web::CSS { -MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init) +MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init) +MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_media(event_init.media) , m_matches(event_init.matches) diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h index 80fbdbe6c07..8ab1863441f 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h @@ -19,7 +19,7 @@ class MediaQueryListEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(MediaQueryListEvent, DOM::Event); public: - static MediaQueryListEvent* construct_impl(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init = {}); + static MediaQueryListEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init = {}); virtual ~MediaQueryListEvent() override; @@ -27,7 +27,7 @@ public: bool matches() const { return m_matches; } private: - MediaQueryListEvent(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init); + MediaQueryListEvent(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init); DeprecatedString m_media; bool m_matches; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp index 572efe143c8..e38aa497fac 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp @@ -10,7 +10,7 @@ namespace Web::CSS::Parser { -Declaration::Declaration(FlyString name, Vector values, Important important) +Declaration::Declaration(DeprecatedFlyString name, Vector values, Important important) : m_name(move(name)) , m_values(move(values)) , m_important(move(important)) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h index fd0e2e1c77c..35f0dc1a6c9 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h @@ -15,7 +15,7 @@ namespace Web::CSS::Parser { class Declaration { public: - Declaration(FlyString name, Vector values, Important); + Declaration(DeprecatedFlyString name, Vector values, Important); ~Declaration(); StringView name() const { return m_name; } @@ -25,7 +25,7 @@ public: DeprecatedString to_deprecated_string() const; private: - FlyString m_name; + DeprecatedFlyString m_name; Vector m_values; Important m_important { Important::No }; }; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp index fdd15a7359a..8d4a06c1393 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp @@ -10,7 +10,7 @@ namespace Web::CSS::Parser { -Function::Function(FlyString name, Vector&& values) +Function::Function(DeprecatedFlyString name, Vector&& values) : m_name(move(name)) , m_values(move(values)) { diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Function.h b/Userland/Libraries/LibWeb/CSS/Parser/Function.h index f45be687610..6eb161bbc8a 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Function.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Function.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include #include @@ -18,7 +18,7 @@ namespace Web::CSS::Parser { class Function : public RefCounted { public: - static NonnullRefPtr create(FlyString name, Vector&& values) + static NonnullRefPtr create(DeprecatedFlyString name, Vector&& values) { return adopt_ref(*new Function(move(name), move(values))); } @@ -31,9 +31,9 @@ public: DeprecatedString to_deprecated_string() const; private: - Function(FlyString name, Vector&& values); + Function(DeprecatedFlyString name, Vector&& values); - FlyString m_name; + DeprecatedFlyString m_name; Vector m_values; }; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index c45a01eb413..d7397821da7 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -561,7 +561,7 @@ Parser::ParseErrorOr Parser::parse_pseudo_simple_selec return ParseError::SyntaxError; } // FIXME: Support multiple, comma-separated, language ranges. - Vector languages; + Vector languages; languages.append(pseudo_function.values().first().token().to_deprecated_string()); return Selector::SimpleSelector { .type = Selector::SimpleSelector::Type::PseudoClass, @@ -1518,7 +1518,7 @@ NonnullRefPtr Parser::consume_an_at_rule(TokenStream& tokens) // Create a new at-rule with its name set to the value of the current input token, its prelude initially set to an empty list, and its value initially set to nothing. // NOTE: We create the Rule fully initialized when we return it instead. - FlyString at_rule_name = ((Token)name_ident).at_keyword(); + DeprecatedFlyString at_rule_name = ((Token)name_ident).at_keyword(); Vector prelude; RefPtr block; @@ -1801,7 +1801,7 @@ NonnullRefPtr Parser::consume_a_function(TokenStream& tokens) // Create a function with its name equal to the value of the current input token // and with its value initially set to an empty list. // NOTE: We create the Function fully initialized when we return it instead. - FlyString function_name = ((Token)name_ident).function(); + DeprecatedFlyString function_name = ((Token)name_ident).function(); Vector function_values; // Repeatedly consume the next input token and process it as follows: @@ -1856,7 +1856,7 @@ Optional Parser::consume_a_declaration(TokenStream& tokens) // Create a new declaration with its name set to the value of the current input token // and its value initially set to the empty list. // NOTE: We create a fully-initialized Declaration just before returning it instead. - FlyString declaration_name = ((Token)token).ident(); + DeprecatedFlyString declaration_name = ((Token)token).ident(); Vector declaration_values; Important declaration_important = Important::No; @@ -5289,7 +5289,7 @@ CSSRule* Parser::parse_font_face_rule(TokenStream& tokens) { auto declarations_and_at_rules = parse_a_list_of_declarations(tokens); - Optional font_family; + Optional font_family; Vector src; Vector unicode_range; @@ -5412,7 +5412,7 @@ Vector Parser::parse_font_face_src(TokenStream // FIXME: Implement optional tech() function from CSS-Fonts-4. if (auto maybe_url = parse_url_function(first, AllowedDataUrlType::Font); maybe_url.has_value()) { auto url = maybe_url.release_value(); - Optional format; + Optional format; source_tokens.skip_whitespace(); if (!source_tokens.has_next_token()) { diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp index 7b313764495..e9cbfc1d593 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp @@ -10,7 +10,7 @@ namespace Web::CSS::Parser { -Rule::Rule(Rule::Type type, FlyString name, Vector prelude, RefPtr block) +Rule::Rule(Rule::Type type, DeprecatedFlyString name, Vector prelude, RefPtr block) : m_type(type) , m_at_rule_name(move(name)) , m_prelude(move(prelude)) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Rule.h b/Userland/Libraries/LibWeb/CSS/Parser/Rule.h index 7afd9135389..dfc9a7f8954 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Rule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Rule.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include @@ -22,7 +22,7 @@ public: Qualified, }; - static NonnullRefPtr make_at_rule(FlyString name, Vector prelude, RefPtr block) + static NonnullRefPtr make_at_rule(DeprecatedFlyString name, Vector prelude, RefPtr block) { return adopt_ref(*new Rule(Type::At, move(name), move(prelude), move(block))); } @@ -44,10 +44,10 @@ public: DeprecatedString to_deprecated_string() const; private: - Rule(Type, FlyString name, Vector prelude, RefPtr); + Rule(Type, DeprecatedFlyString name, Vector prelude, RefPtr); Type const m_type; - FlyString m_at_rule_name; + DeprecatedFlyString m_at_rule_name; Vector m_prelude; RefPtr m_block; }; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Token.h b/Userland/Libraries/LibWeb/CSS/Parser/Token.h index 93fa0712f31..f1aed4d13bf 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Token.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Token.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include @@ -151,7 +151,7 @@ public: Position const& start_position() const { return m_start_position; } Position const& end_position() const { return m_end_position; } - static Token of_string(FlyString str) + static Token of_string(DeprecatedFlyString str) { Token token; token.m_type = Type::String; @@ -178,7 +178,7 @@ public: private: Type m_type { Type::Invalid }; - FlyString m_value; + DeprecatedFlyString m_value; Number m_number_value; HashType m_hash_type { HashType::Unrestricted }; diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 2dcb26db22b..ac180e5061f 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include #include @@ -121,7 +121,7 @@ public: SelectorList argument_selector_list {}; // Used for :lang(en-gb,dk) - Vector languages {}; + Vector languages {}; }; struct Attribute { @@ -140,20 +140,20 @@ public: CaseInsensitiveMatch, }; MatchType match_type; - FlyString name {}; + DeprecatedFlyString name {}; DeprecatedString value {}; CaseType case_type; }; struct Name { - Name(FlyString n) + Name(DeprecatedFlyString n) : name(move(n)) , lowercase_name(name.to_lowercase()) { } - FlyString name; - FlyString lowercase_name; + DeprecatedFlyString name; + DeprecatedFlyString lowercase_name; }; Type type; @@ -166,10 +166,10 @@ public: PseudoElement const& pseudo_element() const { return value.get(); } PseudoElement& pseudo_element() { return value.get(); } - FlyString const& name() const { return value.get().name; } - FlyString& name() { return value.get().name; } - FlyString const& lowercase_name() const { return value.get().lowercase_name; } - FlyString& lowercase_name() { return value.get().lowercase_name; } + DeprecatedFlyString const& name() const { return value.get().name; } + DeprecatedFlyString& name() { return value.get().name; } + DeprecatedFlyString const& lowercase_name() const { return value.get().lowercase_name; } + DeprecatedFlyString& lowercase_name() { return value.get().lowercase_name; } DeprecatedString serialize() const; }; diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index b782a2c384a..116bdfa00db 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -25,9 +25,9 @@ namespace Web::SelectorEngine { // https://drafts.csswg.org/selectors-4/#the-lang-pseudo -static inline bool matches_lang_pseudo_class(DOM::Element const& element, Vector const& languages) +static inline bool matches_lang_pseudo_class(DOM::Element const& element, Vector const& languages) { - FlyString element_language; + DeprecatedFlyString element_language; for (auto const* e = &element; e; e = e->parent_element()) { auto lang = e->attribute(HTML::AttributeNames::lang); if (!lang.is_null()) { diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index da258345fd2..64c670b932a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -43,7 +43,7 @@ StyleComputer::~StyleComputer() = default; class StyleComputer::FontLoader : public ResourceClient { public: - explicit FontLoader(StyleComputer& style_computer, FlyString family_name, AK::URL url) + explicit FontLoader(StyleComputer& style_computer, DeprecatedFlyString family_name, AK::URL url) : m_style_computer(style_computer) , m_family_name(move(family_name)) { @@ -105,7 +105,7 @@ private: } StyleComputer& m_style_computer; - FlyString m_family_name; + DeprecatedFlyString m_family_name; RefPtr m_vector_font; HashMap> mutable m_cached_fonts; @@ -571,7 +571,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope style.set_property(property_id, value); } -static RefPtr get_custom_property(DOM::Element const& element, FlyString const& custom_property_name) +static RefPtr get_custom_property(DOM::Element const& element, DeprecatedFlyString const& custom_property_name) { for (auto const* current_element = &element; current_element; current_element = current_element->parent_element()) { if (auto it = current_element->custom_properties().find(custom_property_name); it != current_element->custom_properties().end()) @@ -580,7 +580,7 @@ static RefPtr get_custom_property(DOM::Element const& element, FlySt return nullptr; } -bool StyleComputer::expand_variables(DOM::Element& element, StringView property_name, HashMap>& dependencies, Parser::TokenStream& source, Vector& dest) const +bool StyleComputer::expand_variables(DOM::Element& element, StringView property_name, HashMap>& dependencies, Parser::TokenStream& source, Vector& dest) const { // Arbitrary large value chosen to avoid the billion-laughs attack. // https://www.w3.org/TR/css-variables-1/#long-variables @@ -761,7 +761,7 @@ RefPtr StyleComputer::resolve_unresolved_style_value(DOM::Element& e Parser::TokenStream unresolved_values_without_variables_expanded { unresolved.values() }; Vector values_with_variables_expanded; - HashMap> dependencies; + HashMap> dependencies; if (!expand_variables(element, string_from_property_id(property_id), dependencies, unresolved_values_without_variables_expanded, values_with_variables_expanded)) return {}; @@ -817,7 +817,7 @@ static ErrorOr cascade_custom_properties(DOM::Element& element, Vector(element.inline_style())) needed_capacity += inline_style->custom_properties().size(); - HashMap custom_properties; + HashMap custom_properties; TRY(custom_properties.try_ensure_capacity(needed_capacity)); for (auto const& matching_rule : matching_rules) { @@ -1444,7 +1444,7 @@ CSSPixelRect StyleComputer::viewport_rect() const return {}; } -void StyleComputer::did_load_font([[maybe_unused]] FlyString const& family_name) +void StyleComputer::did_load_font([[maybe_unused]] DeprecatedFlyString const& family_name) { document().invalidate_layout(); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.h b/Userland/Libraries/LibWeb/CSS/StyleComputer.h index 4482ac6027c..5d9c79dd9f9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.h @@ -73,7 +73,7 @@ public: Gfx::Font const& initial_font() const; - void did_load_font(FlyString const& family_name); + void did_load_font(DeprecatedFlyString const& family_name); void load_fonts_from_sheet(CSSStyleSheet const&); @@ -87,7 +87,7 @@ private: void compute_defaulted_property_value(StyleProperties&, DOM::Element const*, CSS::PropertyID, Optional) const; RefPtr resolve_unresolved_style_value(DOM::Element&, PropertyID, UnresolvedStyleValue const&) const; - bool expand_variables(DOM::Element&, StringView property_name, HashMap>& dependencies, Parser::TokenStream& source, Vector& dest) const; + bool expand_variables(DOM::Element&, StringView property_name, HashMap>& dependencies, Parser::TokenStream& source, Vector& dest) const; bool expand_unresolved_values(DOM::Element&, StringView property_name, Parser::TokenStream& source, Vector& dest) const; template @@ -109,9 +109,9 @@ private: DOM::Document& m_document; struct RuleCache { - HashMap> rules_by_id; - HashMap> rules_by_class; - HashMap> rules_by_tag_name; + HashMap> rules_by_id; + HashMap> rules_by_class; + HashMap> rules_by_tag_name; HashMap> rules_by_pseudo_element; Vector other_rules; }; diff --git a/Userland/Libraries/LibWeb/DOM/ARIAMixin.cpp b/Userland/Libraries/LibWeb/DOM/ARIAMixin.cpp index 04b472c31e0..2ea332026b7 100644 --- a/Userland/Libraries/LibWeb/DOM/ARIAMixin.cpp +++ b/Userland/Libraries/LibWeb/DOM/ARIAMixin.cpp @@ -11,7 +11,7 @@ namespace Web::DOM { // https://www.w3.org/TR/wai-aria-1.2/#introroles -FlyString ARIAMixin::role_or_default() const +DeprecatedFlyString ARIAMixin::role_or_default() const { // 1. Use the rules of the host language to detect that an element has a role attribute and to identify the attribute value string for it. auto role_string = role(); diff --git a/Userland/Libraries/LibWeb/DOM/ARIAMixin.h b/Userland/Libraries/LibWeb/DOM/ARIAMixin.h index ec93ecb0366..4383af08482 100644 --- a/Userland/Libraries/LibWeb/DOM/ARIAMixin.h +++ b/Userland/Libraries/LibWeb/DOM/ARIAMixin.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include namespace Web::DOM { @@ -132,9 +132,9 @@ public: virtual WebIDL::ExceptionOr set_aria_value_text(DeprecatedString const&) = 0; // https://www.w3.org/TR/html-aria/#docconformance - virtual FlyString default_role() const { return {}; }; + virtual DeprecatedFlyString default_role() const { return {}; }; - FlyString role_or_default() const; + DeprecatedFlyString role_or_default() const; // https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion virtual bool exclude_from_accessibility_tree() const = 0; diff --git a/Userland/Libraries/LibWeb/DOM/ARIARoleNames.cpp b/Userland/Libraries/LibWeb/DOM/ARIARoleNames.cpp index afd709610e9..3d70ab243e7 100644 --- a/Userland/Libraries/LibWeb/DOM/ARIARoleNames.cpp +++ b/Userland/Libraries/LibWeb/DOM/ARIARoleNames.cpp @@ -8,7 +8,7 @@ namespace Web::DOM::ARIARoleNames { -#define __ENUMERATE_ARIA_ROLE(name) FlyString name; +#define __ENUMERATE_ARIA_ROLE(name) DeprecatedFlyString name; ENUMERATE_ARIA_ROLES #undef __ENUMERATE_ARIA_ROLE @@ -28,7 +28,7 @@ ENUMERATE_ARIA_ROLES } // https://www.w3.org/TR/wai-aria-1.2/#abstract_roles -bool is_abstract_aria_role(FlyString const& role) +bool is_abstract_aria_role(DeprecatedFlyString const& role) { return role.is_one_of( ARIARoleNames::command, @@ -46,7 +46,7 @@ bool is_abstract_aria_role(FlyString const& role) } // https://www.w3.org/TR/wai-aria-1.2/#widget_roles -bool is_widget_aria_role(FlyString const& role) +bool is_widget_aria_role(DeprecatedFlyString const& role) { return role.to_lowercase().is_one_of( ARIARoleNames::button, @@ -80,7 +80,7 @@ bool is_widget_aria_role(FlyString const& role) } // https://www.w3.org/TR/wai-aria-1.2/#document_structure_roles -bool is_document_structure_aria_role(FlyString const& role) +bool is_document_structure_aria_role(DeprecatedFlyString const& role) { return role.to_lowercase().is_one_of( ARIARoleNames::application, @@ -123,7 +123,7 @@ bool is_document_structure_aria_role(FlyString const& role) } // https://www.w3.org/TR/wai-aria-1.2/#landmark_roles -bool is_landmark_aria_role(FlyString const& role) +bool is_landmark_aria_role(DeprecatedFlyString const& role) { return role.to_lowercase().is_one_of( ARIARoleNames::banner, @@ -137,7 +137,7 @@ bool is_landmark_aria_role(FlyString const& role) } // https://www.w3.org/TR/wai-aria-1.2/#live_region_roles -bool is_live_region_aria_role(FlyString const& role) +bool is_live_region_aria_role(DeprecatedFlyString const& role) { return role.to_lowercase().is_one_of( ARIARoleNames::alert, @@ -148,14 +148,14 @@ bool is_live_region_aria_role(FlyString const& role) } // https://www.w3.org/TR/wai-aria-1.2/#window_roles -bool is_windows_aria_role(FlyString const& role) +bool is_windows_aria_role(DeprecatedFlyString const& role) { return role.to_lowercase().is_one_of( ARIARoleNames::alertdialog, ARIARoleNames::dialog); } -bool is_non_abstract_aria_role(FlyString const& role) +bool is_non_abstract_aria_role(DeprecatedFlyString const& role) { return is_widget_aria_role(role) || is_document_structure_aria_role(role) diff --git a/Userland/Libraries/LibWeb/DOM/ARIARoleNames.h b/Userland/Libraries/LibWeb/DOM/ARIARoleNames.h index 36d310643e9..6bca60883d0 100644 --- a/Userland/Libraries/LibWeb/DOM/ARIARoleNames.h +++ b/Userland/Libraries/LibWeb/DOM/ARIARoleNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::DOM::ARIARoleNames { @@ -106,17 +106,17 @@ namespace Web::DOM::ARIARoleNames { __ENUMERATE_ARIA_ROLE(widget) \ __ENUMERATE_ARIA_ROLE(window) -#define __ENUMERATE_ARIA_ROLE(name) extern FlyString name; +#define __ENUMERATE_ARIA_ROLE(name) extern DeprecatedFlyString name; ENUMERATE_ARIA_ROLES #undef __ENUMERATE_ARIA_ROLE -bool is_abstract_aria_role(FlyString const&); -bool is_widget_aria_role(FlyString const&); -bool is_document_structure_aria_role(FlyString const&); -bool is_landmark_aria_role(FlyString const&); -bool is_live_region_aria_role(FlyString const&); -bool is_windows_aria_role(FlyString const&); +bool is_abstract_aria_role(DeprecatedFlyString const&); +bool is_widget_aria_role(DeprecatedFlyString const&); +bool is_document_structure_aria_role(DeprecatedFlyString const&); +bool is_landmark_aria_role(DeprecatedFlyString const&); +bool is_live_region_aria_role(DeprecatedFlyString const&); +bool is_windows_aria_role(DeprecatedFlyString const&); -bool is_non_abstract_aria_role(FlyString const&); +bool is_non_abstract_aria_role(DeprecatedFlyString const&); } diff --git a/Userland/Libraries/LibWeb/DOM/Attr.cpp b/Userland/Libraries/LibWeb/DOM/Attr.cpp index 4d6075b026c..b1c81848e6f 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.cpp +++ b/Userland/Libraries/LibWeb/DOM/Attr.cpp @@ -13,7 +13,7 @@ namespace Web::DOM { -JS::NonnullGCPtr Attr::create(Document& document, FlyString local_name, DeprecatedString value, Element const* owner_element) +JS::NonnullGCPtr Attr::create(Document& document, DeprecatedFlyString local_name, DeprecatedString value, Element const* owner_element) { return document.heap().allocate(document.realm(), document, QualifiedName(move(local_name), {}, {}), move(value), owner_element); } diff --git a/Userland/Libraries/LibWeb/DOM/Attr.h b/Userland/Libraries/LibWeb/DOM/Attr.h index 5c48c99d4b7..3c88b7457c4 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.h +++ b/Userland/Libraries/LibWeb/DOM/Attr.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -18,16 +18,16 @@ class Attr final : public Node { WEB_PLATFORM_OBJECT(Attr, Node); public: - static JS::NonnullGCPtr create(Document&, FlyString local_name, DeprecatedString value, Element const* = nullptr); + static JS::NonnullGCPtr create(Document&, DeprecatedFlyString local_name, DeprecatedString value, Element const* = nullptr); JS::NonnullGCPtr clone(Document&); virtual ~Attr() override = default; - virtual FlyString node_name() const override { return name(); } + virtual DeprecatedFlyString node_name() const override { return name(); } - FlyString const& namespace_uri() const { return m_qualified_name.namespace_(); } - FlyString const& prefix() const { return m_qualified_name.prefix(); } - FlyString const& local_name() const { return m_qualified_name.local_name(); } + DeprecatedFlyString const& namespace_uri() const { return m_qualified_name.namespace_(); } + DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); } + DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); } DeprecatedString const& name() const { return m_qualified_name.as_string(); } DeprecatedString const& value() const { return m_value; } diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.h b/Userland/Libraries/LibWeb/DOM/CDATASection.h index 061b6aa48fa..819a506a8e6 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.h +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.h @@ -18,7 +18,7 @@ public: virtual ~CDATASection() override; // ^Node - virtual FlyString node_name() const override { return "#cdata-section"; } + virtual DeprecatedFlyString node_name() const override { return "#cdata-section"; } private: CDATASection(Document&, DeprecatedString const&); diff --git a/Userland/Libraries/LibWeb/DOM/Comment.h b/Userland/Libraries/LibWeb/DOM/Comment.h index 3977501ad8a..0192c4a8f21 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.h +++ b/Userland/Libraries/LibWeb/DOM/Comment.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include namespace Web::DOM { @@ -18,7 +18,7 @@ public: static JS::NonnullGCPtr construct_impl(JS::Realm&, DeprecatedString const& data); virtual ~Comment() override = default; - virtual FlyString node_name() const override { return "#comment"; } + virtual DeprecatedFlyString node_name() const override { return "#comment"; } private: Comment(Document&, DeprecatedString const&); diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp index d271f08cf3c..9bc3b4c466e 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp @@ -11,17 +11,17 @@ namespace Web::DOM { -CustomEvent* CustomEvent::create(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init) +CustomEvent* CustomEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -CustomEvent* CustomEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init) +CustomEvent* CustomEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init) { return create(realm, event_name, event_init); } -CustomEvent::CustomEvent(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init) +CustomEvent::CustomEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init) : Event(realm, event_name, event_init) , m_detail(event_init.detail) { diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.h b/Userland/Libraries/LibWeb/DOM/CustomEvent.h index fa4d4851606..a42f917846a 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.h +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.h @@ -20,8 +20,8 @@ class CustomEvent : public Event { WEB_PLATFORM_OBJECT(CustomEvent, Event); public: - static CustomEvent* create(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init = {}); - static CustomEvent* construct_impl(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init); + static CustomEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init = {}); + static CustomEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init); virtual ~CustomEvent() override; @@ -33,7 +33,7 @@ public: void init_custom_event(DeprecatedString const& type, bool bubbles, bool cancelable, JS::Value detail); private: - CustomEvent(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init); + CustomEvent(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init); // https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-detail JS::Value m_detail { JS::js_null() }; diff --git a/Userland/Libraries/LibWeb/DOM/DOMEventListener.h b/Userland/Libraries/LibWeb/DOM/DOMEventListener.h index 87a3b744a8d..3d944f95e29 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMEventListener.h +++ b/Userland/Libraries/LibWeb/DOM/DOMEventListener.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -21,7 +21,7 @@ public: ~DOMEventListener(); // type (a string) - FlyString type; + DeprecatedFlyString type; // callback (null or an EventListener object) JS::GCPtr callback; diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index 8806e05fa3f..768dc3fa57a 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -52,14 +52,14 @@ inline void replace_in_ordered_set(Vector& set, StringView ite namespace Web::DOM { -DOMTokenList* DOMTokenList::create(Element const& associated_element, FlyString associated_attribute) +DOMTokenList* DOMTokenList::create(Element const& associated_element, DeprecatedFlyString associated_attribute) { auto& realm = associated_element.realm(); return realm.heap().allocate(realm, associated_element, move(associated_attribute)); } // https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A2 -DOMTokenList::DOMTokenList(Element const& associated_element, FlyString associated_attribute) +DOMTokenList::DOMTokenList(Element const& associated_element, DeprecatedFlyString associated_attribute) : Bindings::LegacyPlatformObject(Bindings::cached_web_prototype(associated_element.realm(), "DOMTokenList")) , m_associated_element(associated_element) , m_associated_attribute(move(associated_attribute)) diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h index 40b3704d356..4be3d0a2b72 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include #include @@ -23,7 +23,7 @@ class DOMTokenList final : public Bindings::LegacyPlatformObject { WEB_PLATFORM_OBJECT(DOMTokenList, Bindings::LegacyPlatformObject); public: - static DOMTokenList* create(Element const& associated_element, FlyString associated_attribute); + static DOMTokenList* create(Element const& associated_element, DeprecatedFlyString associated_attribute); ~DOMTokenList() = default; void associated_attribute_changed(StringView value); @@ -43,7 +43,7 @@ public: void set_value(DeprecatedString value); private: - DOMTokenList(Element const& associated_element, FlyString associated_attribute); + DOMTokenList(Element const& associated_element, DeprecatedFlyString associated_attribute); virtual void visit_edges(Cell::Visitor&) override; @@ -51,7 +51,7 @@ private: void run_update_steps(); JS::NonnullGCPtr m_associated_element; - FlyString m_associated_attribute; + DeprecatedFlyString m_associated_attribute; Vector m_token_set; }; diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 8c9b24b2472..8c4d0abad84 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1018,9 +1018,9 @@ JS::NonnullGCPtr Document::get_elements_by_name(DeprecatedString }); } -JS::NonnullGCPtr Document::get_elements_by_class_name(FlyString const& class_names) +JS::NonnullGCPtr Document::get_elements_by_class_name(DeprecatedFlyString const& class_names) { - Vector list_of_class_names; + Vector list_of_class_names; for (auto& name : class_names.view().split_view(' ')) { list_of_class_names.append(name); } @@ -1180,7 +1180,7 @@ JS::Value Document::run_javascript(StringView source, StringView filename) } // https://dom.spec.whatwg.org/#dom-document-createelement -WebIDL::ExceptionOr> Document::create_element(FlyString const& a_local_name) +WebIDL::ExceptionOr> Document::create_element(DeprecatedFlyString const& a_local_name) { auto local_name = a_local_name; @@ -1196,7 +1196,7 @@ WebIDL::ExceptionOr> Document::create_element(FlyStrin // FIXME: 4. If options is a dictionary and options["is"] exists, then set is to it. // 5. Let namespace be the HTML namespace, if this is an HTML document or this’s content type is "application/xhtml+xml"; otherwise null. - FlyString namespace_; + DeprecatedFlyString namespace_; if (document_type() == Type::HTML || content_type() == "application/xhtml+xml"sv) namespace_ = Namespace::HTML; diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 2278959b61d..5757519dd41 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include #include #include @@ -127,7 +127,7 @@ public: CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); } - virtual FlyString node_name() const override { return "#document"; } + virtual DeprecatedFlyString node_name() const override { return "#document"; } void set_hovered_node(Node*); Node* hovered_node() { return m_hovered_node.ptr(); } @@ -203,7 +203,7 @@ public: void schedule_layout_update(); JS::NonnullGCPtr get_elements_by_name(DeprecatedString const&); - JS::NonnullGCPtr get_elements_by_class_name(FlyString const&); + JS::NonnullGCPtr get_elements_by_class_name(DeprecatedFlyString const&); JS::NonnullGCPtr applets(); JS::NonnullGCPtr anchors(); @@ -222,7 +222,7 @@ public: JS::Value run_javascript(StringView source, StringView filename = "(unknown)"sv); - WebIDL::ExceptionOr> create_element(FlyString const& local_name); + WebIDL::ExceptionOr> create_element(DeprecatedFlyString const& local_name); WebIDL::ExceptionOr> create_element_ns(DeprecatedString const& namespace_, DeprecatedString const& qualified_name); JS::NonnullGCPtr create_document_fragment(); JS::NonnullGCPtr create_text_node(DeprecatedString const& data); @@ -371,8 +371,8 @@ public: static bool is_valid_name(DeprecatedString const&); struct PrefixAndTagName { - FlyString prefix; - FlyString tag_name; + DeprecatedFlyString prefix; + DeprecatedFlyString tag_name; }; static WebIDL::ExceptionOr validate_qualified_name(JS::Realm&, DeprecatedString const& qualified_name); @@ -456,7 +456,7 @@ private: Document(JS::Realm&, AK::URL const&); // ^HTML::GlobalEventHandlers - virtual EventTarget& global_event_handlers_to_event_target(FlyString const&) final { return *this; } + virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const&) final { return *this; } void tear_down_layout_tree(); diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.h b/Userland/Libraries/LibWeb/DOM/DocumentFragment.h index e0c5213d424..47116712a82 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -23,7 +23,7 @@ public: virtual ~DocumentFragment() override = default; - virtual FlyString node_name() const override { return "#document-fragment"; } + virtual DeprecatedFlyString node_name() const override { return "#document-fragment"; } Element* host() { return m_host.ptr(); } Element const* host() const { return m_host.ptr(); } diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.h b/Userland/Libraries/LibWeb/DOM/DocumentType.h index 1ef8040c937..deb8b96a374 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -22,7 +22,7 @@ public: virtual ~DocumentType() override = default; - virtual FlyString node_name() const override { return "#doctype"; } + virtual DeprecatedFlyString node_name() const override { return "#doctype"; } DeprecatedString const& name() const { return m_name; } void set_name(DeprecatedString const& name) { m_name = name; } diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index a7c4e4b085c..135e27f3c9f 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -80,7 +80,7 @@ void Element::visit_edges(Cell::Visitor& visitor) } // https://dom.spec.whatwg.org/#dom-element-getattribute -DeprecatedString Element::get_attribute(FlyString const& name) const +DeprecatedString Element::get_attribute(DeprecatedFlyString const& name) const { // 1. Let attr be the result of getting an attribute given qualifiedName and this. auto const* attribute = m_attributes->get_attribute(name); @@ -94,14 +94,14 @@ DeprecatedString Element::get_attribute(FlyString const& name) const } // https://dom.spec.whatwg.org/#dom-element-getattributenode -JS::GCPtr Element::get_attribute_node(FlyString const& name) const +JS::GCPtr Element::get_attribute_node(DeprecatedFlyString const& name) const { // The getAttributeNode(qualifiedName) method steps are to return the result of getting an attribute given qualifiedName and this. return m_attributes->get_attribute(name); } // https://dom.spec.whatwg.org/#dom-element-setattribute -WebIDL::ExceptionOr Element::set_attribute(FlyString const& name, DeprecatedString const& value) +WebIDL::ExceptionOr Element::set_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { // 1. If qualifiedName does not match the Name production in XML, then throw an "InvalidCharacterError" DOMException. // FIXME: Proper name validation @@ -136,7 +136,7 @@ WebIDL::ExceptionOr Element::set_attribute(FlyString const& name, Deprecat } // https://dom.spec.whatwg.org/#validate-and-extract -WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, FlyString namespace_, FlyString qualified_name) +WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, DeprecatedFlyString namespace_, DeprecatedFlyString qualified_name) { // 1. If namespace is the empty string, then set it to null. if (namespace_.is_empty()) @@ -146,7 +146,7 @@ WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, FlyStr TRY(Document::validate_qualified_name(realm, qualified_name)); // 3. Let prefix be null. - FlyString prefix = {}; + DeprecatedFlyString prefix = {}; // 4. Let localName be qualifiedName. auto local_name = qualified_name; @@ -179,7 +179,7 @@ WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, FlyStr } // https://dom.spec.whatwg.org/#dom-element-setattributens -WebIDL::ExceptionOr Element::set_attribute_ns(FlyString const& namespace_, FlyString const& qualified_name, DeprecatedString const& value) +WebIDL::ExceptionOr Element::set_attribute_ns(DeprecatedFlyString const& namespace_, DeprecatedFlyString const& qualified_name, DeprecatedString const& value) { // 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to validate and extract. auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name)); @@ -191,7 +191,7 @@ WebIDL::ExceptionOr Element::set_attribute_ns(FlyString const& namespace_, } // https://dom.spec.whatwg.org/#dom-element-removeattribute -void Element::remove_attribute(FlyString const& name) +void Element::remove_attribute(DeprecatedFlyString const& name) { m_attributes->remove_attribute(name); @@ -201,13 +201,13 @@ void Element::remove_attribute(FlyString const& name) } // https://dom.spec.whatwg.org/#dom-element-hasattribute -bool Element::has_attribute(FlyString const& name) const +bool Element::has_attribute(DeprecatedFlyString const& name) const { return m_attributes->get_attribute(name) != nullptr; } // https://dom.spec.whatwg.org/#dom-element-toggleattribute -WebIDL::ExceptionOr Element::toggle_attribute(FlyString const& name, Optional force) +WebIDL::ExceptionOr Element::toggle_attribute(DeprecatedFlyString const& name, Optional force) { // 1. If qualifiedName does not match the Name production in XML, then throw an "InvalidCharacterError" DOMException. // FIXME: Proper name validation @@ -264,7 +264,7 @@ Vector Element::get_attribute_names() const return names; } -bool Element::has_class(FlyString const& class_name, CaseSensitivity case_sensitivity) const +bool Element::has_class(DeprecatedFlyString const& class_name, CaseSensitivity case_sensitivity) const { if (case_sensitivity == CaseSensitivity::CaseSensitive) { return any_of(m_classes, [&](auto& it) { @@ -330,7 +330,7 @@ CSS::CSSStyleDeclaration const* Element::inline_style() const return m_inline_style.ptr(); } -void Element::parse_attribute(FlyString const& name, DeprecatedString const& value) +void Element::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { if (name == HTML::AttributeNames::class_) { auto new_classes = value.split_view(Infra::is_ascii_whitespace); @@ -350,7 +350,7 @@ void Element::parse_attribute(FlyString const& name, DeprecatedString const& val } } -void Element::did_remove_attribute(FlyString const& name) +void Element::did_remove_attribute(DeprecatedFlyString const& name) { if (name == HTML::AttributeNames::style) { if (m_inline_style) { @@ -516,9 +516,9 @@ bool Element::is_active() const return document().active_element() == this; } -JS::NonnullGCPtr Element::get_elements_by_class_name(FlyString const& class_names) +JS::NonnullGCPtr Element::get_elements_by_class_name(DeprecatedFlyString const& class_names) { - Vector list_of_class_names; + Vector list_of_class_names; for (auto& name : class_names.view().split_view_if(Infra::is_ascii_whitespace)) { list_of_class_names.append(name); } @@ -1258,7 +1258,7 @@ ErrorOr Element::scroll_into_view(Optional #include -#include #include #include #include @@ -50,31 +50,31 @@ public: DeprecatedString const& qualified_name() const { return m_qualified_name.as_string(); } DeprecatedString const& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; } - virtual FlyString node_name() const final { return html_uppercased_qualified_name(); } - FlyString const& local_name() const { return m_qualified_name.local_name(); } + virtual DeprecatedFlyString node_name() const final { return html_uppercased_qualified_name(); } + DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); } // NOTE: This is for the JS bindings DeprecatedString const& tag_name() const { return html_uppercased_qualified_name(); } - FlyString const& prefix() const { return m_qualified_name.prefix(); } - FlyString const& namespace_() const { return m_qualified_name.namespace_(); } + DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); } + DeprecatedFlyString const& namespace_() const { return m_qualified_name.namespace_(); } // NOTE: This is for the JS bindings - FlyString const& namespace_uri() const { return namespace_(); } + DeprecatedFlyString const& namespace_uri() const { return namespace_(); } - bool has_attribute(FlyString const& name) const; + bool has_attribute(DeprecatedFlyString const& name) const; bool has_attributes() const { return !m_attributes->is_empty(); } - DeprecatedString attribute(FlyString const& name) const { return get_attribute(name); } - DeprecatedString get_attribute(FlyString const& name) const; - WebIDL::ExceptionOr set_attribute(FlyString const& name, DeprecatedString const& value); - WebIDL::ExceptionOr set_attribute_ns(FlyString const& namespace_, FlyString const& qualified_name, DeprecatedString const& value); - void remove_attribute(FlyString const& name); - WebIDL::ExceptionOr toggle_attribute(FlyString const& name, Optional force); + DeprecatedString attribute(DeprecatedFlyString const& name) const { return get_attribute(name); } + DeprecatedString get_attribute(DeprecatedFlyString const& name) const; + WebIDL::ExceptionOr set_attribute(DeprecatedFlyString const& name, DeprecatedString const& value); + WebIDL::ExceptionOr set_attribute_ns(DeprecatedFlyString const& namespace_, DeprecatedFlyString const& qualified_name, DeprecatedString const& value); + void remove_attribute(DeprecatedFlyString const& name); + WebIDL::ExceptionOr toggle_attribute(DeprecatedFlyString const& name, Optional force); size_t attribute_list_size() const { return m_attributes->length(); } NamedNodeMap const* attributes() const { return m_attributes.ptr(); } Vector get_attribute_names() const; - JS::GCPtr get_attribute_node(FlyString const& name) const; + JS::GCPtr get_attribute_node(DeprecatedFlyString const& name) const; DOMTokenList* class_list(); @@ -95,12 +95,12 @@ public: } } - bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const; - Vector const& class_names() const { return m_classes; } + bool has_class(DeprecatedFlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const; + Vector const& class_names() const { return m_classes; } virtual void apply_presentational_hints(CSS::StyleProperties&) const { } - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value); - virtual void did_remove_attribute(FlyString const&); + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value); + virtual void did_remove_attribute(DeprecatedFlyString const&); enum class NeedsRelayout { No = 0, @@ -129,14 +129,14 @@ public: bool is_focused() const; bool is_active() const; - JS::NonnullGCPtr get_elements_by_class_name(FlyString const&); + JS::NonnullGCPtr get_elements_by_class_name(DeprecatedFlyString const&); ShadowRoot* shadow_root() { return m_shadow_root.ptr(); } ShadowRoot const* shadow_root() const { return m_shadow_root.ptr(); } void set_shadow_root(JS::GCPtr); - void set_custom_properties(HashMap custom_properties) { m_custom_properties = move(custom_properties); } - HashMap const& custom_properties() const { return m_custom_properties; } + void set_custom_properties(HashMap custom_properties) { m_custom_properties = move(custom_properties); } + HashMap const& custom_properties() const { return m_custom_properties; } void queue_an_element_task(HTML::Task::Source, JS::SafeFunction); @@ -261,7 +261,7 @@ protected: private: void make_html_uppercased_qualified_name(); - void invalidate_style_after_attribute_change(FlyString const& attribute_name); + void invalidate_style_after_attribute_change(DeprecatedFlyString const& attribute_name); WebIDL::ExceptionOr> insert_adjacent(DeprecatedString const& where, JS::NonnullGCPtr node); @@ -274,9 +274,9 @@ private: JS::GCPtr m_shadow_root; RefPtr m_computed_css_values; - HashMap m_custom_properties; + HashMap m_custom_properties; - Vector m_classes; + Vector m_classes; Array, to_underlying(CSS::Selector::PseudoElement::PseudoElementCount)> m_pseudo_element_nodes; }; @@ -284,6 +284,6 @@ private: template<> inline bool Node::fast_is() const { return is_element(); } -WebIDL::ExceptionOr validate_and_extract(JS::Realm&, FlyString namespace_, FlyString qualified_name); +WebIDL::ExceptionOr validate_and_extract(JS::Realm&, DeprecatedFlyString namespace_, DeprecatedFlyString qualified_name); } diff --git a/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp b/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp index 617d24f8aa9..1b8bab27326 100644 --- a/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp +++ b/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp @@ -95,7 +95,7 @@ namespace Web::DOM { // https://dom.spec.whatwg.org/#concept-create-element -JS::NonnullGCPtr create_element(Document& document, FlyString local_name, FlyString namespace_, FlyString prefix) +JS::NonnullGCPtr create_element(Document& document, DeprecatedFlyString local_name, DeprecatedFlyString namespace_, DeprecatedFlyString prefix) { // 1. If prefix was not given, let prefix be null. // NOTE: This is already taken care of by `prefix` having a default value. diff --git a/Userland/Libraries/LibWeb/DOM/ElementFactory.h b/Userland/Libraries/LibWeb/DOM/ElementFactory.h index 3c9ac81cbb1..ff2d46334ae 100644 --- a/Userland/Libraries/LibWeb/DOM/ElementFactory.h +++ b/Userland/Libraries/LibWeb/DOM/ElementFactory.h @@ -10,6 +10,6 @@ namespace Web::DOM { -JS::NonnullGCPtr create_element(Document&, FlyString local_name, FlyString namespace_, FlyString prefix = {}); +JS::NonnullGCPtr create_element(Document&, DeprecatedFlyString local_name, DeprecatedFlyString namespace_, DeprecatedFlyString prefix = {}); } diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index 752f1ec0bba..a42a587e52c 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -14,24 +14,24 @@ namespace Web::DOM { -JS::NonnullGCPtr Event::create(JS::Realm& realm, FlyString const& event_name, EventInit const& event_init) +JS::NonnullGCPtr Event::create(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -JS::NonnullGCPtr Event::construct_impl(JS::Realm& realm, FlyString const& event_name, EventInit const& event_init) +JS::NonnullGCPtr Event::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init) { return create(realm, event_name, event_init); } -Event::Event(JS::Realm& realm, FlyString const& type) +Event::Event(JS::Realm& realm, DeprecatedFlyString const& type) : PlatformObject(Bindings::cached_web_prototype(realm, "Event")) , m_type(type) , m_initialized(true) { } -Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_init) +Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const& event_init) : PlatformObject(Bindings::cached_web_prototype(realm, "Event")) , m_type(type) , m_bubbles(event_init.bubbles) diff --git a/Userland/Libraries/LibWeb/DOM/Event.h b/Userland/Libraries/LibWeb/DOM/Event.h index a7871e73cd5..53b8f3279cd 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.h +++ b/Userland/Libraries/LibWeb/DOM/Event.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include @@ -45,17 +45,17 @@ public: using Path = Vector; - static JS::NonnullGCPtr create(JS::Realm&, FlyString const& event_name, EventInit const& event_init = {}); - static JS::NonnullGCPtr construct_impl(JS::Realm&, FlyString const& event_name, EventInit const& event_init); + static JS::NonnullGCPtr create(JS::Realm&, DeprecatedFlyString const& event_name, EventInit const& event_init = {}); + static JS::NonnullGCPtr construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, EventInit const& event_init); - Event(JS::Realm&, FlyString const& type); - Event(JS::Realm&, FlyString const& type, EventInit const& event_init); + Event(JS::Realm&, DeprecatedFlyString const& type); + Event(JS::Realm&, DeprecatedFlyString const& type, EventInit const& event_init); virtual ~Event() = default; double time_stamp() const; - FlyString const& type() const { return m_type; } + DeprecatedFlyString const& type() const { return m_type; } void set_type(StringView type) { m_type = type; } JS::GCPtr target() const { return m_target; } @@ -148,7 +148,7 @@ protected: virtual void visit_edges(Visitor&) override; private: - FlyString m_type; + DeprecatedFlyString m_type; JS::GCPtr m_target; JS::GCPtr m_related_target; JS::GCPtr m_current_target; diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index 45a7fea65b5..cd2a6256fc8 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -120,7 +120,7 @@ static FlattenedAddEventListenerOptions flatten_add_event_listener_options(Varia } // https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener -void EventTarget::add_event_listener(FlyString const& type, IDLEventListener* callback, Variant const& options) +void EventTarget::add_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant const& options) { // 1. Let capture, passive, once, and signal be the result of flattening more options. auto flattened_options = flatten_add_event_listener_options(options); @@ -138,7 +138,7 @@ void EventTarget::add_event_listener(FlyString const& type, IDLEventListener* ca add_an_event_listener(*event_listener); } -void EventTarget::add_event_listener_without_options(FlyString const& type, IDLEventListener& callback) +void EventTarget::add_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback) { add_event_listener(type, &callback, AddEventListenerOptions {}); } @@ -179,7 +179,7 @@ void EventTarget::add_an_event_listener(DOMEventListener& listener) } // https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener -void EventTarget::remove_event_listener(FlyString const& type, IDLEventListener* callback, Variant const& options) +void EventTarget::remove_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant const& options) { // 1. Let capture be the result of flattening options. bool capture = flatten_event_listener_options(options); @@ -202,7 +202,7 @@ void EventTarget::remove_event_listener(FlyString const& type, IDLEventListener* remove_an_event_listener(**it); } -void EventTarget::remove_event_listener_without_options(FlyString const& type, IDLEventListener& callback) +void EventTarget::remove_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback) { remove_event_listener(type, &callback, EventListenerOptions {}); } @@ -241,7 +241,7 @@ WebIDL::ExceptionOr EventTarget::dispatch_event_binding(Event& event) } // https://html.spec.whatwg.org/multipage/webappapis.html#window-reflecting-body-element-event-handler-set -bool is_window_reflecting_body_element_event_handler(FlyString const& name) +bool is_window_reflecting_body_element_event_handler(DeprecatedFlyString const& name) { return name.is_one_of( HTML::EventNames::blur, @@ -253,7 +253,7 @@ bool is_window_reflecting_body_element_event_handler(FlyString const& name) } // https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers -static bool is_window_event_handler(FlyString const& name) +static bool is_window_event_handler(DeprecatedFlyString const& name) { return name.is_one_of( HTML::EventNames::afterprint, @@ -275,7 +275,7 @@ static bool is_window_event_handler(FlyString const& name) } // https://html.spec.whatwg.org/multipage/webappapis.html#determining-the-target-of-an-event-handler -static EventTarget* determine_target_of_event_handler(EventTarget& event_target, FlyString const& name) +static EventTarget* determine_target_of_event_handler(EventTarget& event_target, DeprecatedFlyString const& name) { // To determine the target of an event handler, given an EventTarget object eventTarget on which the event handler is exposed, // and an event handler name name, the following steps are taken: @@ -300,7 +300,7 @@ static EventTarget* determine_target_of_event_handler(EventTarget& event_target, } // https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:event-handler-idl-attributes-2 -WebIDL::CallbackType* EventTarget::event_handler_attribute(FlyString const& name) +WebIDL::CallbackType* EventTarget::event_handler_attribute(DeprecatedFlyString const& name) { // 1. Let eventTarget be the result of determining the target of an event handler given this object and name. auto target = determine_target_of_event_handler(*this, name); @@ -314,7 +314,7 @@ WebIDL::CallbackType* EventTarget::event_handler_attribute(FlyString const& name } // https://html.spec.whatwg.org/multipage/webappapis.html#getting-the-current-value-of-the-event-handler -WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString const& name) +WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(DeprecatedFlyString const& name) { // 1. Let handlerMap be eventTarget's event handler map. (NOTE: Not necessary) @@ -473,7 +473,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString } // https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:event-handler-idl-attributes-3 -void EventTarget::set_event_handler_attribute(FlyString const& name, WebIDL::CallbackType* value) +void EventTarget::set_event_handler_attribute(DeprecatedFlyString const& name, WebIDL::CallbackType* value) { // 1. Let eventTarget be the result of determining the target of an event handler given this object and name. auto event_target = determine_target_of_event_handler(*this, name); @@ -520,7 +520,7 @@ void EventTarget::set_event_handler_attribute(FlyString const& name, WebIDL::Cal } // https://html.spec.whatwg.org/multipage/webappapis.html#activate-an-event-handler -void EventTarget::activate_event_handler(FlyString const& name, HTML::EventHandler& event_handler) +void EventTarget::activate_event_handler(DeprecatedFlyString const& name, HTML::EventHandler& event_handler) { // 1. Let handlerMap be eventTarget's event handler map. // 2. Let eventHandler be handlerMap[name]. @@ -570,7 +570,7 @@ void EventTarget::activate_event_handler(FlyString const& name, HTML::EventHandl event_handler.listener = listener; } -void EventTarget::deactivate_event_handler(FlyString const& name) +void EventTarget::deactivate_event_handler(DeprecatedFlyString const& name) { // 1. Let handlerMap be eventTarget's event handler map. (NOTE: Not necessary) @@ -600,7 +600,7 @@ void EventTarget::deactivate_event_handler(FlyString const& name) } // https://html.spec.whatwg.org/multipage/webappapis.html#the-event-handler-processing-algorithm -JS::ThrowCompletionOr EventTarget::process_event_handler_for_event(FlyString const& name, Event& event) +JS::ThrowCompletionOr EventTarget::process_event_handler_for_event(DeprecatedFlyString const& name, Event& event) { // 1. Let callback be the result of getting the current value of the event handler given eventTarget and name. auto* callback = get_current_value_of_event_handler(name); @@ -679,7 +679,7 @@ JS::ThrowCompletionOr EventTarget::process_event_handler_for_event(FlyStri } // https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:concept-element-attributes-change-ext -void EventTarget::element_event_handler_attribute_changed(FlyString const& local_name, DeprecatedString const& value) +void EventTarget::element_event_handler_attribute_changed(DeprecatedFlyString const& local_name, DeprecatedString const& value) { // NOTE: Step 1 of this algorithm was handled in HTMLElement::parse_attribute. @@ -735,7 +735,7 @@ bool EventTarget::dispatch_event(Event& event) return EventDispatcher::dispatch(*this, event); } -bool EventTarget::has_event_listener(FlyString const& type) const +bool EventTarget::has_event_listener(DeprecatedFlyString const& type) const { for (auto& listener : m_event_listener_list) { if (listener->type == type) diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.h b/Userland/Libraries/LibWeb/DOM/EventTarget.h index a818733db8f..240d9ad3878 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.h +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -26,12 +26,12 @@ public: virtual bool is_focusable() const { return false; } - void add_event_listener(FlyString const& type, IDLEventListener* callback, Variant const& options); - void remove_event_listener(FlyString const& type, IDLEventListener* callback, Variant const& options); + void add_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant const& options); + void remove_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant const& options); // NOTE: These are for internal use only. They operate as though addEventListener(type, callback) was called instead of addEventListener(type, callback, options). - void add_event_listener_without_options(FlyString const& type, IDLEventListener& callback); - void remove_event_listener_without_options(FlyString const& type, IDLEventListener& callback); + void add_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback); + void remove_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback); virtual bool dispatch_event(Event&); WebIDL::ExceptionOr dispatch_event_binding(Event&); @@ -51,15 +51,15 @@ public: virtual void legacy_cancelled_activation_behavior() { } virtual void legacy_cancelled_activation_behavior_was_not_called() { } - WebIDL::CallbackType* event_handler_attribute(FlyString const& name); - void set_event_handler_attribute(FlyString const& name, WebIDL::CallbackType*); + WebIDL::CallbackType* event_handler_attribute(DeprecatedFlyString const& name); + void set_event_handler_attribute(DeprecatedFlyString const& name, WebIDL::CallbackType*); - bool has_event_listener(FlyString const& type) const; + bool has_event_listener(DeprecatedFlyString const& type) const; protected: explicit EventTarget(JS::Realm&); - void element_event_handler_attribute_changed(FlyString const& local_name, DeprecatedString const& value); + void element_event_handler_attribute_changed(DeprecatedFlyString const& local_name, DeprecatedString const& value); virtual void visit_edges(Cell::Visitor&) override; @@ -68,14 +68,14 @@ private: // https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-map // Spec Note: The order of the entries of event handler map could be arbitrary. It is not observable through any algorithms that operate on the map. - HashMap> m_event_handler_map; + HashMap> m_event_handler_map; - WebIDL::CallbackType* get_current_value_of_event_handler(FlyString const& name); - void activate_event_handler(FlyString const& name, HTML::EventHandler& event_handler); - void deactivate_event_handler(FlyString const& name); - JS::ThrowCompletionOr process_event_handler_for_event(FlyString const& name, Event& event); + WebIDL::CallbackType* get_current_value_of_event_handler(DeprecatedFlyString const& name); + void activate_event_handler(DeprecatedFlyString const& name, HTML::EventHandler& event_handler); + void deactivate_event_handler(DeprecatedFlyString const& name); + JS::ThrowCompletionOr process_event_handler_for_event(DeprecatedFlyString const& name, Event& event); }; -bool is_window_reflecting_body_element_event_handler(FlyString const& name); +bool is_window_reflecting_body_element_event_handler(DeprecatedFlyString const& name); } diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index 59b05d09cea..0a9e03b1cc6 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -62,7 +62,7 @@ Element* HTMLCollection::item(size_t index) const } // https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key -Element* HTMLCollection::named_item(FlyString const& name) const +Element* HTMLCollection::named_item(DeprecatedFlyString const& name) const { // 1. If key is the empty string, return null. if (name.is_empty()) @@ -130,7 +130,7 @@ JS::Value HTMLCollection::item_value(size_t index) const return const_cast(element); } -JS::Value HTMLCollection::named_item_value(FlyString const& index) const +JS::Value HTMLCollection::named_item_value(DeprecatedFlyString const& index) const { auto* element = named_item(index); if (!element) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h index fe48b3a0b49..a221e6b34a7 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -35,12 +35,12 @@ public: size_t length(); Element* item(size_t index) const; - Element* named_item(FlyString const& name) const; + Element* named_item(DeprecatedFlyString const& name) const; JS::MarkedVector collect_matching_elements() const; virtual JS::Value item_value(size_t index) const override; - virtual JS::Value named_item_value(FlyString const& name) const override; + virtual JS::Value named_item_value(DeprecatedFlyString const& name) const override; virtual Vector supported_property_names() const override; virtual bool is_supported_property_index(u32) const override; diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp index 7c280a9437a..9f29f539d68 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp @@ -12,12 +12,12 @@ namespace Web::DOM { -JS::NonnullGCPtr MutationRecord::create(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value) +JS::NonnullGCPtr MutationRecord::create(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value) { return realm.heap().allocate(realm, realm, type, target, added_nodes, removed_nodes, previous_sibling, next_sibling, attribute_name, attribute_namespace, old_value); } -MutationRecord::MutationRecord(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value) +MutationRecord::MutationRecord(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value) : PlatformObject(realm) , m_type(type) , m_target(JS::make_handle(target)) diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.h b/Userland/Libraries/LibWeb/DOM/MutationRecord.h index 6c44f0e06af..5c5f296c013 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.h +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.h @@ -15,11 +15,11 @@ class MutationRecord : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(MutationRecord, Bindings::PlatformObject); public: - static JS::NonnullGCPtr create(JS::Realm&, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value); + static JS::NonnullGCPtr create(JS::Realm&, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value); virtual ~MutationRecord() override; - FlyString const& type() const { return m_type; } + DeprecatedFlyString const& type() const { return m_type; } Node const* target() const { return m_target; } NodeList const* added_nodes() const { return m_added_nodes; } NodeList const* removed_nodes() const { return m_removed_nodes; } @@ -30,10 +30,10 @@ public: DeprecatedString const& old_value() const { return m_old_value; } private: - MutationRecord(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value); + MutationRecord(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value); virtual void visit_edges(Cell::Visitor&) override; - FlyString m_type; + DeprecatedFlyString m_type; JS::GCPtr m_target; JS::GCPtr m_added_nodes; JS::GCPtr m_removed_nodes; diff --git a/Userland/Libraries/LibWeb/DOM/MutationType.cpp b/Userland/Libraries/LibWeb/DOM/MutationType.cpp index 32787e8426b..976c70a0ec4 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationType.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationType.cpp @@ -8,7 +8,7 @@ namespace Web::DOM::MutationType { -#define __ENUMERATE_MUTATION_TYPE(name) FlyString name; +#define __ENUMERATE_MUTATION_TYPE(name) DeprecatedFlyString name; ENUMERATE_MUTATION_TYPES #undef __ENUMERATE_MUTATION_TYPE diff --git a/Userland/Libraries/LibWeb/DOM/MutationType.h b/Userland/Libraries/LibWeb/DOM/MutationType.h index 23f0b8c62a3..e7ddb4c7139 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationType.h +++ b/Userland/Libraries/LibWeb/DOM/MutationType.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::DOM::MutationType { @@ -15,7 +15,7 @@ namespace Web::DOM::MutationType { __ENUMERATE_MUTATION_TYPE(characterData) \ __ENUMERATE_MUTATION_TYPE(childList) -#define __ENUMERATE_MUTATION_TYPE(name) extern FlyString name; +#define __ENUMERATE_MUTATION_TYPE(name) extern DeprecatedFlyString name; ENUMERATE_MUTATION_TYPES #undef __ENUMERATE_MUTATION_TYPE diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 8d2102de5a2..634613a2d5e 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -301,7 +301,7 @@ JS::Value NamedNodeMap::item_value(size_t index) const return node; } -JS::Value NamedNodeMap::named_item_value(FlyString const& name) const +JS::Value NamedNodeMap::named_item_value(DeprecatedFlyString const& name) const { auto const* node = get_named_item(name); if (!node) diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h index e8ccfad02e3..2cb81271b18 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h @@ -28,7 +28,7 @@ public: virtual bool is_supported_property_index(u32 index) const override; virtual Vector supported_property_names() const override; virtual JS::Value item_value(size_t index) const override; - virtual JS::Value named_item_value(FlyString const& name) const override; + virtual JS::Value named_item_value(DeprecatedFlyString const& name) const override; size_t length() const { return m_attributes.size(); } bool is_empty() const { return m_attributes.is_empty(); } diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 29296824656..5da4574a659 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -126,7 +126,7 @@ const HTML::HTMLElement* Node::enclosing_html_element() const return first_ancestor_of_type(); } -const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const +const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(DeprecatedFlyString const& attribute) const { for (auto* node = this; node; node = node->parent()) { if (is(*node) && verify_cast(*node).has_attribute(attribute)) @@ -1375,7 +1375,7 @@ Painting::PaintableBox const* Node::paint_box() const } // https://dom.spec.whatwg.org/#queue-a-mutation-record -void Node::queue_mutation_record(FlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr added_nodes, JS::NonnullGCPtr removed_nodes, Node* previous_sibling, Node* next_sibling) +void Node::queue_mutation_record(DeprecatedFlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr added_nodes, JS::NonnullGCPtr removed_nodes, Node* previous_sibling, Node* next_sibling) { // NOTE: We defer garbage collection until the end of the scope, since we can't safely use MutationObserver* as a hashmap key otherwise. // FIXME: This is a total hack. diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 01bfbe6cea3..580f4e347f9 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -108,7 +108,7 @@ public: JS::NonnullGCPtr child_nodes(); Vector> children_as_vector() const; - virtual FlyString node_name() const = 0; + virtual DeprecatedFlyString node_name() const = 0; DeprecatedString base_uri() const; @@ -126,7 +126,7 @@ public: const HTML::HTMLAnchorElement* enclosing_link_element() const; const HTML::HTMLElement* enclosing_html_element() const; - const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const; + const HTML::HTMLElement* enclosing_html_element_with_attribute(DeprecatedFlyString const&) const; DeprecatedString child_text_content() const; @@ -223,7 +223,7 @@ public: void add_registered_observer(RegisteredObserver& registered_observer) { m_registered_observer_list.append(registered_observer); } - void queue_mutation_record(FlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr added_nodes, JS::NonnullGCPtr removed_nodes, Node* previous_sibling, Node* next_sibling); + void queue_mutation_record(DeprecatedFlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr added_nodes, JS::NonnullGCPtr removed_nodes, Node* previous_sibling, Node* next_sibling); // https://dom.spec.whatwg.org/#concept-shadow-including-descendant template diff --git a/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h b/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h index 8956e023f68..060e1e1eeb7 100644 --- a/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h +++ b/Userland/Libraries/LibWeb/DOM/NonElementParentNode.h @@ -17,7 +17,7 @@ namespace Web::DOM { template class NonElementParentNode { public: - JS::GCPtr get_element_by_id(FlyString const& id) const + JS::GCPtr get_element_by_id(DeprecatedFlyString const& id) const { JS::GCPtr found_element; static_cast(this)->template for_each_in_inclusive_subtree_of_type([&](auto& element) { @@ -29,7 +29,7 @@ public: }); return found_element; } - JS::GCPtr get_element_by_id(FlyString const& id) + JS::GCPtr get_element_by_id(DeprecatedFlyString const& id) { return const_cast(this)->get_element_by_id(id); } diff --git a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp index c27765d43fe..8654ac65261 100644 --- a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp +++ b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp @@ -103,7 +103,7 @@ JS::NonnullGCPtr ParentNode::children() // https://dom.spec.whatwg.org/#concept-getelementsbytagname // NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication. -JS::NonnullGCPtr ParentNode::get_elements_by_tag_name(FlyString const& qualified_name) +JS::NonnullGCPtr ParentNode::get_elements_by_tag_name(DeprecatedFlyString const& qualified_name) { // 1. If qualifiedName is "*" (U+002A), return a HTMLCollection rooted at root, whose filter matches only descendant elements. if (qualified_name == "*") { @@ -132,7 +132,7 @@ JS::NonnullGCPtr ParentNode::get_elements_by_tag_name(FlyString // https://dom.spec.whatwg.org/#concept-getelementsbytagnamens // NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication. -JS::NonnullGCPtr ParentNode::get_elements_by_tag_name_ns(FlyString const& nullable_namespace, FlyString const& local_name) +JS::NonnullGCPtr ParentNode::get_elements_by_tag_name_ns(DeprecatedFlyString const& nullable_namespace, DeprecatedFlyString const& local_name) { // 1. If namespace is the empty string, set it to null. DeprecatedString namespace_ = nullable_namespace; diff --git a/Userland/Libraries/LibWeb/DOM/ParentNode.h b/Userland/Libraries/LibWeb/DOM/ParentNode.h index 5dd6acf4d94..4501822bd34 100644 --- a/Userland/Libraries/LibWeb/DOM/ParentNode.h +++ b/Userland/Libraries/LibWeb/DOM/ParentNode.h @@ -28,8 +28,8 @@ public: JS::NonnullGCPtr children(); - JS::NonnullGCPtr get_elements_by_tag_name(FlyString const&); - JS::NonnullGCPtr get_elements_by_tag_name_ns(FlyString const&, FlyString const&); + JS::NonnullGCPtr get_elements_by_tag_name(DeprecatedFlyString const&); + JS::NonnullGCPtr get_elements_by_tag_name_ns(DeprecatedFlyString const&, DeprecatedFlyString const&); WebIDL::ExceptionOr prepend(Vector, DeprecatedString>> const& nodes); WebIDL::ExceptionOr append(Vector, DeprecatedString>> const& nodes); diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h index 6d6e6ff1600..f4f989b98ba 100644 --- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h +++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include namespace Web::DOM { @@ -17,7 +17,7 @@ class ProcessingInstruction final : public CharacterData { public: virtual ~ProcessingInstruction() override = default; - virtual FlyString node_name() const override { return m_target; } + virtual DeprecatedFlyString node_name() const override { return m_target; } DeprecatedString const& target() const { return m_target; } diff --git a/Userland/Libraries/LibWeb/DOM/QualifiedName.cpp b/Userland/Libraries/LibWeb/DOM/QualifiedName.cpp index f713ab8e193..46ee475ea83 100644 --- a/Userland/Libraries/LibWeb/DOM/QualifiedName.cpp +++ b/Userland/Libraries/LibWeb/DOM/QualifiedName.cpp @@ -25,7 +25,7 @@ struct ImplTraits : public Traits { static HashTable impls; -static NonnullRefPtr ensure_impl(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_) +static NonnullRefPtr ensure_impl(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_) { auto hash = pair_int_hash(local_name.hash(), pair_int_hash(prefix.hash(), namespace_.hash())); auto it = impls.find(hash, [&](QualifiedName::Impl* entry) { @@ -38,12 +38,12 @@ static NonnullRefPtr ensure_impl(FlyString const& local_nam return adopt_ref(*new QualifiedName::Impl(local_name, prefix, namespace_)); } -QualifiedName::QualifiedName(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_) +QualifiedName::QualifiedName(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_) : m_impl(ensure_impl(local_name, prefix, namespace_)) { } -QualifiedName::Impl::Impl(FlyString const& a_local_name, FlyString const& a_prefix, FlyString const& a_namespace) +QualifiedName::Impl::Impl(DeprecatedFlyString const& a_local_name, DeprecatedFlyString const& a_prefix, DeprecatedFlyString const& a_namespace) : local_name(a_local_name) , prefix(a_prefix) , namespace_(a_namespace) diff --git a/Userland/Libraries/LibWeb/DOM/QualifiedName.h b/Userland/Libraries/LibWeb/DOM/QualifiedName.h index 9bc0a0507e4..14d69d60bc9 100644 --- a/Userland/Libraries/LibWeb/DOM/QualifiedName.h +++ b/Userland/Libraries/LibWeb/DOM/QualifiedName.h @@ -7,28 +7,28 @@ #pragma once -#include +#include namespace Web::DOM { class QualifiedName { public: - QualifiedName(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_); + QualifiedName(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_); - FlyString const& local_name() const { return m_impl->local_name; } - FlyString const& prefix() const { return m_impl->prefix; } - FlyString const& namespace_() const { return m_impl->namespace_; } + DeprecatedFlyString const& local_name() const { return m_impl->local_name; } + DeprecatedFlyString const& prefix() const { return m_impl->prefix; } + DeprecatedFlyString const& namespace_() const { return m_impl->namespace_; } DeprecatedString const& as_string() const { return m_impl->as_string; } struct Impl : public RefCounted { - Impl(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_); + Impl(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_); ~Impl(); void make_internal_string(); - FlyString local_name; - FlyString prefix; - FlyString namespace_; + DeprecatedFlyString local_name; + DeprecatedFlyString prefix; + DeprecatedFlyString namespace_; DeprecatedString as_string; }; diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h index 843ec98128b..327cf40a89b 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h @@ -35,7 +35,7 @@ private: ShadowRoot(Document&, Element&); // ^Node - virtual FlyString node_name() const override { return "#shadow-root"; } + virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; } virtual bool is_shadow_root() const final { return true; } // NOTE: The specification doesn't seem to specify a default value for closed. Assuming false for now. diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h index bca9bca7777..86663192e15 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.h +++ b/Userland/Libraries/LibWeb/DOM/Text.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include namespace Web::DOM { @@ -21,7 +21,7 @@ public: static JS::NonnullGCPtr construct_impl(JS::Realm& realm, DeprecatedString const& data); // ^Node - virtual FlyString node_name() const override { return "#text"; } + virtual DeprecatedFlyString node_name() const override { return "#text"; } virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); } void set_always_editable(bool b) { m_always_editable = b; } diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index 42f5d23ca05..a06ff25f4ab 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -41,7 +41,7 @@ WebIDL::ExceptionOr XMLSerializer::serialize_to_string(JS::Non } // https://w3c.github.io/DOM-Parsing/#dfn-add -static void add_prefix_to_namespace_prefix_map(HashMap>& prefix_map, DeprecatedString const& prefix, FlyString const& namespace_) +static void add_prefix_to_namespace_prefix_map(HashMap>& prefix_map, DeprecatedString const& prefix, DeprecatedFlyString const& namespace_) { // 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns or if there is no such key, then let candidates list be null. auto candidates_list_iterator = prefix_map.find(namespace_); @@ -59,7 +59,7 @@ static void add_prefix_to_namespace_prefix_map(HashMap retrieve_a_preferred_prefix_string(DeprecatedString const& preferred_prefix, HashMap> const& namespace_prefix_map, FlyString const& namespace_) +static Optional retrieve_a_preferred_prefix_string(DeprecatedString const& preferred_prefix, HashMap> const& namespace_prefix_map, DeprecatedFlyString const& namespace_) { // 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns or if there is no such key, // then stop running these steps, and return the null value. @@ -85,7 +85,7 @@ static Optional retrieve_a_preferred_prefix_string(DeprecatedS } // https://w3c.github.io/DOM-Parsing/#dfn-generating-a-prefix -static DeprecatedString generate_a_prefix(HashMap>& namespace_prefix_map, FlyString const& new_namespace, u64& prefix_index) +static DeprecatedString generate_a_prefix(HashMap>& namespace_prefix_map, DeprecatedFlyString const& new_namespace, u64& prefix_index) { // 1. Let generated prefix be the concatenation of the string "ns" and the current numerical value of prefix index. auto generated_prefix = DeprecatedString::formatted("ns{}", prefix_index); @@ -101,7 +101,7 @@ static DeprecatedString generate_a_prefix(HashMap> const& namespace_prefix_map, FlyString const& namespace_) +static bool prefix_is_in_prefix_map(DeprecatedString const& prefix, HashMap> const& namespace_prefix_map, DeprecatedFlyString const& namespace_) { // 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns // or if there is no such key, then stop running these steps, and return false. @@ -113,7 +113,7 @@ static bool prefix_is_in_prefix_map(DeprecatedString const& prefix, HashMapvalue.contains_slow(prefix); } -WebIDL::ExceptionOr serialize_node_to_xml_string_impl(JS::NonnullGCPtr root, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); +WebIDL::ExceptionOr serialize_node_to_xml_string_impl(JS::NonnullGCPtr root, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); // https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization WebIDL::ExceptionOr serialize_node_to_xml_string(JS::NonnullGCPtr root, RequireWellFormed require_well_formed) @@ -121,10 +121,10 @@ WebIDL::ExceptionOr serialize_node_to_xml_string(JS::NonnullGC // 1. Let namespace be a context namespace with value null. The context namespace tracks the XML serialization algorithm's current default namespace. // The context namespace is changed when either an Element Node has a default namespace declaration, or the algorithm generates a default namespace declaration // for the Element Node to match its own namespace. The algorithm assumes no namespace (null) to start. - Optional namespace_; + Optional namespace_; // 2. Let prefix map be a new namespace prefix map. - HashMap> prefix_map; + HashMap> prefix_map; // 3. Add the XML namespace with prefix value "xml" to prefix map. add_prefix_to_namespace_prefix_map(prefix_map, "xml"sv, Namespace::XML); @@ -140,16 +140,16 @@ WebIDL::ExceptionOr serialize_node_to_xml_string(JS::NonnullGC return serialize_node_to_xml_string_impl(root, namespace_, prefix_map, prefix_index, require_well_formed); } -static WebIDL::ExceptionOr serialize_element(DOM::Element const& element, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); -static WebIDL::ExceptionOr serialize_document(DOM::Document const& document, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); +static WebIDL::ExceptionOr serialize_element(DOM::Element const& element, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); +static WebIDL::ExceptionOr serialize_document(DOM::Document const& document, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); static WebIDL::ExceptionOr serialize_comment(DOM::Comment const& comment, RequireWellFormed require_well_formed); static WebIDL::ExceptionOr serialize_text(DOM::Text const& text, RequireWellFormed require_well_formed); -static WebIDL::ExceptionOr serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); +static WebIDL::ExceptionOr serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed); static WebIDL::ExceptionOr serialize_document_type(DOM::DocumentType const& document_type, RequireWellFormed require_well_formed); static WebIDL::ExceptionOr serialize_processing_instruction(DOM::ProcessingInstruction const& processing_instruction, RequireWellFormed require_well_formed); // https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization-algorithm -WebIDL::ExceptionOr serialize_node_to_xml_string_impl(JS::NonnullGCPtr root, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) +WebIDL::ExceptionOr serialize_node_to_xml_string_impl(JS::NonnullGCPtr root, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) { // Each of the following algorithms for producing an XML serialization of a DOM node take as input a node to serialize and the following arguments: // - A context namespace namespace @@ -216,7 +216,7 @@ WebIDL::ExceptionOr serialize_node_to_xml_string_impl(JS::Nonn } // https://w3c.github.io/DOM-Parsing/#dfn-recording-the-namespace-information -static Optional record_namespace_information(DOM::Element const& element, HashMap>& namespace_prefix_map, HashMap& local_prefix_map) +static Optional record_namespace_information(DOM::Element const& element, HashMap>& namespace_prefix_map, HashMap& local_prefix_map) { // 1. Let default namespace attr value be null. Optional default_namespace_attribute_value; @@ -306,7 +306,7 @@ struct LocalNameSetEntry { }; // https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization-of-the-attributes -static WebIDL::ExceptionOr serialize_element_attributes(DOM::Element const& element, HashMap>& namespace_prefix_map, u64& prefix_index, HashMap const& local_prefixes_map, bool ignore_namespace_definition_attribute, RequireWellFormed require_well_formed) +static WebIDL::ExceptionOr serialize_element_attributes(DOM::Element const& element, HashMap>& namespace_prefix_map, u64& prefix_index, HashMap const& local_prefixes_map, bool ignore_namespace_definition_attribute, RequireWellFormed require_well_formed) { auto& realm = element.realm(); @@ -459,7 +459,7 @@ static WebIDL::ExceptionOr serialize_element_attributes(DOM::E } // https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node -static WebIDL::ExceptionOr serialize_element(DOM::Element const& element, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) +static WebIDL::ExceptionOr serialize_element(DOM::Element const& element, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) { auto& realm = element.realm(); @@ -486,7 +486,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons bool ignore_namespace_definition_attribute = false; // 6. Given prefix map, copy a namespace prefix map and let map be the result. - HashMap> map; + HashMap> map; // https://w3c.github.io/DOM-Parsing/#dfn-copy-a-namespace-prefix-map // NOTE: This is only used here. @@ -701,7 +701,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons } // https://w3c.github.io/DOM-Parsing/#xml-serializing-a-document-node -static WebIDL::ExceptionOr serialize_document(DOM::Document const& document, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) +static WebIDL::ExceptionOr serialize_document(DOM::Document const& document, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) { // If the require well-formed flag is set (its value is true), and this node has no documentElement (the documentElement attribute's value is null), // then throw an exception; the serialization of this node would not be a well-formed document. @@ -763,7 +763,7 @@ static WebIDL::ExceptionOr serialize_text(DOM::Text const& tex } // https://w3c.github.io/DOM-Parsing/#xml-serializing-a-documentfragment-node -static WebIDL::ExceptionOr serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) +static WebIDL::ExceptionOr serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional& namespace_, HashMap>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed) { // 1. Let markup the empty string. StringBuilder markup; diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 64d1596cc14..fc163df6670 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -92,7 +92,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho for (size_t i = 0; i < indent; ++i) builder.append(" "sv); - FlyString tag_name; + DeprecatedFlyString tag_name; if (layout_node.is_anonymous()) tag_name = "(anonymous)"; else if (is(layout_node.dom_node())) diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp index bbcb29d4620..1979ef261c2 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include @@ -12,7 +12,7 @@ namespace Web::Encoding { -WebIDL::ExceptionOr> TextDecoder::construct_impl(JS::Realm& realm, FlyString encoding) +WebIDL::ExceptionOr> TextDecoder::construct_impl(JS::Realm& realm, DeprecatedFlyString encoding) { auto decoder = TextCodec::decoder_for(encoding); if (!decoder) @@ -22,7 +22,7 @@ WebIDL::ExceptionOr> TextDecoder::construct_impl(J } // https://encoding.spec.whatwg.org/#dom-textdecoder -TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, FlyString encoding, bool fatal, bool ignore_bom) +TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, DeprecatedFlyString encoding, bool fatal, bool ignore_bom) : PlatformObject(realm) , m_decoder(decoder) , m_encoding(move(encoding)) diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h index f2f2a753398..450ca2dbb5d 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h @@ -21,22 +21,22 @@ class TextDecoder : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(TextDecoder, Bindings::PlatformObject); public: - static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString encoding); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, DeprecatedFlyString encoding); virtual ~TextDecoder() override; WebIDL::ExceptionOr decode(JS::Handle const&) const; - FlyString const& encoding() const { return m_encoding; } + DeprecatedFlyString const& encoding() const { return m_encoding; } bool fatal() const { return m_fatal; } bool ignore_bom() const { return m_ignore_bom; }; private: // https://encoding.spec.whatwg.org/#dom-textdecoder - TextDecoder(JS::Realm&, TextCodec::Decoder&, FlyString encoding, bool fatal, bool ignore_bom); + TextDecoder(JS::Realm&, TextCodec::Decoder&, DeprecatedFlyString encoding, bool fatal, bool ignore_bom); TextCodec::Decoder& m_decoder; - FlyString m_encoding; + DeprecatedFlyString m_encoding; bool m_fatal { false }; bool m_ignore_bom { false }; }; diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp index f5128b6520f..c1a44767dc0 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include @@ -44,9 +44,9 @@ JS::Uint8Array* TextEncoder::encode(DeprecatedString const& input) const } // https://encoding.spec.whatwg.org/#dom-textencoder-encoding -FlyString const& TextEncoder::encoding() +DeprecatedFlyString const& TextEncoder::encoding() { - static FlyString encoding = "utf-8"sv; + static DeprecatedFlyString encoding = "utf-8"sv; return encoding; } diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h index 8161d2f9dea..02eb55d736b 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h @@ -26,7 +26,7 @@ public: JS::Uint8Array* encode(DeprecatedString const& input) const; - static FlyString const& encoding(); + static DeprecatedFlyString const& encoding(); protected: // https://encoding.spec.whatwg.org/#dom-textencoder diff --git a/Userland/Libraries/LibWeb/FontCache.h b/Userland/Libraries/LibWeb/FontCache.h index 56d5e1b8b63..da6d7d996df 100644 --- a/Userland/Libraries/LibWeb/FontCache.h +++ b/Userland/Libraries/LibWeb/FontCache.h @@ -6,14 +6,14 @@ #pragma once +#include #include -#include #include #include #include struct FontSelector { - FlyString family; + DeprecatedFlyString family; float point_size { 0 }; int weight { 0 }; int slope { 0 }; diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp index 9bc32452bf8..3d4d0b88fa4 100644 --- a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp +++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp @@ -10,7 +10,7 @@ namespace Web { namespace HTML { namespace AttributeNames { -#define __ENUMERATE_HTML_ATTRIBUTE(name) FlyString name; +#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name; ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE @@ -41,7 +41,7 @@ ENUMERATE_HTML_ATTRIBUTES } // https://html.spec.whatwg.org/#boolean-attribute -bool is_boolean_attribute(FlyString const& attribute) +bool is_boolean_attribute(DeprecatedFlyString const& attribute) { // NOTE: This is the list of attributes from https://html.spec.whatwg.org/#attributes-3 // with a Value column value of "Boolean attribute". diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.h b/Userland/Libraries/LibWeb/HTML/AttributeNames.h index 88d83e94d81..399a820812d 100644 --- a/Userland/Libraries/LibWeb/HTML/AttributeNames.h +++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web { namespace HTML { @@ -229,13 +229,13 @@ namespace AttributeNames { __ENUMERATE_HTML_ATTRIBUTE(width) \ __ENUMERATE_HTML_ATTRIBUTE(wrap) -#define __ENUMERATE_HTML_ATTRIBUTE(name) extern FlyString name; +#define __ENUMERATE_HTML_ATTRIBUTE(name) extern DeprecatedFlyString name; ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE } -bool is_boolean_attribute(FlyString const& attribute); +bool is_boolean_attribute(DeprecatedFlyString const& attribute); } } diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp index 80b5ea3d07f..1dbd77d1d1f 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -CloseEvent* CloseEvent::create(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init) +CloseEvent* CloseEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init) +CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init) { return create(realm, event_name, event_init); } -CloseEvent::CloseEvent(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init) +CloseEvent::CloseEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_was_clean(event_init.was_clean) , m_code(event_init.code) diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.h b/Userland/Libraries/LibWeb/HTML/CloseEvent.h index 7e92f76f9b1..6c94be526db 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.h +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.h @@ -21,8 +21,8 @@ class CloseEvent : public DOM::Event { WEB_PLATFORM_OBJECT(CloseEvent, DOM::Event); public: - static CloseEvent* create(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init = {}); - static CloseEvent* construct_impl(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init); + static CloseEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init = {}); + static CloseEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init); virtual ~CloseEvent() override; @@ -31,7 +31,7 @@ public: DeprecatedString reason() const { return m_reason; } private: - CloseEvent(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init); + CloseEvent(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init); bool m_was_clean { false }; u16 m_code { 0 }; diff --git a/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp b/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp index f1dcf32c692..8ae01fdf5f2 100644 --- a/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp @@ -59,7 +59,7 @@ Vector cross_origin_properties(Variant property_names { + static Array property_names { "window"sv, "self"sv, "location"sv, "close"sv, "closed"sv, "focus"sv, "blur"sv, "frames"sv, "length"sv, "top"sv, "opener"sv, "parent"sv, "postMessage"sv }; return (property_key.is_string() && any_of(property_names, [&](auto const& name) { return property_key.as_string() == name; })) || property_key.is_number(); diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 2df3643a1a5..a9b2f6b5036 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -183,7 +183,7 @@ bool DOMStringMap::delete_existing_named_property(DeprecatedString const& name) return true; } -JS::Value DOMStringMap::named_item_value(FlyString const& name) const +JS::Value DOMStringMap::named_item_value(DeprecatedFlyString const& name) const { return JS::PrimitiveString::create(vm(), determine_value_of_named_property(name)); } diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.h b/Userland/Libraries/LibWeb/HTML/DOMStringMap.h index 79dadd85c35..c8d12cab720 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.h +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.h @@ -34,7 +34,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; // ^LegacyPlatformObject - virtual JS::Value named_item_value(FlyString const&) const override; + virtual JS::Value named_item_value(DeprecatedFlyString const&) const override; virtual Vector supported_property_names() const override; struct NameValuePair { diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp index 55b0620ba26..e557705fc7b 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -ErrorEvent* ErrorEvent::create(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init) +ErrorEvent* ErrorEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -ErrorEvent* ErrorEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init) +ErrorEvent* ErrorEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init) { return create(realm, event_name, event_init); } -ErrorEvent::ErrorEvent(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init) +ErrorEvent::ErrorEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init) : DOM::Event(realm, event_name) , m_message(event_init.message) , m_filename(event_init.filename) diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.h b/Userland/Libraries/LibWeb/HTML/ErrorEvent.h index 6a8574ffdf8..e4ce4ba2fdb 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.h +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.h @@ -24,8 +24,8 @@ class ErrorEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(ErrorEvent, DOM::Event); public: - static ErrorEvent* create(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init = {}); - static ErrorEvent* construct_impl(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init); + static ErrorEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init = {}); + static ErrorEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init); virtual ~ErrorEvent() override; @@ -45,7 +45,7 @@ public: JS::Value error() const { return m_error; } private: - ErrorEvent(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init); + ErrorEvent(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init); virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/EventNames.cpp b/Userland/Libraries/LibWeb/HTML/EventNames.cpp index 43f611a08bb..f0c0d2e58d1 100644 --- a/Userland/Libraries/LibWeb/HTML/EventNames.cpp +++ b/Userland/Libraries/LibWeb/HTML/EventNames.cpp @@ -8,7 +8,7 @@ namespace Web::HTML::EventNames { -#define __ENUMERATE_HTML_EVENT(name) FlyString name; +#define __ENUMERATE_HTML_EVENT(name) DeprecatedFlyString name; ENUMERATE_HTML_EVENTS #undef __ENUMERATE_HTML_EVENT diff --git a/Userland/Libraries/LibWeb/HTML/EventNames.h b/Userland/Libraries/LibWeb/HTML/EventNames.h index 05fb2bf4d54..911f2bd5cf0 100644 --- a/Userland/Libraries/LibWeb/HTML/EventNames.h +++ b/Userland/Libraries/LibWeb/HTML/EventNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::HTML::EventNames { @@ -60,7 +60,7 @@ namespace Web::HTML::EventNames { __ENUMERATE_HTML_EVENT(unload) \ __ENUMERATE_HTML_EVENT(visibilitychange) -#define __ENUMERATE_HTML_EVENT(name) extern FlyString name; +#define __ENUMERATE_HTML_EVENT(name) extern DeprecatedFlyString name; ENUMERATE_HTML_EVENTS #undef __ENUMERATE_HTML_EVENT diff --git a/Userland/Libraries/LibWeb/HTML/GlobalEventHandlers.h b/Userland/Libraries/LibWeb/HTML/GlobalEventHandlers.h index 23c1908be21..0d6b18a44b8 100644 --- a/Userland/Libraries/LibWeb/HTML/GlobalEventHandlers.h +++ b/Userland/Libraries/LibWeb/HTML/GlobalEventHandlers.h @@ -91,7 +91,7 @@ public: #undef __ENUMERATE protected: - virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) = 0; + virtual DOM::EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) = 0; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index 073c160df17..6482ff09c07 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -22,7 +22,7 @@ HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName HTMLAnchorElement::~HTMLAnchorElement() = default; -void HTMLAnchorElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLAnchorElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); if (name == HTML::AttributeNames::href) { @@ -85,7 +85,7 @@ i32 HTMLAnchorElement::default_tab_index_value() const return 0; } -FlyString HTMLAnchorElement::default_role() const +DeprecatedFlyString HTMLAnchorElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-a-no-href if (!href().is_null()) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h index 3356a214004..88cba8c5540 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h @@ -35,7 +35,7 @@ private: void run_activation_behavior(Web::DOM::Event const&); // ^DOM::Element - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils @@ -51,7 +51,7 @@ private: queue_an_element_task(source, move(steps)); } - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index 05bf0624665..ab3efa3f347 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -18,7 +18,7 @@ HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qua HTMLAreaElement::~HTMLAreaElement() = default; -void HTMLAreaElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLAreaElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); if (name == HTML::AttributeNames::href) { @@ -43,7 +43,7 @@ i32 HTMLAreaElement::default_tab_index_value() const return 0; } -FlyString HTMLAreaElement::default_role() const +DeprecatedFlyString HTMLAreaElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-area-no-href if (!href().is_null()) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h index 80398dd0a65..4140fdea31b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h @@ -24,7 +24,7 @@ private: HTMLAreaElement(DOM::Document&, DOM::QualifiedName); // ^DOM::Element - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils @@ -40,7 +40,7 @@ private: queue_an_element_task(source, move(steps)); } - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index 66d41240df1..4bbbf5584c7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -38,7 +38,7 @@ void HTMLBaseElement::removed_from(Node* parent) document().update_base_element({}); } -void HTMLBaseElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLBaseElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h index 9cc5c5fa9a7..3634f847d90 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -23,7 +23,7 @@ public: virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; private: HTMLBaseElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 5a887ca809d..ea1f4015e2d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -38,7 +38,7 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co }); } -void HTMLBodyElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLBodyElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); if (name.equals_ignoring_case("link"sv)) { @@ -71,7 +71,7 @@ void HTMLBodyElement::parse_attribute(FlyString const& name, DeprecatedString co #undef __ENUMERATE } -DOM::EventTarget& HTMLBodyElement::global_event_handlers_to_event_target(FlyString const& event_name) +DOM::EventTarget& HTMLBodyElement::global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) { // NOTE: This is a little weird, but IIUC document.body.onload actually refers to window.onload // NOTE: document.body can return either a HTMLBodyElement or HTMLFrameSetElement, so both these elements must support this mapping. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h index e1ff7613cbc..1fb06052d55 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h @@ -20,17 +20,17 @@ class HTMLBodyElement final public: virtual ~HTMLBodyElement() override; - virtual void parse_attribute(FlyString const&, DeprecatedString const&) override; + virtual void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-body - virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; }; + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; }; private: HTMLBodyElement(DOM::Document&, DOM::QualifiedName); // ^HTML::GlobalEventHandlers - virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override; + virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) override; // ^HTML::WindowEventHandlers virtual EventTarget& window_event_handlers_to_event_target() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h index 64c80335269..82f9646fdd3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h @@ -55,7 +55,7 @@ public: virtual bool is_labelable() const override { return true; } // https://www.w3.org/TR/html-aria/#el-button - virtual FlyString default_role() const override { return DOM::ARIARoleNames::button; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::button; } private: HTMLButtonElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h index c2e0a6ad67c..45b4e0aa34c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLDataElement() override; // https://www.w3.org/TR/html-aria/#el-data - virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; } private: HTMLDataElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h index 4de4419fb9e..1decc6f6a0d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h @@ -17,7 +17,7 @@ class HTMLDataListElement final : public HTMLElement { public: virtual ~HTMLDataListElement() override; - virtual FlyString default_role() const override { return DOM::ARIARoleNames::listbox; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::listbox; } private: HTMLDataListElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h index 26eedd4219f..11082c9ea42 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLDetailsElement() override; // https://www.w3.org/TR/html-aria/#el-details - virtual FlyString default_role() const override { return DOM::ARIARoleNames::group; }; + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::group; }; private: HTMLDetailsElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h index b81e6c1d3cc..4dbb6fc0345 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLDialogElement() override; // https://www.w3.org/TR/html-aria/#el-dialog - virtual FlyString default_role() const override { return DOM::ARIARoleNames::dialog; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::dialog; } private: HTMLDialogElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h index 0dda8e975f6..064515fa9bc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLDivElement() override; // https://www.w3.org/TR/html-aria/#el-div - virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; } private: HTMLDivElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 27c5447f87c..35a146ac07a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -232,7 +232,7 @@ bool HTMLElement::cannot_navigate() const return !is(this) && !is_connected(); } -void HTMLElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { Element::parse_attribute(name, value); @@ -270,7 +270,7 @@ void HTMLElement::focus() } // https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-pointer-event -bool HTMLElement::fire_a_synthetic_pointer_event(FlyString const& type, DOM::Element& target, bool not_trusted) +bool HTMLElement::fire_a_synthetic_pointer_event(DeprecatedFlyString const& type, DOM::Element& target, bool not_trusted) { // 1. Let event be the result of creating an event using PointerEvent. // 2. Initialize event's type attribute to e. @@ -328,7 +328,7 @@ void HTMLElement::blur() // User agents may selectively or uniformly ignore calls to this method for usability reasons. } -FlyString HTMLElement::default_role() const +DeprecatedFlyString HTMLElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-article if (local_name() == TagNames::article) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h index 9e1c1a402ec..a31d67f0b41 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h @@ -54,19 +54,19 @@ public: void blur(); - bool fire_a_synthetic_pointer_event(FlyString const& type, DOM::Element& target, bool not_trusted); + bool fire_a_synthetic_pointer_event(DeprecatedFlyString const& type, DOM::Element& target, bool not_trusted); // https://html.spec.whatwg.org/multipage/forms.html#category-label virtual bool is_labelable() const { return false; } - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; protected: HTMLElement(DOM::Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual void visit_edges(Cell::Visitor&) override; @@ -74,7 +74,7 @@ private: virtual bool is_html_element() const final { return true; } // ^HTML::GlobalEventHandlers - virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; } + virtual DOM::EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const&) override { return *this; } enum class ContentEditableState { True, diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index 532b62da3e6..6b2e3ab1fa4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -36,7 +36,7 @@ public: // https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize virtual bool is_auto_capitalize_inheriting() const override { return true; } - virtual FlyString default_role() const override { return DOM::ARIARoleNames::group; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::group; } private: HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h index e380d68d1df..928c469d3be 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h @@ -38,7 +38,7 @@ public: unsigned length() const; // https://www.w3.org/TR/html-aria/#el-form - virtual FlyString default_role() const override { return DOM::ARIARoleNames::form; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::form; } private: HTMLFormElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index c5359f55866..90af8cf9103 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -18,7 +18,7 @@ HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::Qualified HTMLFrameSetElement::~HTMLFrameSetElement() = default; -void HTMLFrameSetElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLFrameSetElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); @@ -31,7 +31,7 @@ void HTMLFrameSetElement::parse_attribute(FlyString const& name, DeprecatedStrin #undef __ENUMERATE } -DOM::EventTarget& HTMLFrameSetElement::global_event_handlers_to_event_target(FlyString const& event_name) +DOM::EventTarget& HTMLFrameSetElement::global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) { // NOTE: This is a little weird, but IIUC document.body.onload actually refers to window.onload // NOTE: document.body can return either a HTMLBodyElement or HTMLFrameSetElement, so both these elements must support this mapping. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index 371e1ca1d2b..0a3ef76f588 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -23,11 +23,11 @@ public: private: HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); - virtual void parse_attribute(FlyString const&, DeprecatedString const&) override; + virtual void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override; private: // ^HTML::GlobalEventHandlers - virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override; + virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) override; // ^HTML::WindowEventHandlers virtual EventTarget& window_event_handlers_to_event_target() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h index 4b13e4882e6..e1c4e9ef84e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLHRElement() override; // https://www.w3.org/TR/html-aria/#el-hr - virtual FlyString default_role() const override { return DOM::ARIARoleNames::separator; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::separator; } private: HTMLHRElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h index 6093993ce3a..892c1fcbe0e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h @@ -20,7 +20,7 @@ public: virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-h1-h6 - virtual FlyString default_role() const override { return DOM::ARIARoleNames::heading; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::heading; } virtual DeprecatedString aria_level() const override { // TODO: aria-level = the number in the element's tag name diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h index 272d6af62a6..88014cdaeb0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h @@ -20,7 +20,7 @@ public: bool should_use_body_background_properties() const; // https://www.w3.org/TR/html-aria/#el-html - virtual FlyString default_role() const override { return DOM::ARIARoleNames::document; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::document; } private: HTMLHtmlElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 2713f7563fe..92b760a7e24 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -27,7 +27,7 @@ JS::GCPtr HTMLIFrameElement::create_layout_node(NonnullRefPtr(document(), *this, move(style)); } -void HTMLIFrameElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLIFrameElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); if (name == HTML::AttributeNames::src) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 95a24d1e835..d10dd68e305 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -31,7 +31,7 @@ private: // ^DOM::Element virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 55cb5e47371..411717ee0bf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -73,7 +73,7 @@ void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) c }); } -void HTMLImageElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLImageElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); @@ -198,7 +198,7 @@ bool HTMLImageElement::complete() const return false; } -FlyString HTMLImageElement::default_role() const +DeprecatedFlyString HTMLImageElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-img // https://www.w3.org/TR/html-aria/#el-img-no-alt diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h index ee72cfa1ab4..94b6d8a5c54 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -24,7 +24,7 @@ class HTMLImageElement final public: virtual ~HTMLImageElement() override; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; DeprecatedString alt() const { return attribute(HTML::AttributeNames::alt); } DeprecatedString src() const { return attribute(HTML::AttributeNames::src); } @@ -43,7 +43,7 @@ public: // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-complete bool complete() const; - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLImageElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index ae20f490aaa..3c20012d638 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -404,7 +404,7 @@ void HTMLInputElement::did_receive_focus() browsing_context->set_cursor_position(DOM::Position { *m_text_node, 0 }); } -void HTMLInputElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLInputElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); if (name == HTML::AttributeNames::checked) { @@ -434,7 +434,7 @@ HTMLInputElement::TypeAttributeState HTMLInputElement::parse_type_attribute(Stri return HTMLInputElement::TypeAttributeState::Text; } -void HTMLInputElement::did_remove_attribute(FlyString const& name) +void HTMLInputElement::did_remove_attribute(DeprecatedFlyString const& name) { HTMLElement::did_remove_attribute(name); if (name == HTML::AttributeNames::checked) { @@ -866,7 +866,7 @@ WebIDL::ExceptionOr HTMLInputElement::set_selection_range(u32 start, u32 e return {}; } -FlyString HTMLInputElement::default_role() const +DeprecatedFlyString HTMLInputElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-input-button if (type_state() == TypeAttributeState::Button) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h index 8bb9b4ee2fe..f9e0b369dc6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -96,8 +96,8 @@ public: virtual bool is_focusable() const override { return m_type != TypeAttributeState::Hidden; } // ^HTMLElement - virtual void parse_attribute(FlyString const&, DeprecatedString const&) override; - virtual void did_remove_attribute(FlyString const&) override; + virtual void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override; + virtual void did_remove_attribute(DeprecatedFlyString const&) override; // ^FormAssociatedElement // https://html.spec.whatwg.org/multipage/forms.html#category-listed @@ -120,7 +120,7 @@ public: // https://html.spec.whatwg.org/multipage/forms.html#category-label virtual bool is_labelable() const override { return type_state() != TypeAttributeState::Hidden; } - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLInputElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h index 6b5ed2b23e7..082670302ae 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLLIElement() override; // https://www.w3.org/TR/html-aria/#el-li - virtual FlyString default_role() const override { return DOM::ARIARoleNames::listitem; }; + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::listitem; }; private: HTMLLIElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index cde4f0f0630..e0f657d2466 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -69,7 +69,7 @@ bool HTMLLinkElement::has_loaded_icon() const return m_relationship & Relationship::Icon && resource() && resource()->is_loaded() && resource()->has_encoded_data(); } -void HTMLLinkElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLLinkElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { // 4.6.7 Link types - https://html.spec.whatwg.org/multipage/links.html#linkTypes if (name == HTML::AttributeNames::rel) { @@ -118,7 +118,7 @@ void HTMLLinkElement::resource_did_load() resource_did_load_favicon(); } -void HTMLLinkElement::did_remove_attribute(FlyString const& attr) +void HTMLLinkElement::did_remove_attribute(DeprecatedFlyString const& attr) { if (attr == HTML::AttributeNames::disabled && (m_relationship & Relationship::Stylesheet)) { if (!resource()) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h index adbbfe6e574..73edcfe1376 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h @@ -33,14 +33,14 @@ public: private: HTMLLinkElement(DOM::Document&, DOM::QualifiedName); - void parse_attribute(FlyString const&, DeprecatedString const&) override; + void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override; // ^ResourceClient virtual void resource_did_fail() override; virtual void resource_did_load() override; // ^ HTMLElement - virtual void did_remove_attribute(FlyString const&) override; + virtual void did_remove_attribute(DeprecatedFlyString const&) override; virtual void visit_edges(Cell::Visitor&) override; void resource_did_load_stylesheet(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h index fffd6749651..7517b6a9272 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLMenuElement() override; // https://www.w3.org/TR/html-aria/#el-menu - virtual FlyString default_role() const override { return DOM::ARIARoleNames::list; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::list; } private: HTMLMenuElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h index 86a6880eff0..9bb413df888 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h @@ -23,7 +23,7 @@ public: virtual bool is_labelable() const override { return true; } // https://www.w3.org/TR/html-aria/#el-meter - virtual FlyString default_role() const override { return DOM::ARIARoleNames::meter; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::meter; } private: HTMLMeterElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp index 60ce086bc12..b8326ea34a3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp @@ -18,7 +18,7 @@ HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName quali HTMLModElement::~HTMLModElement() = default; -FlyString HTMLModElement::default_role() const +DeprecatedFlyString HTMLModElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-del if (local_name() == TagNames::del) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.h b/Userland/Libraries/LibWeb/HTML/HTMLModElement.h index 2dbc748a8e3..908f56c12f2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.h @@ -17,7 +17,7 @@ class HTMLModElement final : public HTMLElement { public: virtual ~HTMLModElement() override; - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLModElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h index 9ff8034f245..81f63c1247d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLOListElement() override; // https://www.w3.org/TR/html-aria/#el-ol - virtual FlyString default_role() const override { return DOM::ARIARoleNames::list; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::list; } private: HTMLOListElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index cfdc8dcfbf0..68a1a1c87fa 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -32,7 +32,7 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName HTMLObjectElement::~HTMLObjectElement() = default; -void HTMLObjectElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLObjectElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { BrowsingContextContainer::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h index de5bb2d80ec..a83ecafc4d5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -32,7 +32,7 @@ class HTMLObjectElement final public: virtual ~HTMLObjectElement() override; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; DeprecatedString data() const; void set_data(DeprecatedString const& data) { MUST(set_attribute(HTML::AttributeNames::data, data)); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h index 708c09ad1bc..d6875b1dc65 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLOptGroupElement() override; // https://www.w3.org/TR/html-aria/#el-optgroup - virtual FlyString default_role() const override { return DOM::ARIARoleNames::group; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::group; } private: HTMLOptGroupElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index 4396f9d9cf1..9c2cfc224d3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -26,7 +26,7 @@ HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName HTMLOptionElement::~HTMLOptionElement() = default; -void HTMLOptionElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void HTMLOptionElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { HTMLElement::parse_attribute(name, value); @@ -39,7 +39,7 @@ void HTMLOptionElement::parse_attribute(FlyString const& name, DeprecatedString } } -void HTMLOptionElement::did_remove_attribute(FlyString const& name) +void HTMLOptionElement::did_remove_attribute(DeprecatedFlyString const& name) { HTMLElement::did_remove_attribute(name); @@ -141,7 +141,7 @@ bool HTMLOptionElement::disabled() const || (parent() && is(parent()) && static_cast(*parent()).has_attribute(AttributeNames::disabled)); } -FlyString HTMLOptionElement::default_role() const +DeprecatedFlyString HTMLOptionElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-option // TODO: Only an option element that is in a list of options or that represents a suggestion in a datalist should return option diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h index 2083fc30bc7..1f0c9546ea5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h @@ -30,7 +30,7 @@ public: bool disabled() const; - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: friend class Bindings::OptionConstructor; @@ -38,8 +38,8 @@ private: HTMLOptionElement(DOM::Document&, DOM::QualifiedName); - void parse_attribute(FlyString const& name, DeprecatedString const& value) override; - void did_remove_attribute(FlyString const& name) override; + void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; + void did_remove_attribute(DeprecatedFlyString const& name) override; void ask_for_a_reset(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h index 0012795625c..9d46c7d8b6f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h @@ -45,7 +45,7 @@ public: virtual void reset_algorithm() override; // https://www.w3.org/TR/html-aria/#el-output - virtual FlyString default_role() const override { return DOM::ARIARoleNames::status; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::status; } private: HTMLOutputElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h index 6c2cb0cae74..e0572366ec6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h @@ -20,7 +20,7 @@ public: virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-p - virtual FlyString default_role() const override { return DOM::ARIARoleNames::paragraph; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::paragraph; } private: HTMLParagraphElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h index bf7f793df39..bfb623ab529 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLPreElement() override; // https://www.w3.org/TR/html-aria/#el-pre - virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; } private: HTMLPreElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h index 9e51af0d508..00689839f53 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h @@ -34,7 +34,7 @@ public: bool using_system_appearance() const; // https://www.w3.org/TR/html-aria/#el-progress - virtual FlyString default_role() const override { return DOM::ARIARoleNames::progressbar; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::progressbar; } private: HTMLProgressElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp index 6bca0b337b0..116842758e8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp @@ -19,7 +19,7 @@ HTMLQuoteElement::HTMLQuoteElement(DOM::Document& document, DOM::QualifiedName q HTMLQuoteElement::~HTMLQuoteElement() = default; -FlyString HTMLQuoteElement::default_role() const +DeprecatedFlyString HTMLQuoteElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-blockquote if (local_name() == TagNames::blockquote) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h index da36f18ce6a..79748de6f33 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h @@ -16,7 +16,7 @@ class HTMLQuoteElement final : public HTMLElement { public: virtual ~HTMLQuoteElement() override; - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLQuoteElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 29d23803a63..5ed7612b836 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -57,7 +57,7 @@ DOM::Element* HTMLSelectElement::item(size_t index) } // https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-nameditem -DOM::Element* HTMLSelectElement::named_item(FlyString const& name) +DOM::Element* HTMLSelectElement::named_item(DeprecatedFlyString const& name) { // The namedItem(name) method must return the value returned by the method of the same name on the options collection, when invoked with the same argument. return const_cast(*options()).named_item(name); @@ -156,7 +156,7 @@ DeprecatedString const& HTMLSelectElement::type() const return select_multiple; } -FlyString HTMLSelectElement::default_role() const +DeprecatedFlyString HTMLSelectElement::default_role() const { // https://www.w3.org/TR/html-aria/#el-select-multiple-or-size-greater-1 if (has_attribute("multiple")) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h index d08e9bd69de..0e1c211bdab 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h @@ -27,7 +27,7 @@ public: size_t length(); DOM::Element* item(size_t index); - DOM::Element* named_item(FlyString const& name); + DOM::Element* named_item(DeprecatedFlyString const& name); WebIDL::ExceptionOr add(HTMLOptionOrOptGroupElement element, Optional before = {}); int selected_index() const; @@ -60,7 +60,7 @@ public: DeprecatedString const& type() const; - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLSelectElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h index 3a3faf3df21..75e165fcad7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLSpanElement() override; // https://www.w3.org/TR/html-aria/#el-span - virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; } private: HTMLSpanElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h index 3393faadf39..259dbb101d8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h @@ -20,7 +20,7 @@ public: virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-caption - virtual FlyString default_role() const override { return DOM::ARIARoleNames::caption; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::caption; } private: HTMLTableCaptionElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index 0b4c2d3df26..a97862b517f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -69,7 +69,7 @@ void HTMLTableCellElement::set_row_span(unsigned int value) MUST(set_attribute(HTML::AttributeNames::rowspan, DeprecatedString::number(value))); } -FlyString HTMLTableCellElement::default_role() const +DeprecatedFlyString HTMLTableCellElement::default_role() const { // TODO: For td: // role=cell if the ancestor table element is exposed as a role=table diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h index 53e281073dd..c3e02ded3bb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h @@ -22,7 +22,7 @@ public: void set_col_span(unsigned); void set_row_span(unsigned); - virtual FlyString default_role() const override; + virtual DeprecatedFlyString default_role() const override; private: HTMLTableCellElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h index cf36ec6934e..40b8eff6820 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -43,7 +43,7 @@ public: WebIDL::ExceptionOr delete_row(long index); // https://www.w3.org/TR/html-aria/#el-table - virtual FlyString default_role() const override { return DOM::ARIARoleNames::table; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::table; } private: HTMLTableElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h index ee3fc521d9c..ea80fe5bc2a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h @@ -25,7 +25,7 @@ public: WebIDL::ExceptionOr delete_cell(i32 index); // https://www.w3.org/TR/html-aria/#el-tr - virtual FlyString default_role() const override { return DOM::ARIARoleNames::row; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::row; } private: HTMLTableRowElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h index 083654b99d9..025ff5a8746 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h @@ -25,7 +25,7 @@ public: // https://www.w3.org/TR/html-aria/#el-tbody // https://www.w3.org/TR/html-aria/#el-tfoot // https://www.w3.org/TR/html-aria/#el-thead - virtual FlyString default_role() const override { return DOM::ARIARoleNames::rowgroup; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::rowgroup; } private: HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h index 939ec8fe85c..7b5af5691f7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -52,7 +52,7 @@ public: virtual void reset_algorithm() override; // https://www.w3.org/TR/html-aria/#el-textarea - virtual FlyString default_role() const override { return DOM::ARIARoleNames::textbox; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::textbox; } private: HTMLTextAreaElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h index 3272d313091..f6962c6695a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLTimeElement() override; // https://www.w3.org/TR/html-aria/#el-time - virtual FlyString default_role() const override { return DOM::ARIARoleNames::time; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::time; } private: HTMLTimeElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h index 5af03e87979..9c7b275f5c9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h @@ -18,7 +18,7 @@ public: virtual ~HTMLUListElement() override; // https://www.w3.org/TR/html-aria/#el-ul - virtual FlyString default_role() const override { return DOM::ARIARoleNames::list; } + virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::list; } private: HTMLUListElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index 35160737207..907b8691141 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -MessageEvent* MessageEvent::create(JS::Realm& realm, FlyString const& event_name, MessageEventInit const& event_init) +MessageEvent* MessageEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, MessageEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -MessageEvent* MessageEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, MessageEventInit const& event_init) +MessageEvent* MessageEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MessageEventInit const& event_init) { return create(realm, event_name, event_init); } -MessageEvent::MessageEvent(JS::Realm& realm, FlyString const& event_name, MessageEventInit const& event_init) +MessageEvent::MessageEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MessageEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_data(event_init.data) , m_origin(event_init.origin) diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.h b/Userland/Libraries/LibWeb/HTML/MessageEvent.h index b8c4fbd6395..675c1eeffe4 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.h +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.h @@ -21,10 +21,10 @@ class MessageEvent : public DOM::Event { WEB_PLATFORM_OBJECT(MessageEvent, DOM::Event); public: - static MessageEvent* create(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init = {}); - static MessageEvent* construct_impl(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init); + static MessageEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, MessageEventInit const& event_init = {}); + static MessageEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, MessageEventInit const& event_init); - MessageEvent(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init); + MessageEvent(JS::Realm&, DeprecatedFlyString const& event_name, MessageEventInit const& event_init); virtual ~MessageEvent() override; JS::Value data() const { return m_data; } diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp index bf577ea81af..177277ffa4d 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -PageTransitionEvent* PageTransitionEvent::create(JS::Realm& realm, FlyString const& event_name, PageTransitionEventInit const& event_init) +PageTransitionEvent* PageTransitionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -PageTransitionEvent* PageTransitionEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, PageTransitionEventInit const& event_init) +PageTransitionEvent* PageTransitionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) { return create(realm, event_name, event_init); } -PageTransitionEvent::PageTransitionEvent(JS::Realm& realm, FlyString const& event_name, PageTransitionEventInit const& event_init) +PageTransitionEvent::PageTransitionEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_persisted(event_init.persisted) { diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h index 172df453c01..e809bc9f598 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h @@ -18,10 +18,10 @@ class PageTransitionEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event); public: - static PageTransitionEvent* create(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init); - static PageTransitionEvent* construct_impl(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init); + static PageTransitionEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); + static PageTransitionEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); - PageTransitionEvent(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init); + PageTransitionEvent(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); virtual ~PageTransitionEvent() override; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 8194593d14c..78878c422a5 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -40,7 +40,7 @@ static inline void log_parse_error(SourceLocation const& location = SourceLocati dbgln_if(HTML_PARSER_DEBUG, "Parse error! {}", location); } -static Vector s_quirks_public_ids = { +static Vector s_quirks_public_ids = { "+//Silmaril//dtd html Pro v0r11 19970101//", "-//AS//DTD HTML 3.0 asWedit + extensions//", "-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", @@ -616,7 +616,7 @@ HTMLParser::AdjustedInsertionLocation HTMLParser::find_appropriate_place_for_ins return adjusted_insertion_location; } -JS::NonnullGCPtr HTMLParser::create_element_for(HTMLToken const& token, FlyString const& namespace_, DOM::Node const& intended_parent) +JS::NonnullGCPtr HTMLParser::create_element_for(HTMLToken const& token, DeprecatedFlyString const& namespace_, DOM::Node const& intended_parent) { // FIXME: 1. If the active speculative HTML parser is not null, then return the result of creating a speculative mock element given given namespace, the tag name of the given token, and the attributes of the given token. // FIXME: 2. Otherwise, optionally create a speculative mock element given given namespace, the tag name of the given token, and the attributes of the given token. @@ -681,7 +681,7 @@ JS::NonnullGCPtr HTMLParser::create_element_for(HTMLToken const& t } // https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element -JS::NonnullGCPtr HTMLParser::insert_foreign_element(HTMLToken const& token, FlyString const& namespace_) +JS::NonnullGCPtr HTMLParser::insert_foreign_element(HTMLToken const& token, DeprecatedFlyString const& namespace_) { auto adjusted_insertion_location = find_appropriate_place_for_inserting_node(); @@ -1041,7 +1041,7 @@ AnythingElse: process_using_the_rules_for(m_insertion_mode, token); } -void HTMLParser::generate_implied_end_tags(FlyString const& exception) +void HTMLParser::generate_implied_end_tags(DeprecatedFlyString const& exception) { while (current_node().local_name() != exception && current_node().local_name().is_one_of(HTML::TagNames::dd, HTML::TagNames::dt, HTML::TagNames::li, HTML::TagNames::optgroup, HTML::TagNames::option, HTML::TagNames::p, HTML::TagNames::rb, HTML::TagNames::rp, HTML::TagNames::rt, HTML::TagNames::rtc)) (void)m_stack_of_open_elements.pop(); @@ -1365,7 +1365,7 @@ HTMLParser::AdoptionAgencyAlgorithmOutcome HTMLParser::run_the_adoption_agency_a } } -bool HTMLParser::is_special_tag(FlyString const& tag_name, FlyString const& namespace_) +bool HTMLParser::is_special_tag(DeprecatedFlyString const& tag_name, DeprecatedFlyString const& namespace_) { if (namespace_ == Namespace::HTML) { return tag_name.is_one_of( diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h index d535dee9eaa..1fc9841b9e2 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.h @@ -67,7 +67,7 @@ public: InsertionMode insertion_mode() const { return m_insertion_mode; } - static bool is_special_tag(FlyString const& tag_name, FlyString const& namespace_); + static bool is_special_tag(DeprecatedFlyString const& tag_name, DeprecatedFlyString const& namespace_); HTMLTokenizer& tokenizer() { return m_tokenizer; } @@ -117,9 +117,9 @@ private: void stop_parsing() { m_stop_parsing = true; } - void generate_implied_end_tags(FlyString const& exception = {}); + void generate_implied_end_tags(DeprecatedFlyString const& exception = {}); void generate_all_implied_end_tags_thoroughly(); - JS::NonnullGCPtr create_element_for(HTMLToken const&, FlyString const& namespace_, DOM::Node const& intended_parent); + JS::NonnullGCPtr create_element_for(HTMLToken const&, DeprecatedFlyString const& namespace_, DOM::Node const& intended_parent); struct AdjustedInsertionLocation { JS::GCPtr parent; @@ -130,7 +130,7 @@ private: DOM::Text* find_character_insertion_node(); void flush_character_insertions(); - JS::NonnullGCPtr insert_foreign_element(HTMLToken const&, FlyString const&); + JS::NonnullGCPtr insert_foreign_element(HTMLToken const&, DeprecatedFlyString const&); JS::NonnullGCPtr insert_html_element(HTMLToken const&); DOM::Element& current_node(); DOM::Element& adjusted_current_node(); diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h index d42562d7741..c49d98ab658 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include #include @@ -67,7 +67,7 @@ public: return token; } - static HTMLToken make_start_tag(FlyString const& tag_name) + static HTMLToken make_start_tag(DeprecatedFlyString const& tag_name) { HTMLToken token { Type::StartTag }; token.set_tag_name(tag_name); @@ -134,7 +134,7 @@ public: m_data.get() = code_point; } - FlyString const& comment() const + DeprecatedFlyString const& comment() const { VERIFY(is_comment()); return m_string_data; @@ -146,7 +146,7 @@ public: m_string_data = move(comment); } - FlyString const& tag_name() const + DeprecatedFlyString const& tag_name() const { VERIFY(is_start_tag() || is_end_tag()); return m_string_data; @@ -247,7 +247,7 @@ public: } } - StringView attribute(FlyString const& attribute_name) + StringView attribute(DeprecatedFlyString const& attribute_name) { VERIFY(is_start_tag() || is_end_tag()); @@ -261,19 +261,19 @@ public: return {}; } - bool has_attribute(FlyString const& attribute_name) + bool has_attribute(DeprecatedFlyString const& attribute_name) { return !attribute(attribute_name).is_null(); } - void adjust_tag_name(FlyString const& old_name, FlyString const& new_name) + void adjust_tag_name(DeprecatedFlyString const& old_name, DeprecatedFlyString const& new_name) { VERIFY(is_start_tag() || is_end_tag()); if (old_name == tag_name()) set_tag_name(new_name); } - void adjust_attribute_name(FlyString const& old_name, FlyString const& new_name) + void adjust_attribute_name(DeprecatedFlyString const& old_name, DeprecatedFlyString const& new_name) { VERIFY(is_start_tag() || is_end_tag()); for_each_attribute([&](Attribute& attribute) { @@ -283,7 +283,7 @@ public: }); } - void adjust_foreign_attribute(FlyString const& old_name, FlyString const& prefix, FlyString const& local_name, FlyString const& namespace_) + void adjust_foreign_attribute(DeprecatedFlyString const& old_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& local_name, DeprecatedFlyString const& namespace_) { VERIFY(is_start_tag() || is_end_tag()); for_each_attribute([&](Attribute& attribute) { @@ -350,7 +350,7 @@ private: bool m_tag_self_closing_acknowledged { false }; // Type::Comment (comment data), Type::StartTag and Type::EndTag (tag name) - FlyString m_string_data; + DeprecatedFlyString m_string_data; Variant, OwnPtr>> m_data {}; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp index 91d842f7c55..c454173227d 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp @@ -37,7 +37,7 @@ bool ListOfActiveFormattingElements::contains(const DOM::Element& element) const return false; } -DOM::Element* ListOfActiveFormattingElements::last_element_with_tag_name_before_marker(FlyString const& tag_name) +DOM::Element* ListOfActiveFormattingElements::last_element_with_tag_name_before_marker(DeprecatedFlyString const& tag_name) { for (ssize_t i = m_entries.size() - 1; i >= 0; --i) { auto& entry = m_entries[i]; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h index 661a6094d58..046b82b4aa5 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h @@ -37,7 +37,7 @@ public: Vector const& entries() const { return m_entries; } Vector& entries() { return m_entries; } - DOM::Element* last_element_with_tag_name_before_marker(FlyString const& tag_name); + DOM::Element* last_element_with_tag_name_before_marker(DeprecatedFlyString const& tag_name); void clear_up_to_the_last_marker(); diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp index ab9906c262d..93bcfd6cd59 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp @@ -10,7 +10,7 @@ namespace Web::HTML { -static Vector s_base_list { "applet", "caption", "html", "table", "td", "th", "marquee", "object", "template" }; +static Vector s_base_list { "applet", "caption", "html", "table", "td", "th", "marquee", "object", "template" }; StackOfOpenElements::~StackOfOpenElements() = default; @@ -20,7 +20,7 @@ void StackOfOpenElements::visit_edges(JS::Cell::Visitor& visitor) visitor.visit(element); } -bool StackOfOpenElements::has_in_scope_impl(FlyString const& tag_name, Vector const& list) const +bool StackOfOpenElements::has_in_scope_impl(DeprecatedFlyString const& tag_name, Vector const& list) const { for (auto const& element : m_elements.in_reverse()) { if (element->local_name() == tag_name) @@ -31,12 +31,12 @@ bool StackOfOpenElements::has_in_scope_impl(FlyString const& tag_name, Vector const& list) const +bool StackOfOpenElements::has_in_scope_impl(const DOM::Element& target_node, Vector const& list) const { for (auto& element : m_elements.in_reverse()) { if (element.ptr() == &target_node) @@ -52,19 +52,19 @@ bool StackOfOpenElements::has_in_scope(const DOM::Element& target_node) const return has_in_scope_impl(target_node, s_base_list); } -bool StackOfOpenElements::has_in_button_scope(FlyString const& tag_name) const +bool StackOfOpenElements::has_in_button_scope(DeprecatedFlyString const& tag_name) const { auto list = s_base_list; list.append("button"); return has_in_scope_impl(tag_name, list); } -bool StackOfOpenElements::has_in_table_scope(FlyString const& tag_name) const +bool StackOfOpenElements::has_in_table_scope(DeprecatedFlyString const& tag_name) const { return has_in_scope_impl(tag_name, { "html", "table", "template" }); } -bool StackOfOpenElements::has_in_list_item_scope(FlyString const& tag_name) const +bool StackOfOpenElements::has_in_list_item_scope(DeprecatedFlyString const& tag_name) const { auto list = s_base_list; list.append("ol"); @@ -78,7 +78,7 @@ bool StackOfOpenElements::has_in_list_item_scope(FlyString const& tag_name) cons // - optgroup in the HTML namespace // - option in the HTML namespace // NOTE: In this case it's "all element types _except_" -bool StackOfOpenElements::has_in_select_scope(FlyString const& tag_name) const +bool StackOfOpenElements::has_in_select_scope(DeprecatedFlyString const& tag_name) const { // https://html.spec.whatwg.org/multipage/parsing.html#has-an-element-in-the-specific-scope // 1. Initialize node to be the current node (the bottommost node of the stack). @@ -106,7 +106,7 @@ bool StackOfOpenElements::contains(const DOM::Element& element) const return false; } -bool StackOfOpenElements::contains(FlyString const& tag_name) const +bool StackOfOpenElements::contains(DeprecatedFlyString const& tag_name) const { for (auto& element_on_stack : m_elements) { if (element_on_stack->local_name() == tag_name) @@ -115,7 +115,7 @@ bool StackOfOpenElements::contains(FlyString const& tag_name) const return false; } -void StackOfOpenElements::pop_until_an_element_with_tag_name_has_been_popped(FlyString const& tag_name) +void StackOfOpenElements::pop_until_an_element_with_tag_name_has_been_popped(DeprecatedFlyString const& tag_name) { while (m_elements.last()->local_name() != tag_name) (void)pop(); @@ -134,7 +134,7 @@ JS::GCPtr StackOfOpenElements::topmost_special_node_below(DOM::Ele return found_element.ptr(); } -StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_tag_name(FlyString const& tag_name) +StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_tag_name(DeprecatedFlyString const& tag_name) { for (ssize_t i = m_elements.size() - 1; i >= 0; --i) { auto& element = m_elements[i]; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h index d3376e36f0c..5be1c04c0bf 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h @@ -36,21 +36,21 @@ public: const DOM::Element& current_node() const { return *m_elements.last(); } DOM::Element& current_node() { return *m_elements.last(); } - bool has_in_scope(FlyString const& tag_name) const; - bool has_in_button_scope(FlyString const& tag_name) const; - bool has_in_table_scope(FlyString const& tag_name) const; - bool has_in_list_item_scope(FlyString const& tag_name) const; - bool has_in_select_scope(FlyString const& tag_name) const; + bool has_in_scope(DeprecatedFlyString const& tag_name) const; + bool has_in_button_scope(DeprecatedFlyString const& tag_name) const; + bool has_in_table_scope(DeprecatedFlyString const& tag_name) const; + bool has_in_list_item_scope(DeprecatedFlyString const& tag_name) const; + bool has_in_select_scope(DeprecatedFlyString const& tag_name) const; bool has_in_scope(const DOM::Element&) const; bool contains(const DOM::Element&) const; - bool contains(FlyString const& tag_name) const; + bool contains(DeprecatedFlyString const& tag_name) const; auto const& elements() const { return m_elements; } auto& elements() { return m_elements; } - void pop_until_an_element_with_tag_name_has_been_popped(FlyString const&); + void pop_until_an_element_with_tag_name_has_been_popped(DeprecatedFlyString const&); JS::GCPtr topmost_special_node_below(DOM::Element const&); @@ -58,14 +58,14 @@ public: JS::GCPtr element; ssize_t index; }; - LastElementResult last_element_with_tag_name(FlyString const&); + LastElementResult last_element_with_tag_name(DeprecatedFlyString const&); JS::GCPtr element_immediately_above(DOM::Element const&); void visit_edges(JS::Cell::Visitor&); private: - bool has_in_scope_impl(FlyString const& tag_name, Vector const&) const; - bool has_in_scope_impl(const DOM::Element& target_node, Vector const&) const; + bool has_in_scope_impl(DeprecatedFlyString const& tag_name, Vector const&) const; + bool has_in_scope_impl(const DOM::Element& target_node, Vector const&) const; Vector> m_elements; }; diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp index 075f7b351c1..f16a98a2c6d 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -PromiseRejectionEvent* PromiseRejectionEvent::create(JS::Realm& realm, FlyString const& event_name, PromiseRejectionEventInit const& event_init) +PromiseRejectionEvent* PromiseRejectionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -PromiseRejectionEvent* PromiseRejectionEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, PromiseRejectionEventInit const& event_init) +PromiseRejectionEvent* PromiseRejectionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init) { return create(realm, event_name, event_init); } -PromiseRejectionEvent::PromiseRejectionEvent(JS::Realm& realm, FlyString const& event_name, PromiseRejectionEventInit const& event_init) +PromiseRejectionEvent::PromiseRejectionEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_promise(const_cast(event_init.promise.cell())) , m_reason(event_init.reason) diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h index 43029d70a09..0f79732f60e 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h @@ -23,8 +23,8 @@ class PromiseRejectionEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(PromiseRejectionEvent, DOM::Event); public: - static PromiseRejectionEvent* create(JS::Realm&, FlyString const& event_name, PromiseRejectionEventInit const& event_init = {}); - static PromiseRejectionEvent* construct_impl(JS::Realm&, FlyString const& event_name, PromiseRejectionEventInit const& event_init); + static PromiseRejectionEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init = {}); + static PromiseRejectionEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init); virtual ~PromiseRejectionEvent() override; @@ -33,7 +33,7 @@ public: JS::Value reason() const { return m_reason; } private: - PromiseRejectionEvent(JS::Realm&, FlyString const& event_name, PromiseRejectionEventInit const& event_init); + PromiseRejectionEvent(JS::Realm&, DeprecatedFlyString const& event_name, PromiseRejectionEventInit const& event_init); virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp index d1470fdacec..9d3cc07ff5f 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp @@ -9,17 +9,17 @@ namespace Web::HTML { -SubmitEvent* SubmitEvent::create(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) +SubmitEvent* SubmitEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -SubmitEvent* SubmitEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) +SubmitEvent* SubmitEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) { return create(realm, event_name, event_init); } -SubmitEvent::SubmitEvent(JS::Realm& realm, FlyString const& event_name, SubmitEventInit const& event_init) +SubmitEvent::SubmitEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_submitter(event_init.submitter) { diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.h b/Userland/Libraries/LibWeb/HTML/SubmitEvent.h index 7159faa2119..56dc9b604b3 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.h +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.h @@ -19,15 +19,15 @@ class SubmitEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(SubmitEvent, DOM::Event); public: - static SubmitEvent* create(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); - static SubmitEvent* construct_impl(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); + static SubmitEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init); + static SubmitEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init); virtual ~SubmitEvent() override; JS::GCPtr submitter() const { return m_submitter; } private: - SubmitEvent(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); + SubmitEvent(JS::Realm&, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init); virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/TagNames.cpp b/Userland/Libraries/LibWeb/HTML/TagNames.cpp index 732bdae01f9..435755b9f2c 100644 --- a/Userland/Libraries/LibWeb/HTML/TagNames.cpp +++ b/Userland/Libraries/LibWeb/HTML/TagNames.cpp @@ -8,7 +8,7 @@ namespace Web::HTML::TagNames { -#define __ENUMERATE_HTML_TAG(name) FlyString name; +#define __ENUMERATE_HTML_TAG(name) DeprecatedFlyString name; ENUMERATE_HTML_TAGS #undef __ENUMERATE_HTML_TAG diff --git a/Userland/Libraries/LibWeb/HTML/TagNames.h b/Userland/Libraries/LibWeb/HTML/TagNames.h index 77e25145e8c..e8fb8dd0497 100644 --- a/Userland/Libraries/LibWeb/HTML/TagNames.h +++ b/Userland/Libraries/LibWeb/HTML/TagNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::HTML::TagNames { @@ -152,7 +152,7 @@ namespace Web::HTML::TagNames { __ENUMERATE_HTML_TAG(wbr) \ __ENUMERATE_HTML_TAG(xmp) -#define __ENUMERATE_HTML_TAG(name) extern FlyString name; +#define __ENUMERATE_HTML_TAG(name) extern DeprecatedFlyString name; ENUMERATE_HTML_TAGS #undef __ENUMERATE_HTML_TAG diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index a32837627ef..f00a8cccdad 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -780,7 +780,7 @@ float Window::scroll_y() const } // https://html.spec.whatwg.org/#fire-a-page-transition-event -void Window::fire_a_page_transition_event(FlyString const& event_name, bool persisted) +void Window::fire_a_page_transition_event(DeprecatedFlyString const& event_name, bool persisted) { // To fire a page transition event named eventName at a Window window with a boolean persisted, // fire an event named eventName at window, using PageTransitionEvent, diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index fc713fcf2e8..1cf75d254e6 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -102,7 +102,7 @@ public: float scroll_x() const; float scroll_y() const; - void fire_a_page_transition_event(FlyString const& event_name, bool persisted); + void fire_a_page_transition_event(DeprecatedFlyString const& event_name, bool persisted); float device_pixel_ratio() const; @@ -142,7 +142,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; // ^HTML::GlobalEventHandlers - virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; } + virtual DOM::EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const&) override { return *this; } // ^HTML::WindowEventHandlers virtual DOM::EventTarget& window_event_handlers_to_event_target() override { return *this; } diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index 846fb1fca3f..3aac30ea98f 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -17,7 +17,7 @@ namespace Web::HTML { // https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface -Worker::Worker(FlyString const& script_url, WorkerOptions const options, DOM::Document& document) +Worker::Worker(DeprecatedFlyString const& script_url, WorkerOptions const options, DOM::Document& document) : DOM::EventTarget(document.realm()) , m_script_url(script_url) , m_options(options) @@ -40,7 +40,7 @@ void Worker::visit_edges(Cell::Visitor& visitor) } // https://html.spec.whatwg.org/multipage/workers.html#dom-worker -WebIDL::ExceptionOr> Worker::create(FlyString const& script_url, WorkerOptions const options, DOM::Document& document) +WebIDL::ExceptionOr> Worker::create(DeprecatedFlyString const& script_url, WorkerOptions const options, DOM::Document& document) { dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Creating worker with script_url = {}", script_url); diff --git a/Userland/Libraries/LibWeb/HTML/Worker.h b/Userland/Libraries/LibWeb/HTML/Worker.h index 823a46bc1dd..303ce771539 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.h +++ b/Userland/Libraries/LibWeb/HTML/Worker.h @@ -36,8 +36,8 @@ class Worker : public DOM::EventTarget { WEB_PLATFORM_OBJECT(Worker, DOM::EventTarget); public: - static WebIDL::ExceptionOr> create(FlyString const& script_url, WorkerOptions const options, DOM::Document& document); - static WebIDL::ExceptionOr> construct_impl(JS::Realm& realm, FlyString const& script_url, WorkerOptions const options) + static WebIDL::ExceptionOr> create(DeprecatedFlyString const& script_url, WorkerOptions const options, DOM::Document& document); + static WebIDL::ExceptionOr> construct_impl(JS::Realm& realm, DeprecatedFlyString const& script_url, WorkerOptions const options) { auto& window = verify_cast(realm.global_object()); return Worker::create(script_url, options, window.associated_document()); @@ -60,7 +60,7 @@ public: #undef __ENUMERATE protected: - Worker(FlyString const&, const WorkerOptions, DOM::Document&); + Worker(DeprecatedFlyString const&, const WorkerOptions, DOM::Document&); private: static HTML::EventLoop& get_vm_event_loop(JS::VM& target_vm) @@ -70,7 +70,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; - FlyString m_script_url; + DeprecatedFlyString m_script_url; WorkerOptions m_options; JS::GCPtr m_document; diff --git a/Userland/Libraries/LibWeb/Namespace.cpp b/Userland/Libraries/LibWeb/Namespace.cpp index 696a53e9592..eb05860f045 100644 --- a/Userland/Libraries/LibWeb/Namespace.cpp +++ b/Userland/Libraries/LibWeb/Namespace.cpp @@ -8,7 +8,7 @@ namespace Web::Namespace { -#define __ENUMERATE_NAMESPACE(name, namespace_) FlyString name; +#define __ENUMERATE_NAMESPACE(name, namespace_) DeprecatedFlyString name; ENUMERATE_NAMESPACES #undef __ENUMERATE_NAMESPACE diff --git a/Userland/Libraries/LibWeb/Namespace.h b/Userland/Libraries/LibWeb/Namespace.h index 17eb9f6bb20..330663dfbf9 100644 --- a/Userland/Libraries/LibWeb/Namespace.h +++ b/Userland/Libraries/LibWeb/Namespace.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::Namespace { @@ -18,7 +18,7 @@ namespace Web::Namespace { __ENUMERATE_NAMESPACE(XML, "http://www.w3.org/XML/1998/namespace") \ __ENUMERATE_NAMESPACE(XMLNS, "http://www.w3.org/2000/xmlns/") -#define __ENUMERATE_NAMESPACE(name, namespace_) extern FlyString name; +#define __ENUMERATE_NAMESPACE(name, namespace_) extern DeprecatedFlyString name; ENUMERATE_NAMESPACES #undef __ENUMERATE_NAMESPACE diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index db3e89aa4c3..e196773ed01 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -661,7 +661,7 @@ constexpr bool should_ignore_keydown_event(u32 code_point) return code_point == 0 || code_point == 27; } -bool EventHandler::fire_keyboard_event(FlyString const& event_name, HTML::BrowsingContext& browsing_context, KeyCode key, unsigned int modifiers, u32 code_point) +bool EventHandler::fire_keyboard_event(DeprecatedFlyString const& event_name, HTML::BrowsingContext& browsing_context, KeyCode key, unsigned int modifiers, u32 code_point) { JS::NonnullGCPtr document = *browsing_context.active_document(); if (!document) diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h index 394cb493cfa..eab3fe08f62 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.h +++ b/Userland/Libraries/LibWeb/Page/EventHandler.h @@ -40,7 +40,7 @@ private: bool focus_next_element(); bool focus_previous_element(); - bool fire_keyboard_event(FlyString const& event_name, HTML::BrowsingContext& browsing_context, KeyCode key, unsigned modifiers, u32 code_point); + bool fire_keyboard_event(DeprecatedFlyString const& event_name, HTML::BrowsingContext& browsing_context, KeyCode key, unsigned modifiers, u32 code_point); CSSPixelPoint compute_mouse_event_client_offset(CSSPixelPoint event_page_position) const; CSSPixelPoint compute_mouse_event_page_offset(CSSPixelPoint event_client_offset) const; diff --git a/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp b/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp index f8953aa8228..b24c69a2d86 100644 --- a/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp +++ b/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp @@ -8,7 +8,7 @@ namespace Web::SVG::AttributeNames { -#define __ENUMERATE_SVG_ATTRIBUTE(name) FlyString name; +#define __ENUMERATE_SVG_ATTRIBUTE(name) DeprecatedFlyString name; ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) #undef __ENUMERATE_SVG_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/SVG/AttributeNames.h b/Userland/Libraries/LibWeb/SVG/AttributeNames.h index 8da65cd1efc..29c64e9718b 100644 --- a/Userland/Libraries/LibWeb/SVG/AttributeNames.h +++ b/Userland/Libraries/LibWeb/SVG/AttributeNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::SVG::AttributeNames { @@ -87,7 +87,7 @@ namespace Web::SVG::AttributeNames { E(yChannelSelector) \ E(zoomAndPan) -#define __ENUMERATE_SVG_ATTRIBUTE(name) extern FlyString name; +#define __ENUMERATE_SVG_ATTRIBUTE(name) extern DeprecatedFlyString name; ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) #undef __ENUMERATE_SVG_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp index 846525b722c..886f8f23207 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp @@ -17,7 +17,7 @@ SVGCircleElement::SVGCircleElement(DOM::Document& document, DOM::QualifiedName q set_prototype(&Bindings::cached_web_prototype(realm(), "SVGCircleElement")); } -void SVGCircleElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGCircleElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h index 9914dcf7abd..be18108a6d5 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h @@ -17,7 +17,7 @@ class SVGCircleElement final : public SVGGeometryElement { public: virtual ~SVGCircleElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index 89ebb21e1f4..ae17c54d03f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -17,7 +17,7 @@ SVGEllipseElement::SVGEllipseElement(DOM::Document& document, DOM::QualifiedName set_prototype(&Bindings::cached_web_prototype(realm(), "SVGEllipseElement")); } -void SVGEllipseElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGEllipseElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h index e511390f9c4..7473e5f3bce 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h @@ -17,7 +17,7 @@ class SVGEllipseElement final : public SVGGeometryElement { public: virtual ~SVGEllipseElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 15fb7d81473..50731211ef8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -17,7 +17,7 @@ SVGLineElement::SVGLineElement(DOM::Document& document, DOM::QualifiedName quali set_prototype(&Bindings::cached_web_prototype(realm(), "SVGLineElement")); } -void SVGLineElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGLineElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h index 2c6370c2d31..f5348bd0fd7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h @@ -17,7 +17,7 @@ class SVGLineElement final : public SVGGeometryElement { public: virtual ~SVGLineElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index 1a856cb2f65..06160679691 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -90,7 +90,7 @@ SVGPathElement::SVGPathElement(DOM::Document& document, DOM::QualifiedName quali set_prototype(&Bindings::cached_web_prototype(realm(), "SVGPathElement")); } -void SVGPathElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGPathElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h index 0554b44ff6b..7333bd5ad6f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h @@ -19,7 +19,7 @@ class SVGPathElement final : public SVGGeometryElement { public: virtual ~SVGPathElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index 36055827661..e4de0399579 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -17,7 +17,7 @@ SVGPolygonElement::SVGPolygonElement(DOM::Document& document, DOM::QualifiedName set_prototype(&Bindings::cached_web_prototype(realm(), "SVGPolygonElement")); } -void SVGPolygonElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGPolygonElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h index 92d22df9d71..017b57b10a9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h @@ -16,7 +16,7 @@ class SVGPolygonElement final : public SVGGeometryElement { public: virtual ~SVGPolygonElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index 765a98a0eee..e92d604b97f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -17,7 +17,7 @@ SVGPolylineElement::SVGPolylineElement(DOM::Document& document, DOM::QualifiedNa set_prototype(&Bindings::cached_web_prototype(realm(), "SVGPolylineElement")); } -void SVGPolylineElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGPolylineElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h index 03e826e0d7d..77015550cb6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h @@ -16,7 +16,7 @@ class SVGPolylineElement final : public SVGGeometryElement { public: virtual ~SVGPolylineElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index 95eae3e8aee..1bd6ce469b2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -19,7 +19,7 @@ SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName quali set_prototype(&Bindings::cached_web_prototype(realm(), "SVGRectElement")); } -void SVGRectElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGRectElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGeometryElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h index b1429f856ef..6b079a3f05b 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h @@ -17,7 +17,7 @@ class SVGRectElement final : public SVGGeometryElement { public: virtual ~SVGRectElement() override = default; - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index cfa061a4d6a..256e3c0be86 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -52,7 +52,7 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons } } -void SVGSVGElement::parse_attribute(FlyString const& name, DeprecatedString const& value) +void SVGSVGElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { SVGGraphicsElement::parse_attribute(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h index 3c272ff4719..05fae1059eb 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -30,7 +30,7 @@ private: virtual bool is_svg_svg_element() const override { return true; } - virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override; + virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override; Optional m_view_box; }; diff --git a/Userland/Libraries/LibWeb/SVG/TagNames.cpp b/Userland/Libraries/LibWeb/SVG/TagNames.cpp index 26ff93d67ff..fe6b698a324 100644 --- a/Userland/Libraries/LibWeb/SVG/TagNames.cpp +++ b/Userland/Libraries/LibWeb/SVG/TagNames.cpp @@ -8,7 +8,7 @@ namespace Web::SVG::TagNames { -#define __ENUMERATE_SVG_TAG(name) FlyString name; +#define __ENUMERATE_SVG_TAG(name) DeprecatedFlyString name; ENUMERATE_SVG_TAGS #undef __ENUMERATE_SVG_TAG diff --git a/Userland/Libraries/LibWeb/SVG/TagNames.h b/Userland/Libraries/LibWeb/SVG/TagNames.h index 41c665c8167..f7794445918 100644 --- a/Userland/Libraries/LibWeb/SVG/TagNames.h +++ b/Userland/Libraries/LibWeb/SVG/TagNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::SVG::TagNames { @@ -31,7 +31,7 @@ namespace Web::SVG::TagNames { __ENUMERATE_SVG_TAG(script) \ __ENUMERATE_SVG_TAG(title) -#define __ENUMERATE_SVG_TAG(name) extern FlyString name; +#define __ENUMERATE_SVG_TAG(name) extern DeprecatedFlyString name; ENUMERATE_SVG_TAGS #undef __ENUMERATE_SVG_TAG diff --git a/Userland/Libraries/LibWeb/UIEvents/EventNames.cpp b/Userland/Libraries/LibWeb/UIEvents/EventNames.cpp index 804fad3a042..a84be33b56a 100644 --- a/Userland/Libraries/LibWeb/UIEvents/EventNames.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/EventNames.cpp @@ -8,7 +8,7 @@ namespace Web::UIEvents::EventNames { -#define __ENUMERATE_UI_EVENT(name) FlyString name; +#define __ENUMERATE_UI_EVENT(name) DeprecatedFlyString name; ENUMERATE_UI_EVENTS #undef __ENUMERATE_UI_EVENT diff --git a/Userland/Libraries/LibWeb/UIEvents/EventNames.h b/Userland/Libraries/LibWeb/UIEvents/EventNames.h index 14ddd7635ae..22e0892804e 100644 --- a/Userland/Libraries/LibWeb/UIEvents/EventNames.h +++ b/Userland/Libraries/LibWeb/UIEvents/EventNames.h @@ -7,7 +7,7 @@ #pragma once -#include +#include namespace Web::UIEvents::EventNames { @@ -29,7 +29,7 @@ namespace Web::UIEvents::EventNames { __ENUMERATE_UI_EVENT(resize) \ __ENUMERATE_UI_EVENT(wheel) -#define __ENUMERATE_UI_EVENT(name) extern FlyString name; +#define __ENUMERATE_UI_EVENT(name) extern DeprecatedFlyString name; ENUMERATE_UI_EVENTS #undef __ENUMERATE_UI_EVENT diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index 4fc2aeefa9c..30c1deeb508 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -9,12 +9,12 @@ namespace Web::UIEvents { -FocusEvent* FocusEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init) +FocusEvent* FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init) +FocusEvent::FocusEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) : UIEvent(realm, event_name) { set_prototype(&Bindings::cached_web_prototype(realm, "FocusEvent")); diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h index 1df41baecbc..255fba7c807 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h @@ -18,12 +18,12 @@ class FocusEvent final : public UIEvent { WEB_PLATFORM_OBJECT(FocusEvent, UIEvent); public: - static FocusEvent* construct_impl(JS::Realm&, FlyString const& event_name, FocusEventInit const& event_init); + static FocusEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init); virtual ~FocusEvent() override; private: - FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&); + FocusEvent(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const&); }; } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index 997dea18e80..32df18d3975 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -66,7 +66,7 @@ static unsigned long determine_key_code(KeyCode platform_key, u32 code_point) return platform_key; } -KeyboardEvent* KeyboardEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, KeyCode platform_key, unsigned modifiers, u32 code_point) +KeyboardEvent* KeyboardEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyCode platform_key, unsigned modifiers, u32 code_point) { // FIXME: Figure out what these should actually contain. DeprecatedString event_key = key_code_to_string(platform_key); @@ -104,17 +104,17 @@ bool KeyboardEvent::get_modifier_state(DeprecatedString const& key_arg) return false; } -KeyboardEvent* KeyboardEvent::create(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init) +KeyboardEvent* KeyboardEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -KeyboardEvent* KeyboardEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init) +KeyboardEvent* KeyboardEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init) { return create(realm, event_name, event_init); } -KeyboardEvent::KeyboardEvent(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init) +KeyboardEvent::KeyboardEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init) : UIEvent(realm, event_name, event_init) , m_key(event_init.key) , m_code(event_init.code) diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h index 495a6ade3f6..c63cd7e192d 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h @@ -28,9 +28,9 @@ class KeyboardEvent final : public UIEvent { WEB_PLATFORM_OBJECT(KeyboardEvent, UIEvent); public: - static KeyboardEvent* create(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init = {}); - static KeyboardEvent* construct_impl(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init); - static KeyboardEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point); + static KeyboardEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init = {}); + static KeyboardEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init); + static KeyboardEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point); virtual ~KeyboardEvent() override; @@ -54,7 +54,7 @@ public: virtual u32 which() const override { return m_key_code; } private: - KeyboardEvent(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init); + KeyboardEvent(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init); DeprecatedString m_key; DeprecatedString m_code; diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp index 2e5c19f8f42..d528c8dd68e 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -13,7 +13,7 @@ namespace Web::UIEvents { -MouseEvent::MouseEvent(JS::Realm& realm, FlyString const& event_name, MouseEventInit const& event_init) +MouseEvent::MouseEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MouseEventInit const& event_init) : UIEvent(realm, event_name, event_init) , m_offset_x(event_init.offset_x) , m_offset_y(event_init.offset_y) @@ -49,12 +49,12 @@ static i16 determine_button(unsigned mouse_button) } } -MouseEvent* MouseEvent::create(JS::Realm& realm, FlyString const& event_name, MouseEventInit const& event_init) +MouseEvent* MouseEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, MouseEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -MouseEvent* MouseEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button) +MouseEvent* MouseEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button) { MouseEventInit event_init {}; event_init.offset_x = static_cast(offset.x().value()); diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h index c337bc84dfd..7cbce9c9539 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h @@ -29,8 +29,8 @@ class MouseEvent : public UIEvent { WEB_PLATFORM_OBJECT(MouseEvent, UIEvent); public: - static MouseEvent* create(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init = {}); - static MouseEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button = 1); + static MouseEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, MouseEventInit const& event_init = {}); + static MouseEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button = 1); virtual ~MouseEvent() override; @@ -56,7 +56,7 @@ public: virtual u32 which() const override { return m_button + 1; } protected: - MouseEvent(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init); + MouseEvent(JS::Realm&, DeprecatedFlyString const& event_name, MouseEventInit const& event_init); private: void set_event_characteristics(); diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp index e7488a3b5bf..f97f07fb165 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp @@ -9,23 +9,23 @@ namespace Web::UIEvents { -UIEvent* UIEvent::create(JS::Realm& realm, FlyString const& event_name) +UIEvent* UIEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name) { return realm.heap().allocate(realm, realm, event_name); } -UIEvent* UIEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, UIEventInit const& event_init) +UIEvent* UIEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name) +UIEvent::UIEvent(JS::Realm& realm, DeprecatedFlyString const& event_name) : Event(realm, event_name) { set_prototype(&Bindings::cached_web_prototype(realm, "UIEvent")); } -UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name, UIEventInit const& event_init) +UIEvent::UIEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init) : Event(realm, event_name, event_init) , m_view(event_init.view) , m_detail(event_init.detail) diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h index 3bb70e49afe..874a9d9399e 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h @@ -21,8 +21,8 @@ class UIEvent : public DOM::Event { WEB_PLATFORM_OBJECT(UIEvent, DOM::Event); public: - static UIEvent* create(JS::Realm&, FlyString const& type); - static UIEvent* construct_impl(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init); + static UIEvent* create(JS::Realm&, DeprecatedFlyString const& type); + static UIEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, UIEventInit const& event_init); virtual ~UIEvent() override; @@ -38,8 +38,8 @@ public: } protected: - UIEvent(JS::Realm&, FlyString const& event_name); - UIEvent(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init); + UIEvent(JS::Realm&, DeprecatedFlyString const& event_name); + UIEvent(JS::Realm&, DeprecatedFlyString const& event_name, UIEventInit const& event_init); virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp index c6584f1966d..d8d92f503b1 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp @@ -11,7 +11,7 @@ namespace Web::UIEvents { -WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init) +WheelEvent::WheelEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, WheelEventInit const& event_init) : MouseEvent(realm, event_name, event_init) , m_delta_x(event_init.delta_x) , m_delta_y(event_init.delta_y) @@ -23,12 +23,12 @@ WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEvent WheelEvent::~WheelEvent() = default; -WheelEvent* WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init) +WheelEvent* WheelEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, WheelEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -WheelEvent* WheelEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button) +WheelEvent* WheelEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button) { WheelEventInit event_init {}; event_init.offset_x = static_cast(offset_x.value()); diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h index 47ab277af58..f3f65eae675 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h @@ -29,8 +29,8 @@ class WheelEvent final : public MouseEvent { WEB_PLATFORM_OBJECT(WheelEvent, MouseEvent); public: - static WheelEvent* create(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init = {}); - static WheelEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button); + static WheelEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, WheelEventInit const& event_init = {}); + static WheelEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button); virtual ~WheelEvent() override; @@ -40,7 +40,7 @@ public: unsigned long delta_mode() const { return to_underlying(m_delta_mode); } private: - WheelEvent(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init); + WheelEvent(JS::Realm&, DeprecatedFlyString const& event_name, WheelEventInit const& event_init); void set_event_characteristics(); diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp index 343a8c2a0be..983899ad8b6 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp @@ -9,17 +9,17 @@ namespace Web::WebGL { -WebGLContextEvent* WebGLContextEvent::create(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init) +WebGLContextEvent* WebGLContextEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -WebGLContextEvent* WebGLContextEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init) +WebGLContextEvent* WebGLContextEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, WebGLContextEventInit const& event_init) { return create(realm, event_name, event_init); } -WebGLContextEvent::WebGLContextEvent(JS::Realm& realm, FlyString const& type, WebGLContextEventInit const& event_init) +WebGLContextEvent::WebGLContextEvent(JS::Realm& realm, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init) : DOM::Event(realm, type, event_init) , m_status_message(event_init.status_message) { diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h index f159850a1be..23cd69d0fdc 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h @@ -19,15 +19,15 @@ class WebGLContextEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event); public: - static WebGLContextEvent* create(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init); - static WebGLContextEvent* construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init); + static WebGLContextEvent* create(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); + static WebGLContextEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); virtual ~WebGLContextEvent() override; DeprecatedString const& status_message() const { return m_status_message; } private: - WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init); + WebGLContextEvent(JS::Realm&, DeprecatedFlyString const& type, WebGLContextEventInit const& event_init); DeprecatedString m_status_message { DeprecatedString::empty() }; }; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index e540f002f05..54557345b81 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -13,7 +13,7 @@ namespace Web::WebGL { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-event -static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, FlyString const& type) +static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, DeprecatedFlyString const& type) { // To fire a WebGL context event named e means that an event using the WebGLContextEvent interface, with its type attribute [DOM4] initialized to e, its cancelable attribute initialized to true, and its isTrusted attribute [DOM4] initialized to true, is to be dispatched at the given object. // FIXME: Consider setting a status message. diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp index 723eeef2045..49709af9a59 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp @@ -9,17 +9,17 @@ namespace Web::WebIDL { -JS::NonnullGCPtr DOMException::create(JS::Realm& realm, FlyString const& name, FlyString const& message) +JS::NonnullGCPtr DOMException::create(JS::Realm& realm, DeprecatedFlyString const& name, DeprecatedFlyString const& message) { return realm.heap().allocate(realm, realm, name, message); } -JS::NonnullGCPtr DOMException::construct_impl(JS::Realm& realm, FlyString const& message, FlyString const& name) +JS::NonnullGCPtr DOMException::construct_impl(JS::Realm& realm, DeprecatedFlyString const& message, DeprecatedFlyString const& name) { return realm.heap().allocate(realm, realm, name, message); } -DOMException::DOMException(JS::Realm& realm, FlyString const& name, FlyString const& message) +DOMException::DOMException(JS::Realm& realm, DeprecatedFlyString const& name, DeprecatedFlyString const& message) : PlatformObject(realm) , m_name(name) , m_message(message) diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.h b/Userland/Libraries/LibWeb/WebIDL/DOMException.h index 17bd1c4bba0..38b86efc24e 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.h +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include #include #include #include @@ -79,7 +79,7 @@ namespace Web::WebIDL { __ENUMERATE(OperationError) \ __ENUMERATE(NotAllowedError) -static u16 get_legacy_code_for_name(FlyString const& name) +static u16 get_legacy_code_for_name(DeprecatedFlyString const& name) { #define __ENUMERATE(ErrorName, code) \ if (name == #ErrorName) \ @@ -94,33 +94,33 @@ class DOMException final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(DOMException, Bindings::PlatformObject); public: - static JS::NonnullGCPtr create(JS::Realm& realm, FlyString const& name, FlyString const& message); + static JS::NonnullGCPtr create(JS::Realm& realm, DeprecatedFlyString const& name, DeprecatedFlyString const& message); // JS constructor has message first, name second // FIXME: This is a completely pointless footgun, let's use the same order for both factories. - static JS::NonnullGCPtr construct_impl(JS::Realm& realm, FlyString const& message, FlyString const& name); + static JS::NonnullGCPtr construct_impl(JS::Realm& realm, DeprecatedFlyString const& message, DeprecatedFlyString const& name); virtual ~DOMException() override; - FlyString const& name() const { return m_name; } - FlyString const& message() const { return m_message; } + DeprecatedFlyString const& name() const { return m_name; } + DeprecatedFlyString const& message() const { return m_message; } u16 code() const { return get_legacy_code_for_name(m_name); } protected: - DOMException(JS::Realm&, FlyString const& name, FlyString const& message); + DOMException(JS::Realm&, DeprecatedFlyString const& name, DeprecatedFlyString const& message); private: - FlyString m_name; - FlyString m_message; + DeprecatedFlyString m_name; + DeprecatedFlyString m_message; }; -#define __ENUMERATE(ErrorName) \ - class ErrorName final { \ - public: \ - static JS::NonnullGCPtr create(JS::Realm& realm, FlyString const& message) \ - { \ - return DOMException::create(realm, #ErrorName, message); \ - } \ +#define __ENUMERATE(ErrorName) \ + class ErrorName final { \ + public: \ + static JS::NonnullGCPtr create(JS::Realm& realm, DeprecatedFlyString const& message) \ + { \ + return DOMException::create(realm, #ErrorName, message); \ + } \ }; ENUMERATE_DOM_EXCEPTION_ERROR_NAMES #undef __ENUMERATE diff --git a/Userland/Libraries/LibWeb/XHR/EventNames.cpp b/Userland/Libraries/LibWeb/XHR/EventNames.cpp index 8f79bd5e2c7..b3848d0b9e5 100644 --- a/Userland/Libraries/LibWeb/XHR/EventNames.cpp +++ b/Userland/Libraries/LibWeb/XHR/EventNames.cpp @@ -8,7 +8,7 @@ namespace Web::XHR::EventNames { -#define __ENUMERATE_XHR_EVENT(name) FlyString name; +#define __ENUMERATE_XHR_EVENT(name) DeprecatedFlyString name; ENUMERATE_XHR_EVENTS #undef __ENUMERATE_XHR_EVENT diff --git a/Userland/Libraries/LibWeb/XHR/EventNames.h b/Userland/Libraries/LibWeb/XHR/EventNames.h index c1e222b61fa..9cf36a61027 100644 --- a/Userland/Libraries/LibWeb/XHR/EventNames.h +++ b/Userland/Libraries/LibWeb/XHR/EventNames.h @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace Web::XHR::EventNames { @@ -20,7 +20,7 @@ namespace Web::XHR::EventNames { __ENUMERATE_XHR_EVENT(timeout) \ __ENUMERATE_XHR_EVENT(loadend) -#define __ENUMERATE_XHR_EVENT(name) extern FlyString name; +#define __ENUMERATE_XHR_EVENT(name) extern DeprecatedFlyString name; ENUMERATE_XHR_EVENTS #undef __ENUMERATE_XHR_EVENT diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp index 10bba97a879..d26f53cce2a 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp @@ -9,17 +9,17 @@ namespace Web::XHR { -ProgressEvent* ProgressEvent::create(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) +ProgressEvent* ProgressEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init) { return realm.heap().allocate(realm, realm, event_name, event_init); } -ProgressEvent* ProgressEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) +ProgressEvent* ProgressEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init) { return create(realm, event_name, event_init); } -ProgressEvent::ProgressEvent(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) +ProgressEvent::ProgressEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init) : Event(realm, event_name, event_init) , m_length_computable(event_init.length_computable) , m_loaded(event_init.loaded) diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.h b/Userland/Libraries/LibWeb/XHR/ProgressEvent.h index e5d633920e1..3ef9daf643d 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.h +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.h @@ -23,8 +23,8 @@ class ProgressEvent final : public DOM::Event { WEB_PLATFORM_OBJECT(ProgressEvent, DOM::Event); public: - static ProgressEvent* create(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init); - static ProgressEvent* construct_impl(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init); + static ProgressEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init); + static ProgressEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init); virtual ~ProgressEvent() override; @@ -33,7 +33,7 @@ public: u64 total() const { return m_total; } private: - ProgressEvent(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init); + ProgressEvent(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init); bool m_length_computable { false }; u64 m_loaded { 0 }; diff --git a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp index 75ddd24b1b7..a58eb817672 100644 --- a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp +++ b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp @@ -14,7 +14,7 @@ inline namespace { extern char const* s_xhtml_unified_dtd; } -static FlyString s_html_namespace = "http://www.w3.org/1999/xhtml"; +static DeprecatedFlyString s_html_namespace = "http://www.w3.org/1999/xhtml"; namespace Web {