Skip to content

Truly independent web browser

Everywhere: Remove functions that nothing calls

Aliaksandr Kalenikfc10b23c25af
diff --git a/AK/CircularBuffer.cpp b/AK/CircularBuffer.cpp
index 7d7df199641..551cb75bce1 100644
--- a/AK/CircularBuffer.cpp
+++ b/AK/CircularBuffer.cpp
@@ -49,11 +49,6 @@ size_t CircularBuffer::capacity() const
return m_buffer.size();
}
-size_t CircularBuffer::seekback_limit() const
-{
- return m_seekback_limit;
-}
-
size_t SearchableCircularBuffer::search_limit() const
{
return m_seekback_limit - m_used_space;
diff --git a/AK/CircularBuffer.h b/AK/CircularBuffer.h
index cf10e5a78cb..1d8dfabb9ad 100644
--- a/AK/CircularBuffer.h
+++ b/AK/CircularBuffer.h
@@ -39,7 +39,6 @@ public:
[[nodiscard]] size_t empty_space() const;
[[nodiscard]] size_t used_space() const;
[[nodiscard]] size_t capacity() const;
- [[nodiscard]] size_t seekback_limit() const;
Optional<size_t> offset_of(StringView needle, Optional<size_t> from = {}, Optional<size_t> until = {}) const;
diff --git a/AK/JsonObject.cpp b/AK/JsonObject.cpp
index 294667ca076..207b2946046 100644
--- a/AK/JsonObject.cpp
+++ b/AK/JsonObject.cpp
@@ -65,21 +65,6 @@ Optional<JsonValue const&> JsonObject::get(StringView key) const
return it->value;
}
-Optional<i8> JsonObject::get_i8(StringView key) const
-{
- return get_integer<i8>(key);
-}
-
-Optional<u8> JsonObject::get_u8(StringView key) const
-{
- return get_integer<u8>(key);
-}
-
-Optional<i16> JsonObject::get_i16(StringView key) const
-{
- return get_integer<i16>(key);
-}
-
Optional<u16> JsonObject::get_u16(StringView key) const
{
return get_integer<u16>(key);
@@ -178,42 +163,18 @@ bool JsonObject::has(StringView key) const
return m_members.contains(key);
}
-bool JsonObject::has_null(StringView key) const
-{
- auto value = get(key);
- return value.has_value() && value->is_null();
-}
-
-bool JsonObject::has_bool(StringView key) const
-{
- auto value = get(key);
- return value.has_value() && value->is_bool();
-}
-
bool JsonObject::has_string(StringView key) const
{
auto value = get(key);
return value.has_value() && value->is_string();
}
-bool JsonObject::has_i8(StringView key) const
-{
- auto value = get(key);
- return value.has_value() && value->is_integer<i8>();
-}
-
bool JsonObject::has_u8(StringView key) const
{
auto value = get(key);
return value.has_value() && value->is_integer<u8>();
}
-bool JsonObject::has_i16(StringView key) const
-{
- auto value = get(key);
- return value.has_value() && value->is_integer<i16>();
-}
-
bool JsonObject::has_u16(StringView key) const
{
auto value = get(key);
@@ -238,12 +199,6 @@ bool JsonObject::has_i64(StringView key) const
return value.has_value() && value->is_integer<i64>();
}
-bool JsonObject::has_u64(StringView key) const
-{
- auto value = get(key);
- return value.has_value() && value->is_integer<u64>();
-}
-
bool JsonObject::has_number(StringView key) const
{
auto value = get(key);
diff --git a/AK/JsonObject.h b/AK/JsonObject.h
index b2375f28376..dbd6a27ea4f 100644
--- a/AK/JsonObject.h
+++ b/AK/JsonObject.h
@@ -38,17 +38,12 @@ public:
[[nodiscard]] bool has(StringView key) const;
- [[nodiscard]] bool has_null(StringView key) const;
- [[nodiscard]] bool has_bool(StringView key) const;
[[nodiscard]] bool has_string(StringView key) const;
- [[nodiscard]] bool has_i8(StringView key) const;
[[nodiscard]] bool has_u8(StringView key) const;
- [[nodiscard]] bool has_i16(StringView key) const;
[[nodiscard]] bool has_u16(StringView key) const;
[[nodiscard]] bool has_i32(StringView key) const;
[[nodiscard]] bool has_u32(StringView key) const;
[[nodiscard]] bool has_i64(StringView key) const;
- [[nodiscard]] bool has_u64(StringView key) const;
[[nodiscard]] bool has_number(StringView key) const;
[[nodiscard]] bool has_array(StringView key) const;
[[nodiscard]] bool has_object(StringView key) const;
@@ -65,9 +60,6 @@ public:
return {};
}
- Optional<i8> get_i8(StringView key) const;
- Optional<u8> get_u8(StringView key) const;
- Optional<i16> get_i16(StringView key) const;
Optional<u16> get_u16(StringView key) const;
Optional<i32> get_i32(StringView key) const;
Optional<u32> get_u32(StringView key) const;
diff --git a/AK/MemoryStream.cpp b/AK/MemoryStream.cpp
index 70a854b875b..91e23f25bf9 100644
--- a/AK/MemoryStream.cpp
+++ b/AK/MemoryStream.cpp
@@ -176,27 +176,6 @@ ReadonlyBytes AllocatingMemoryStream::peek_some_contiguous() const
return ReadonlyBytes { m_head->data + m_head_read_offset, end - m_head_read_offset };
}
-void AllocatingMemoryStream::peek_some(Bytes bytes) const
-{
- size_t read_bytes = 0;
- auto const* chunk = m_head.ptr();
- auto chunk_offset = m_head_read_offset;
-
- while (chunk && read_bytes < bytes.size()) {
- auto const end = (chunk == m_tail) ? m_tail_write_offset : CHUNK_SIZE;
- ReadonlyBytes available { chunk->data + chunk_offset, end - chunk_offset };
-
- auto copied = available.copy_trimmed_to(bytes.slice(read_bytes));
- read_bytes += copied;
-
- if (copied < available.size())
- break;
-
- chunk = chunk->next.ptr();
- chunk_offset = 0;
- }
-}
-
ErrorOr<Bytes> AllocatingMemoryStream::read_some(Bytes bytes)
{
size_t read_bytes = 0;
diff --git a/AK/MemoryStream.h b/AK/MemoryStream.h
index 699e713455d..3b73282abe4 100644
--- a/AK/MemoryStream.h
+++ b/AK/MemoryStream.h
@@ -106,7 +106,6 @@ public:
AllocatingMemoryStream() = default;
~AllocatingMemoryStream();
- void peek_some(Bytes) const;
ReadonlyBytes peek_some_contiguous() const;
virtual ErrorOr<Bytes> read_some(Bytes) override;
diff --git a/AK/String.cpp b/AK/String.cpp
index 6ba0e848ea4..ddc9153384d 100644
--- a/AK/String.cpp
+++ b/AK/String.cpp
@@ -464,21 +464,6 @@ String String::bijective_base_from(size_t value, Case target_case, unsigned base
return MUST(from_utf8(ReadonlyBytes(buffer.data(), i)));
}
-String String::greek_letter_from(size_t value)
-{
- static StringView const map = "αβγδεζηθικλμνξοπρστυφχψω"sv;
- static unsigned const base = 24;
-
- StringBuilder builder;
- while (value > 0) {
- value--;
- builder.append(map.substring_view((value % base) * 2, 2));
- value /= base;
- }
-
- return MUST(builder.to_string_without_validation().reverse());
-}
-
String String::roman_number_from(size_t value, Case target_case)
{
if (value > 3999)
diff --git a/AK/String.h b/AK/String.h
index 62f7f2ef8ab..0d8413d406f 100644
--- a/AK/String.h
+++ b/AK/String.h
@@ -131,7 +131,6 @@ public:
Lower,
};
[[nodiscard]] static String bijective_base_from(size_t value, Case, unsigned base = 26, Optional<StringView> map = {});
- [[nodiscard]] static String greek_letter_from(size_t value);
[[nodiscard]] static String roman_number_from(size_t value, Case);
// Creates a new String by case-transforming this String. Using these methods require linking LibUnicode into your application.
diff --git a/AK/StringBuilder.cpp b/AK/StringBuilder.cpp
index 6c4de80064e..5319f4e36f6 100644
--- a/AK/StringBuilder.cpp
+++ b/AK/StringBuilder.cpp
@@ -452,11 +452,6 @@ String StringBuilder::to_string_without_validation()
return String::from_string_builder_without_validation({}, *this);
}
-FlyString StringBuilder::to_fly_string_without_validation() const
-{
- return FlyString::from_utf8_without_validation(string_view().bytes());
-}
-
ErrorOr<FlyString> StringBuilder::to_fly_string() const
{
return FlyString::from_utf8(string_view());
diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h
index 22eb28fe103..5223e533f76 100644
--- a/AK/StringBuilder.h
+++ b/AK/StringBuilder.h
@@ -127,7 +127,6 @@ public:
[[nodiscard]] String to_string_without_validation();
ErrorOr<String> to_string();
- [[nodiscard]] FlyString to_fly_string_without_validation() const;
ErrorOr<FlyString> to_fly_string() const;
[[nodiscard]] ErrorOr<ByteBuffer> to_byte_buffer() const;
diff --git a/AK/StringView.cpp b/AK/StringView.cpp
index 2f409ce9e4c..dc0d5a89850 100644
--- a/AK/StringView.cpp
+++ b/AK/StringView.cpp
@@ -216,26 +216,6 @@ String StringView::to_ascii_lowercase_string() const
return result;
}
-String StringView::to_ascii_uppercase_string() const
-{
- VERIFY(Utf8View { *this }.validate());
-
- String result;
-
- MUST(result.replace_with_new_string(Badge<StringView> {}, length(), [&](Bytes buffer) -> ErrorOr<void> {
- for (auto [i, character] : enumerate(bytes()))
- buffer[i] = static_cast<u8>(AK::to_ascii_uppercase(character));
- return {};
- }));
-
- return result;
-}
-
-String StringView::to_ascii_titlecase_string() const
-{
- return StringUtils::to_titlecase(*this);
-}
-
StringView StringView::substring_view_starting_from_substring(StringView substring) const
{
char const* remaining_characters = substring.characters_without_null_termination();
diff --git a/AK/StringView.h b/AK/StringView.h
index e714a76e814..84e82ffc809 100644
--- a/AK/StringView.h
+++ b/AK/StringView.h
@@ -104,8 +104,6 @@ public:
[[nodiscard]] StringView trim_whitespace(TrimMode mode = TrimMode::Both) const { return StringUtils::trim_whitespace(*this, mode); }
[[nodiscard]] String to_ascii_lowercase_string() const;
- [[nodiscard]] String to_ascii_uppercase_string() const;
- [[nodiscard]] String to_ascii_titlecase_string() const;
[[nodiscard]] Optional<size_t> find(char needle, size_t start = 0) const { return StringUtils::find(*this, needle, start); }
[[nodiscard]] Optional<size_t> find(StringView needle, size_t start = 0) const { return StringUtils::find(*this, needle, start); }
diff --git a/AK/Time.cpp b/AK/Time.cpp
index 9da3a5db89d..ece2f7e4ceb 100644
--- a/AK/Time.cpp
+++ b/AK/Time.cpp
@@ -55,15 +55,6 @@ unsigned day_of_week(int year, unsigned month, int day)
return (year + year / 4 - year / 100 + year / 400 + seek_table[month - 1] + day) % 7;
}
-Duration Duration::from_ticks(clock_t ticks, time_t ticks_per_second)
-{
- auto secs = ticks % ticks_per_second;
-
- i32 nsecs = 1'000'000'000 * (ticks - (ticks_per_second * secs)) / ticks_per_second;
- i32 extra_secs = sane_mod(nsecs, 1'000'000'000);
- return Duration::from_half_sanitized(secs, extra_secs, nsecs);
-}
-
Duration Duration::from_timespec(const struct timespec& ts)
{
i32 nsecs = ts.tv_nsec;
diff --git a/AK/Time.h b/AK/Time.h
index 754dad2cce4..47ff8621e75 100644
--- a/AK/Time.h
+++ b/AK/Time.h
@@ -239,7 +239,6 @@ public:
i64 seconds = sane_mod(milliseconds, 1'000);
return Duration(seconds, milliseconds * 1'000'000);
}
- [[nodiscard]] static Duration from_ticks(clock_t, time_t);
[[nodiscard]] static Duration from_timespec(const struct timespec&);
[[nodiscard]] static Duration from_timeval(const struct timeval&);
[[nodiscard]] static Duration from_time_units(i64 units, u32 numerator, u32 denominator);
diff --git a/AK/Utf8View.cpp b/AK/Utf8View.cpp
index 791f1e2c953..7865d355209 100644
--- a/AK/Utf8View.cpp
+++ b/AK/Utf8View.cpp
@@ -24,11 +24,6 @@ Utf8CodePointIterator Utf8View::iterator_at_byte_offset(size_t byte_offset) cons
return end();
}
-Utf8CodePointIterator Utf8View::iterator_at_byte_offset_without_validation(size_t byte_offset) const
-{
- return Utf8CodePointIterator { reinterpret_cast<u8 const*>(m_string.characters_without_null_termination()) + byte_offset, m_string.length() - byte_offset };
-}
-
size_t Utf8View::code_point_offset_of(size_t byte_offset) const
{
VERIFY(byte_offset <= byte_length());
diff --git a/AK/Utf8View.h b/AK/Utf8View.h
index 7e4ba35a7e8..80b2910a239 100644
--- a/AK/Utf8View.h
+++ b/AK/Utf8View.h
@@ -87,8 +87,6 @@ public:
Utf8CodePointIterator end() const { return { end_ptr(), 0 }; }
Utf8CodePointIterator iterator_at_byte_offset(size_t) const;
- Utf8CodePointIterator iterator_at_byte_offset_without_validation(size_t) const;
-
unsigned char const* bytes() const { return begin_ptr(); }
size_t byte_length() const { return m_string.length(); }
[[nodiscard]] ALWAYS_INLINE size_t length_in_code_units() const { return byte_length(); }
diff --git a/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.cpp b/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.cpp
index d9c612956db..b74f790ac69 100644
--- a/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.cpp
+++ b/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.cpp
@@ -54,29 +54,6 @@ ClipNodeIndex VisualContextTreeTestBuilder::append_clip(ClipNodeIndex parent, Sp
return ClipNodeIndex { Compositing::RustFFI::visual_context_tree_test_builder_append_clip(m_builder, parent.value(), spatial.value(), rect, corner_radii, mode) };
}
-ClipNodeIndex VisualContextTreeTestBuilder::append_clip_path(ClipNodeIndex parent, SpatialNodeIndex spatial, Gfx::Path const& path, Gfx::IntRect bounding_rect, Gfx::WindingRule fill_rule)
-{
- auto path_bytes = path.serialize_to_bytes();
- return ClipNodeIndex { Compositing::RustFFI::visual_context_tree_test_builder_append_clip_path(m_builder, parent.value(), spatial.value(), path_bytes.data(), path_bytes.size(), bounding_rect, fill_rule) };
-}
-
-EffectNodeIndex VisualContextTreeTestBuilder::append_effects(EffectNodeIndex parent, SpatialNodeIndex spatial, ClipNodeIndex local_clip, float opacity, Gfx::CompositingAndBlendingOperator blend_mode)
-{
- return EffectNodeIndex { Compositing::RustFFI::visual_context_tree_test_builder_append_effects(m_builder, parent.value(), spatial.value(), local_clip.value(), opacity, blend_mode) };
-}
-
-EffectNodeIndex VisualContextTreeTestBuilder::append_background_color_animation(EffectNodeIndex parent, SpatialNodeIndex spatial, ClipNodeIndex local_clip)
-{
- return EffectNodeIndex { Compositing::RustFFI::visual_context_tree_test_builder_append_background_color_animation(m_builder, parent.value(), spatial.value(), local_clip.value()) };
-}
-
-AccumulatedVisualContextTree VisualContextTreeTestBuilder::finish_with_structural_epoch(u64 structural_epoch)
-{
- VERIFY(m_builder);
- Compositing::RustFFI::visual_context_tree_test_builder_set_structural_epoch(m_builder, structural_epoch);
- return finish();
-}
-
AccumulatedVisualContextTree VisualContextTreeTestBuilder::finish()
{
VERIFY(m_builder);
diff --git a/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.h b/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.h
index 3db9b2dd6f6..a1827418c7a 100644
--- a/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.h
+++ b/Libraries/LibCompositing/DisplayList/VisualContextTreeTestBuilder.h
@@ -50,13 +50,9 @@ public:
SpatialNodeIndex append_scroll(SpatialNodeIndex parent);
SpatialNodeIndex append_sticky(SpatialNodeIndex parent, StickyConstraints const&);
ClipNodeIndex append_clip(ClipNodeIndex parent, SpatialNodeIndex spatial, Gfx::FloatRect, Gfx::CornerRadii = {}, ClipMode = ClipMode::Intersect);
- ClipNodeIndex append_clip_path(ClipNodeIndex parent, SpatialNodeIndex spatial, Gfx::Path const&, Gfx::IntRect bounding_rect, Gfx::WindingRule);
- EffectNodeIndex append_effects(EffectNodeIndex parent, SpatialNodeIndex spatial, ClipNodeIndex local_clip = NO_CLIP_NODE, float opacity = 1.0f, Gfx::CompositingAndBlendingOperator = Gfx::CompositingAndBlendingOperator::Normal);
- EffectNodeIndex append_background_color_animation(EffectNodeIndex parent, SpatialNodeIndex spatial, ClipNodeIndex local_clip = NO_CLIP_NODE);
// The frame a context names for recording under the given clip and effect.
AccumulatedVisualContextTree finish();
- AccumulatedVisualContextTree finish_with_structural_epoch(u64 structural_epoch);
private:
void* m_builder { nullptr };
diff --git a/Libraries/LibCompositing/Scrolling/AsyncScrollTree.cpp b/Libraries/LibCompositing/Scrolling/AsyncScrollTree.cpp
index ea9fc3dac4e..c008cb4c5c8 100644
--- a/Libraries/LibCompositing/Scrolling/AsyncScrollTree.cpp
+++ b/Libraries/LibCompositing/Scrolling/AsyncScrollTree.cpp
@@ -354,16 +354,6 @@ void AsyncScrollTree::rebuild_wheel_hit_test_targets(RefPtr<Compositing::Display
}
}
-void AsyncScrollTree::clear_wheel_hit_test_targets()
-{
- m_cached_wheel_hit_test_targets.clear();
- m_cached_main_thread_wheel_event_targets.clear();
- m_cached_nested_context_wheel_regions.clear();
- m_cached_blocking_wheel_event_targets.clear();
- m_cached_scroll_chaining_barriers.clear();
- m_visual_context_tree_structural_epoch.clear();
-}
-
static bool rounded_rect_contains_point(Gfx::FloatRect const& rect, Gfx::CornerRadii const& corner_radii, Gfx::FloatPoint position_in_context)
{
if (!rect.contains(position_in_context))
diff --git a/Libraries/LibCompositing/Scrolling/AsyncScrollTree.h b/Libraries/LibCompositing/Scrolling/AsyncScrollTree.h
index 83c4c22dab4..bd41cb95be5 100644
--- a/Libraries/LibCompositing/Scrolling/AsyncScrollTree.h
+++ b/Libraries/LibCompositing/Scrolling/AsyncScrollTree.h
@@ -131,7 +131,6 @@ public:
void set_state(AsyncScrollingState&&);
void rebuild_wheel_hit_test_targets(RefPtr<Compositing::DisplayList const> const&, Compositing::AccumulatedVisualContextTree const*, Compositing::ScrollStateSnapshot const&);
- void clear_wheel_hit_test_targets();
Optional<Gfx::FloatPoint> scroll_offset_for_node(AsyncScrollNodeID, Compositing::ScrollStateSnapshot const&) const;
Optional<Web::UniqueNodeID> document_id() const;
diff --git a/Libraries/LibCompress/Deflate.cpp b/Libraries/LibCompress/Deflate.cpp
index 797bf9471d7..80ee89463b1 100644
--- a/Libraries/LibCompress/Deflate.cpp
+++ b/Libraries/LibCompress/Deflate.cpp
@@ -15,18 +15,6 @@
namespace Compress {
-CanonicalCode const& CanonicalCode::fixed_literal_codes()
-{
- static NeverDestroyed<CanonicalCode> code { MUST(CanonicalCode::from_bytes(fixed_literal_bit_lengths)) };
- return *code;
-}
-
-CanonicalCode const& CanonicalCode::fixed_distance_codes()
-{
- static NeverDestroyed<CanonicalCode> code { MUST(CanonicalCode::from_bytes(fixed_distance_bit_lengths)) };
- return *code;
-}
-
ErrorOr<CanonicalCode> CanonicalCode::from_bytes(ReadonlyBytes bytes)
{
CanonicalCode code;
diff --git a/Libraries/LibCompress/Deflate.h b/Libraries/LibCompress/Deflate.h
index f462d760179..7db9f26df0c 100644
--- a/Libraries/LibCompress/Deflate.h
+++ b/Libraries/LibCompress/Deflate.h
@@ -20,9 +20,6 @@ public:
ErrorOr<u32> read_symbol(LittleEndianInputBitStream&) const;
ErrorOr<void> write_symbol(LittleEndianOutputBitStream&, u32) const;
- static CanonicalCode const& fixed_literal_codes();
- static CanonicalCode const& fixed_distance_codes();
-
static ErrorOr<CanonicalCode> from_bytes(ReadonlyBytes);
private:
diff --git a/Libraries/LibCore/ArgsParser.cpp b/Libraries/LibCore/ArgsParser.cpp
index 00ba12ac0b9..6167b00fd5f 100644
--- a/Libraries/LibCore/ArgsParser.cpp
+++ b/Libraries/LibCore/ArgsParser.cpp
@@ -404,22 +404,6 @@ void ArgsParser::add_option(Option&& option)
m_options.append(move(option));
}
-void ArgsParser::add_ignored(char const* long_name, char short_name, OptionHideMode hide_mode)
-{
- Option option {
- OptionArgumentMode::None,
- "Ignored",
- long_name,
- short_name,
- nullptr,
- [](StringView) -> ErrorOr<bool> {
- return true;
- },
- hide_mode,
- };
- add_option(move(option));
-}
-
void ArgsParser::add_option(bool& value, char const* help_string, char const* long_name, char short_name, OptionHideMode hide_mode)
{
Option option {
diff --git a/Libraries/LibCore/ArgsParser.h b/Libraries/LibCore/ArgsParser.h
index 881d2e3b3e1..0d49ef62902 100644
--- a/Libraries/LibCore/ArgsParser.h
+++ b/Libraries/LibCore/ArgsParser.h
@@ -86,7 +86,6 @@ public:
void print_version(FILE*);
void add_option(Option&&);
- void add_ignored(char const* long_name, char short_name = 0, OptionHideMode hide_mode = OptionHideMode::None);
void add_option(bool& value, char const* help_string, char const* long_name, char short_name = 0, OptionHideMode hide_mode = OptionHideMode::None);
/// If the option is present, set the enum to have the given `new_value`.
template<Enum T>
diff --git a/Libraries/LibCore/ConfigFile.cpp b/Libraries/LibCore/ConfigFile.cpp
index 33641852536..5efd20f0e0a 100644
--- a/Libraries/LibCore/ConfigFile.cpp
+++ b/Libraries/LibCore/ConfigFile.cpp
@@ -135,9 +135,4 @@ bool ConfigFile::has_key(ByteString const& group, ByteString const& key) const
return it->value.contains(key);
}
-bool ConfigFile::has_group(ByteString const& group) const
-{
- return m_groups.contains(group);
-}
-
}
diff --git a/Libraries/LibCore/ConfigFile.h b/Libraries/LibCore/ConfigFile.h
index ef330d1ecef..e5b8cc87f03 100644
--- a/Libraries/LibCore/ConfigFile.h
+++ b/Libraries/LibCore/ConfigFile.h
@@ -26,7 +26,6 @@ public:
static ErrorOr<NonnullRefPtr<ConfigFile>> open(ByteString const& filename, NonnullOwnPtr<Core::File>);
~ConfigFile();
- bool has_group(ByteString const&) const;
bool has_key(ByteString const& group, ByteString const& key) const;
Vector<ByteString> groups() const;
diff --git a/Libraries/LibCore/DirectoryEntry.cpp b/Libraries/LibCore/DirectoryEntry.cpp
index 9bc2543ce54..bae5dec373a 100644
--- a/Libraries/LibCore/DirectoryEntry.cpp
+++ b/Libraries/LibCore/DirectoryEntry.cpp
@@ -10,56 +10,6 @@
namespace Core {
-StringView DirectoryEntry::posix_name_from_directory_entry_type(Type type)
-{
- switch (type) {
- case Type::BlockDevice:
- return "DT_BLK"sv;
- case Type::CharacterDevice:
- return "DT_CHR"sv;
- case Type::Directory:
- return "DT_DIR"sv;
- case Type::File:
- return "DT_REG"sv;
- case Type::NamedPipe:
- return "DT_FIFO"sv;
- case Type::Socket:
- return "DT_SOCK"sv;
- case Type::SymbolicLink:
- return "DT_LNK"sv;
- case Type::Unknown:
- return "DT_UNKNOWN"sv;
- case Type::Whiteout:
- return "DT_WHT"sv;
- }
- VERIFY_NOT_REACHED();
-}
-
-StringView DirectoryEntry::representative_name_from_directory_entry_type(Type type)
-{
- switch (type) {
- case Type::BlockDevice:
- return "BlockDevice"sv;
- case Type::CharacterDevice:
- return "CharacterDevice"sv;
- case Type::Directory:
- return "Directory"sv;
- case Type::File:
- return "File"sv;
- case Type::NamedPipe:
- return "NamedPipe"sv;
- case Type::Socket:
- return "Socket"sv;
- case Type::SymbolicLink:
- return "SymbolicLink"sv;
- case Type::Unknown:
- return "Unknown"sv;
- case Type::Whiteout:
- return "Whiteout"sv;
- }
- VERIFY_NOT_REACHED();
-}
-
DirectoryEntry::Type DirectoryEntry::directory_entry_type_from_stat(mode_t st_mode)
{
switch (st_mode & S_IFMT) {
diff --git a/Libraries/LibCore/DirectoryEntry.h b/Libraries/LibCore/DirectoryEntry.h
index b552e36cf00..0bde7a24280 100644
--- a/Libraries/LibCore/DirectoryEntry.h
+++ b/Libraries/LibCore/DirectoryEntry.h
@@ -33,8 +33,6 @@ struct DirectoryEntry {
ByteString name;
ino_t inode_number;
- static StringView posix_name_from_directory_entry_type(Type);
- static StringView representative_name_from_directory_entry_type(Type);
static Type directory_entry_type_from_stat(mode_t st_mode);
static DirectoryEntry from_dirent(dirent const&);
static DirectoryEntry from_stat(DIR*, dirent const&);
diff --git a/Libraries/LibCore/File.cpp b/Libraries/LibCore/File.cpp
index c3cbaa3c360..f7d612ed5d4 100644
--- a/Libraries/LibCore/File.cpp
+++ b/Libraries/LibCore/File.cpp
@@ -55,21 +55,6 @@ ErrorOr<NonnullOwnPtr<File>> File::standard_error()
return File::adopt_fd(STDERR_FILENO, OpenMode::Write, ShouldCloseFileDescriptor::No);
}
-ErrorOr<NonnullOwnPtr<File>> File::open_file_or_standard_stream(StringView filename, OpenMode mode)
-{
- if (!filename.is_empty() && filename != "-"sv)
- return File::open(filename, mode);
-
- switch (mode) {
- case OpenMode::Read:
- return standard_input();
- case OpenMode::Write:
- return standard_output();
- default:
- VERIFY_NOT_REACHED();
- }
-}
-
ErrorOr<ByteBuffer> File::read_until_eof(size_t block_size)
{
// Note: This is used as a heuristic, it's not valid for devices or virtual files.
diff --git a/Libraries/LibCore/File.h b/Libraries/LibCore/File.h
index 5c7c25a11de..a3e34262fe9 100644
--- a/Libraries/LibCore/File.h
+++ b/Libraries/LibCore/File.h
@@ -55,7 +55,6 @@ public:
static ErrorOr<NonnullOwnPtr<File>> standard_input();
static ErrorOr<NonnullOwnPtr<File>> standard_output();
static ErrorOr<NonnullOwnPtr<File>> standard_error();
- static ErrorOr<NonnullOwnPtr<File>> open_file_or_standard_stream(StringView filename, OpenMode mode);
File(File&& other) { operator=(move(other)); }
diff --git a/Libraries/LibCore/IOSurface.cpp b/Libraries/LibCore/IOSurface.cpp
index a05871b8c4a..866fa7ecb5d 100644
--- a/Libraries/LibCore/IOSurface.cpp
+++ b/Libraries/LibCore/IOSurface.cpp
@@ -117,16 +117,6 @@ IOSurfaceHandle IOSurfaceHandle::from_ref(void* io_surface_ref)
return IOSurfaceHandle(make<IOSurfaceRefWrapper>(ref));
}
-void IOSurfaceHandle::increment_use_count()
-{
- IOSurfaceIncrementUseCount(m_ref_wrapper->ref);
-}
-
-void IOSurfaceHandle::decrement_use_count()
-{
- IOSurfaceDecrementUseCount(m_ref_wrapper->ref);
-}
-
bool IOSurfaceHandle::is_in_use() const
{
return IOSurfaceIsInUse(m_ref_wrapper->ref);
diff --git a/Libraries/LibCore/IOSurface.h b/Libraries/LibCore/IOSurface.h
index 6d2ef9636f7..1b62f7537f3 100644
--- a/Libraries/LibCore/IOSurface.h
+++ b/Libraries/LibCore/IOSurface.h
@@ -27,10 +27,6 @@ public:
// Adopts a surface owned by someone else, such as one a decoder hands back, by retaining it.
static IOSurfaceHandle from_ref(void* io_surface_ref);
- // Whoever allocated the surface may recycle it as soon as its use count falls to zero. Retaining it does not
- // make it used.
- void increment_use_count();
- void decrement_use_count();
bool is_in_use() const;
MachPort create_mach_port() const;
diff --git a/Libraries/LibCore/ImmutableBytes.cpp b/Libraries/LibCore/ImmutableBytes.cpp
index 3e102c34079..4633818481e 100644
--- a/Libraries/LibCore/ImmutableBytes.cpp
+++ b/Libraries/LibCore/ImmutableBytes.cpp
@@ -15,22 +15,6 @@ ErrorOr<ImmutableBytes> ImmutableBytes::copy(ReadonlyBytes bytes)
return adopt(TRY(ByteBuffer::copy(bytes)));
}
-ErrorOr<ImmutableBytes> ImmutableBytes::copy_to_readonly_mapping(ReadonlyBytes bytes)
-{
- // Empty input has no bytes to protect, so it remains backed by an empty ByteBuffer.
- if (bytes.is_empty())
- return adopt(ByteBuffer {});
-
- auto* mapping = TRY(Core::System::allocate_anonymous_memory(bytes.size()));
- auto release_mapping = ArmedScopeGuard([&] {
- MUST(Core::System::release_address_space(mapping, bytes.size()));
- });
- __builtin_memcpy(mapping, bytes.data(), bytes.size());
- TRY(Core::System::protect_memory_readonly(mapping, bytes.size()));
- release_mapping.disarm();
- return ImmutableBytes { adopt_ref(*new Impl(Impl::ReadonlyMapping { mapping, bytes.size() })) };
-}
-
ImmutableBytes ImmutableBytes::adopt(ByteBuffer bytes)
{
return ImmutableBytes { adopt_ref(*new Impl(move(bytes))) };
diff --git a/Libraries/LibCore/ImmutableBytes.h b/Libraries/LibCore/ImmutableBytes.h
index 8735ea4841a..20f35ae029b 100644
--- a/Libraries/LibCore/ImmutableBytes.h
+++ b/Libraries/LibCore/ImmutableBytes.h
@@ -24,7 +24,6 @@ public:
AK_ALLOC_WITH_KMALLOC;
static ErrorOr<ImmutableBytes> copy(ReadonlyBytes);
- static ErrorOr<ImmutableBytes> copy_to_readonly_mapping(ReadonlyBytes);
static ImmutableBytes adopt(ByteBuffer);
static ImmutableBytes adopt_mapped_file(NonnullOwnPtr<MappedFile>);
static ImmutableBytes adopt_anonymous_buffer(AnonymousBuffer);
diff --git a/Libraries/LibCore/Resource.cpp b/Libraries/LibCore/Resource.cpp
index c263989f98a..b9f9fe58302 100644
--- a/Libraries/LibCore/Resource.cpp
+++ b/Libraries/LibCore/Resource.cpp
@@ -27,17 +27,6 @@ Resource::Resource(String path, Scheme scheme, DirectoryTag, time_t modified_tim
{
}
-ErrorOr<NonnullRefPtr<Resource>> Resource::load_from_filesystem(StringView path)
-{
- auto filepath = LexicalPath(path);
-
- if (filepath.is_absolute())
- return load_from_uri(TRY(String::formatted("file://{}", path)));
-
- auto cwd = TRY(Core::System::getcwd());
- return load_from_uri(TRY(String::formatted("file://{}", filepath.prepend(cwd).string())));
-}
-
ErrorOr<NonnullRefPtr<Resource>> Resource::load_from_uri(StringView uri)
{
return ResourceImplementation::the().load_from_uri(uri);
diff --git a/Libraries/LibCore/Resource.h b/Libraries/LibCore/Resource.h
index 335a172388d..b6f90b97cc4 100644
--- a/Libraries/LibCore/Resource.h
+++ b/Libraries/LibCore/Resource.h
@@ -22,7 +22,6 @@ namespace Core {
class CORE_API Resource : public RefCounted<Resource> {
public:
- static ErrorOr<NonnullRefPtr<Resource>> load_from_filesystem(StringView);
static ErrorOr<NonnullRefPtr<Resource>> load_from_uri(StringView);
[[nodiscard]] bool is_file() const { return !m_data.has<DirectoryTag>(); }
diff --git a/Libraries/LibCrypto/ASN1/DER.cpp b/Libraries/LibCrypto/ASN1/DER.cpp
index 3a3450d7dc3..c44ffac2517 100644
--- a/Libraries/LibCrypto/ASN1/DER.cpp
+++ b/Libraries/LibCrypto/ASN1/DER.cpp
@@ -70,16 +70,6 @@ ErrorOr<u8> Decoder::read_byte()
return byte;
}
-ErrorOr<ReadonlyBytes> Decoder::peek_entry_bytes()
-{
- if (m_stack.is_empty())
- return Error::from_string_literal("ASN1::Decoder: Reading bytes from an empty stack");
-
- auto entry = m_stack.last();
-
- return entry;
-}
-
ErrorOr<ReadonlyBytes> Decoder::read_bytes(size_t length)
{
if (m_stack.is_empty())
diff --git a/Libraries/LibCrypto/ASN1/DER.h b/Libraries/LibCrypto/ASN1/DER.h
index 0e16867edaf..bb5c1ed4ca9 100644
--- a/Libraries/LibCrypto/ASN1/DER.h
+++ b/Libraries/LibCrypto/ASN1/DER.h
@@ -239,8 +239,6 @@ public:
ErrorOr<void> enter();
ErrorOr<void> leave();
- ErrorOr<ReadonlyBytes> peek_entry_bytes();
-
private:
template<typename ValueType, typename DecodedType>
ErrorOr<ValueType> with_type_check(DecodedType&& value)
diff --git a/Libraries/LibCrypto/ASN1/PEM.cpp b/Libraries/LibCrypto/ASN1/PEM.cpp
index 08e920eb27b..00d27ec7d6a 100644
--- a/Libraries/LibCrypto/ASN1/PEM.cpp
+++ b/Libraries/LibCrypto/ASN1/PEM.cpp
@@ -81,53 +81,6 @@ DecodedPEM decode_pem(ReadonlyBytes data)
return decoded;
}
-ErrorOr<Vector<DecodedPEM>> decode_pems(ReadonlyBytes data)
-{
- GenericLexer lexer { data };
- Vector<DecodedPEM> pems;
-
- DecodedPEM decoded;
- StringView header_type;
-
- enum {
- Junk,
- Parsing,
- } state { Junk };
- while (!lexer.is_eof()) {
- switch (state) {
- case Junk:
- if (lexer.consume_specific("-----BEGIN "sv)) {
- state = Parsing;
- header_type = lexer.consume_until("-----"sv);
- }
- lexer.consume_line();
- break;
- case Parsing: {
- if (lexer.consume_specific("-----END "sv)) {
- state = Junk;
-
- if (lexer.consume_until("-----"sv) != header_type) {
- return Error::from_string_literal("PEM type mismatch");
- }
- lexer.consume_line();
-
- TRY(pems.try_append(decoded));
- decoded = {};
- header_type = {};
- break;
- }
- auto b64decoded = TRY(decode_base64(lexer.consume_line().trim_whitespace(TrimMode::Right)));
- TRY(decoded.data.try_append(b64decoded.data(), b64decoded.size()));
- break;
- }
- default:
- VERIFY_NOT_REACHED();
- }
- }
-
- return pems;
-}
-
ErrorOr<ByteBuffer> encode_pem(ReadonlyBytes data, PEMType type)
{
ByteBuffer encoded;
diff --git a/Libraries/LibCrypto/ASN1/PEM.h b/Libraries/LibCrypto/ASN1/PEM.h
index 75249f62442..5298b97d0fe 100644
--- a/Libraries/LibCrypto/ASN1/PEM.h
+++ b/Libraries/LibCrypto/ASN1/PEM.h
@@ -25,7 +25,6 @@ struct DecodedPEM {
};
DecodedPEM decode_pem(ReadonlyBytes);
-ErrorOr<Vector<DecodedPEM>> decode_pems(ReadonlyBytes);
ErrorOr<ByteBuffer> encode_pem(ReadonlyBytes, PEMType = PEMType::Certificate);
}
diff --git a/Libraries/LibCrypto/Authentication/KMAC.cpp b/Libraries/LibCrypto/Authentication/KMAC.cpp
index 52c07cda28e..ea20ff36c27 100644
--- a/Libraries/LibCrypto/Authentication/KMAC.cpp
+++ b/Libraries/LibCrypto/Authentication/KMAC.cpp
@@ -12,15 +12,6 @@
namespace Crypto::Authentication {
-Optional<KMACKind> KMAC::kind_from_algorithm_name(StringView algorithm_name)
-{
- if (algorithm_name == "KMAC128"sv)
- return KMACKind::KMAC128;
- if (algorithm_name == "KMAC256"sv)
- return KMACKind::KMAC256;
- return {};
-}
-
u32 KMAC::default_key_length(KMACKind kind)
{
switch (kind) {
diff --git a/Libraries/LibCrypto/Authentication/KMAC.h b/Libraries/LibCrypto/Authentication/KMAC.h
index 2ccd6678d99..ccfd4351956 100644
--- a/Libraries/LibCrypto/Authentication/KMAC.h
+++ b/Libraries/LibCrypto/Authentication/KMAC.h
@@ -26,7 +26,6 @@ public:
~KMAC() = default;
- static Optional<KMACKind> kind_from_algorithm_name(StringView);
static u32 default_key_length(KMACKind);
ErrorOr<ByteBuffer> sign(
diff --git a/Libraries/LibDNS/Message.cpp b/Libraries/LibDNS/Message.cpp
index 9475f88ecbe..9fe97f64241 100644
--- a/Libraries/LibDNS/Message.cpp
+++ b/Libraries/LibDNS/Message.cpp
@@ -165,58 +165,6 @@ Vector<ResourceRecord> Message::answers_to(Question const& question) const
return accepted;
}
-ErrorOr<String> Message::format_for_log() const
-{
- StringBuilder builder;
- builder.appendff("ID: {}\n", header.id);
- builder.appendff("Flags: {} ({:x})\n", header.options.to_string(), header.options.raw);
- builder.appendff("qdcount: {}, ancount: {}, nscount: {}, arcount: {}\n", header.question_count, header.answer_count, header.authority_count, header.additional_count);
-
- if (header.question_count > 0) {
- builder.appendff("Questions:\n");
- for (auto& q : questions)
- builder.appendff(" {} {} {}\n", q.name.to_string(), to_string(q.class_), to_string(q.type));
- }
-
- if (header.answer_count > 0) {
- builder.appendff("Answers:\n");
- for (auto& a : answers) {
- builder.appendff(" {} {} {}\n", a.name.to_string(), to_string(a.class_), to_string(a.type));
- a.record.visit(
- [&](auto const& record) { builder.appendff(" {}\n", MUST(record.to_string())); },
- [&](ByteBuffer const& raw) {
- builder.appendff(" {:hex-dump}\n", raw.bytes());
- });
- }
- }
-
- if (header.authority_count > 0) {
- builder.appendff("Authorities:\n");
- for (auto& a : authorities) {
- builder.appendff(" {} {} {}\n", a.name.to_string(), to_string(a.class_), to_string(a.type));
- a.record.visit(
- [&](auto const& record) { builder.appendff(" {}\n", MUST(record.to_string())); },
- [&](ByteBuffer const& raw) {
- builder.appendff(" {:hex-dump}\n", raw.bytes());
- });
- }
- }
-
- if (header.additional_count > 0) {
- builder.appendff("Additional:\n");
- for (auto& a : additional_records) {
- builder.appendff(" {} {} {}\n", a.name.to_string(), to_string(a.type), to_string(a.class_));
- a.record.visit(
- [&](auto const& record) { builder.appendff(" {}\n", MUST(record.to_string())); },
- [&](ByteBuffer const& raw) {
- builder.appendff(" {:hex-dump}\n", raw.bytes());
- });
- }
- }
-
- return builder.to_string();
-}
-
ErrorOr<Question> Question::from_raw(ParseContext& ctx)
{
// RFC 1035, 4.1.2. Question section format.
diff --git a/Libraries/LibDNS/Message.h b/Libraries/LibDNS/Message.h
index 26e830e70d6..0d98c2f4014 100644
--- a/Libraries/LibDNS/Message.h
+++ b/Libraries/LibDNS/Message.h
@@ -769,8 +769,6 @@ struct DNS_API Message {
// The answer records that respond to the question: RRs owned by the queried name, and RRs reached through a
// chain of CNAMEs starting there. Anything an alias leads to is valid for no longer than the alias.
Vector<ResourceRecord> answers_to(Question const&) const;
-
- ErrorOr<String> format_for_log() const;
};
}
diff --git a/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.cpp b/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.cpp
index 61d0a28930a..a1b85f55ee4 100644
--- a/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.cpp
+++ b/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.cpp
@@ -161,13 +161,6 @@ Optional<Node> AccessibilityWalkerActor::parent_of_accessibility_node(Node const
return Node { .node = parent_node, .identifier = move(identifier), .tab = tab.release_nonnull() };
}
-Optional<Node> AccessibilityWalkerActor::root_accessibility_node_for(WeakPtr<AccessibilityWalkerActor> const& weak_walker)
-{
- if (auto walker = weak_walker.strong_ref())
- return walker->root_accessibility_node();
- return {};
-}
-
Optional<Node> AccessibilityWalkerActor::root_accessibility_node()
{
auto tab = m_tab.strong_ref();
diff --git a/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.h b/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.h
index 3db3874fd9c..5a7d03c0ffd 100644
--- a/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.h
+++ b/Libraries/LibDevTools/Actors/AccessibilityWalkerActor.h
@@ -29,7 +29,6 @@ public:
static Optional<Node> parent_of_accessibility_node_for(WeakPtr<AccessibilityWalkerActor> const&, Node const&);
Optional<Node> parent_of_accessibility_node(Node const&);
- static Optional<Node> root_accessibility_node_for(WeakPtr<AccessibilityWalkerActor> const&);
Optional<Node> root_accessibility_node();
private:
diff --git a/Libraries/LibFileSystem/FileSystem.cpp b/Libraries/LibFileSystem/FileSystem.cpp
index 5ac9f080978..29887dac64e 100644
--- a/Libraries/LibFileSystem/FileSystem.cpp
+++ b/Libraries/LibFileSystem/FileSystem.cpp
@@ -423,32 +423,6 @@ ErrorOr<void> rename_without_replacing(StringView destination_path, StringView s
return {};
}
-bool can_delete_or_move(StringView path)
-{
- VERIFY(!path.is_empty());
- auto directory = LexicalPath::dirname(path);
- auto directory_has_write_access = !Core::System::access(directory, W_OK).is_error();
- if (!directory_has_write_access)
- return false;
-
- auto stat_or_empty = [](StringView path) {
- auto stat_or_error = Core::System::stat(path);
- if (stat_or_error.is_error()) {
- struct stat stat {};
- return stat;
- }
- return stat_or_error.release_value();
- };
-
- auto directory_stat = stat_or_empty(directory);
- bool is_directory_sticky = (directory_stat.st_mode & S_ISVTX) != 0;
- if (!is_directory_sticky)
- return true;
-
- // Directory is sticky, only the file owner, directory owner, and root can modify (rename, remove) it.
- auto user_id = geteuid();
- return user_id == 0 || directory_stat.st_uid == user_id || stat_or_empty(path).st_uid == user_id;
-}
#endif // !AK_OS_WINDOWS
#ifdef AK_OS_WINDOWS
@@ -501,12 +475,6 @@ ErrorOr<off_t> size_from_stat(StringView path)
return st.st_size;
}
-ErrorOr<off_t> size_from_fstat(int fd)
-{
- auto st = TRY(stat_fd(fd));
- return st.st_size;
-}
-
ErrorOr<DiskSpace> compute_disk_space(LexicalPath const& path)
{
#if defined(AK_OS_WINDOWS)
diff --git a/Libraries/LibFileSystem/FileSystem.h b/Libraries/LibFileSystem/FileSystem.h
index febf4c0c822..c7ed508d6ff 100644
--- a/Libraries/LibFileSystem/FileSystem.h
+++ b/Libraries/LibFileSystem/FileSystem.h
@@ -67,8 +67,6 @@ ErrorOr<void> move_file(StringView destination_path, StringView source_path, Pre
ErrorOr<void> rename_without_replacing(StringView destination_path, StringView source_path);
ErrorOr<void> remove(StringView path, RecursionMode);
ErrorOr<off_t> size_from_stat(StringView path);
-ErrorOr<off_t> size_from_fstat(int fd);
-bool can_delete_or_move(StringView path);
struct DiskSpace {
u64 free_bytes { 0 };
diff --git a/Libraries/LibGC/Timer.cpp b/Libraries/LibGC/Timer.cpp
index 6447d5b4875..4493caa1a12 100644
--- a/Libraries/LibGC/Timer.cpp
+++ b/Libraries/LibGC/Timer.cpp
@@ -48,20 +48,6 @@ void Timer::start(u64 timeout_ms, GC::Ref<GC::Function<void()>> on_timeout)
m_timer->start();
}
-void Timer::start_repeating(u64 interval_ms, GC::Ref<GC::Function<void()>> on_timeout)
-{
- m_on_timeout = on_timeout;
-
- m_timer->on_timeout = [this]() {
- if (m_on_timeout)
- m_on_timeout->function()();
- };
-
- m_timer->set_interval(AK::Duration::from_milliseconds(static_cast<int>(interval_ms)));
- m_timer->set_single_shot(false);
- m_timer->start();
-}
-
void Timer::restart()
{
m_timer->restart();
diff --git a/Libraries/LibGC/Timer.h b/Libraries/LibGC/Timer.h
index d8d89e9175a..539fad54db2 100644
--- a/Libraries/LibGC/Timer.h
+++ b/Libraries/LibGC/Timer.h
@@ -23,7 +23,6 @@ public:
virtual void finalize() override;
void start(u64 timeout_ms, GC::Ref<GC::Function<void()>> on_timeout);
- void start_repeating(u64 interval_ms, GC::Ref<GC::Function<void()>> on_timeout);
void restart();
void stop_and_fire_timeout_handler();
void stop();
diff --git a/Libraries/LibGfx/AffineTransform.cpp b/Libraries/LibGfx/AffineTransform.cpp
index fb14ad6df07..427786e29fa 100644
--- a/Libraries/LibGfx/AffineTransform.cpp
+++ b/Libraries/LibGfx/AffineTransform.cpp
@@ -230,16 +230,6 @@ IntRect AffineTransform::map(IntRect const& rect) const
return enclosing_int_rect(map(FloatRect(rect)));
}
-Quad<float> AffineTransform::map_to_quad(Rect<float> const& rect) const
-{
- return {
- map(rect.top_left()),
- map(rect.top_right()),
- map(rect.bottom_right()),
- map(rect.bottom_left()),
- };
-}
-
float AffineTransform::rotation() const
{
auto rotation = AK::atan2(b(), a());
diff --git a/Libraries/LibGfx/AffineTransform.h b/Libraries/LibGfx/AffineTransform.h
index 84c7925a7fb..5db9d6e67db 100644
--- a/Libraries/LibGfx/AffineTransform.h
+++ b/Libraries/LibGfx/AffineTransform.h
@@ -53,8 +53,6 @@ public:
template<Arithmetic T>
Rect<T> map(Rect<T> const&) const;
- Quad<float> map_to_quad(Rect<float> const&) const;
-
[[nodiscard]] ALWAYS_INLINE float a() const { return m_values[0]; }
[[nodiscard]] ALWAYS_INLINE float b() const { return m_values[1]; }
[[nodiscard]] ALWAYS_INLINE float c() const { return m_values[2]; }
diff --git a/Libraries/LibGfx/ColorConversion.cpp b/Libraries/LibGfx/ColorConversion.cpp
index b8770776a15..68551c073f0 100644
--- a/Libraries/LibGfx/ColorConversion.cpp
+++ b/Libraries/LibGfx/ColorConversion.cpp
@@ -463,23 +463,6 @@ ColorComponents srgb_to_hwb(ColorComponents const& components)
return { hue, minimum, 1.0f - maximum, components.alpha() };
}
-// https://drafts.csswg.org/css-color-4/#predefined-display-p3
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents linear_display_p3_to_display_p3(ColorComponents const& components)
-{
- auto to_gamma = [](float c) {
- float sign = c < 0 ? -1.0f : 1.0f;
- float absolute = abs(c);
-
- if (absolute > 0.0031308f)
- return sign * static_cast<float>(1.055 * pow(absolute, 1.0 / 2.4) - 0.055);
-
- return 12.92f * c;
- };
-
- return { to_gamma(components[0]), to_gamma(components[1]), to_gamma(components[2]), components.alpha() };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-display-p3-linear
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents xyz65_to_linear_display_p3(ColorComponents const& components)
@@ -495,18 +478,6 @@ ColorComponents xyz65_to_linear_display_p3(ColorComponents const& components)
};
}
-// https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents a98_rgb_to_linear_a98_rgb(ColorComponents const& components)
-{
- auto to_linear = [](float c) {
- double sign = c < 0.0f ? -1.0 : 1.0;
- return static_cast<float>(sign * pow(abs(c), 563.0 / 256.0));
- };
-
- return { to_linear(components[0]), to_linear(components[1]), to_linear(components[2]), components.alpha() };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents linear_a98_rgb_to_a98_rgb(ColorComponents const& components)
@@ -519,21 +490,6 @@ ColorComponents linear_a98_rgb_to_a98_rgb(ColorComponents const& components)
return { to_gamma(components[0]), to_gamma(components[1]), to_gamma(components[2]), components.alpha() };
}
-// https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents linear_a98_rgb_to_xyz65(ColorComponents const& components)
-{
- double red = components[0];
- double green = components[1];
- double blue = components[2];
- return {
- static_cast<float>((573536.0 / 994567.0) * red + (263643.0 / 1420810.0) * green + (187206.0 / 994567.0) * blue),
- static_cast<float>((591459.0 / 1989134.0) * red + (6239551.0 / 9945670.0) * green + (374412.0 / 4972835.0) * blue),
- static_cast<float>((53769.0 / 1989134.0) * red + (351524.0 / 4972835.0) * green + (4929758.0 / 4972835.0) * blue),
- components.alpha(),
- };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-a98-rgb
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents xyz65_to_linear_a98_rgb(ColorComponents const& components)
@@ -549,21 +505,6 @@ ColorComponents xyz65_to_linear_a98_rgb(ColorComponents const& components)
};
}
-// https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents prophoto_rgb_to_linear_prophoto_rgb(ColorComponents const& components)
-{
- auto to_linear = [](float c) -> float {
- float sign = c < 0.0f ? -1.0f : 1.0f;
- float absolute = abs(c);
- if (absolute <= 16.0f / 512.0f)
- return c / 16.0f;
- return sign * static_cast<float>(pow(absolute, 1.8));
- };
-
- return { to_linear(components[0]), to_linear(components[1]), to_linear(components[2]), components.alpha() };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents linear_prophoto_rgb_to_prophoto_rgb(ColorComponents const& components)
@@ -579,21 +520,6 @@ ColorComponents linear_prophoto_rgb_to_prophoto_rgb(ColorComponents const& compo
return { to_gamma(components[0]), to_gamma(components[1]), to_gamma(components[2]), components.alpha() };
}
-// https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents linear_prophoto_rgb_to_xyz50(ColorComponents const& components)
-{
- float red = components[0];
- float green = components[1];
- float blue = components[2];
- return {
- 0.79776664f * red + 0.13518130f * green + 0.03134773f * blue,
- 0.28807483f * red + 0.71183523f * green + 0.00008994f * blue,
- 0.00000000f * red + 0.00000000f * green + 0.82510460f * blue,
- components.alpha(),
- };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents xyz50_to_linear_prophoto_rgb(ColorComponents const& components)
@@ -609,27 +535,6 @@ ColorComponents xyz50_to_linear_prophoto_rgb(ColorComponents const& components)
};
}
-// https://drafts.csswg.org/css-color-4/#predefined-rec2020
-ColorComponents rec2020_to_linear_rec2020(ColorComponents const& components)
-{
- auto to_linear = [](float c) -> float {
- // AD-HOC: CSS Color 4 specifies a pure 2.4 gamma transfer function for rec2020, but all major engines
- // and the WPT rec2020 reftests use the piecewise OETF from ITU-R BT.2020-2, so we do the same.
- constexpr auto alpha = 1.09929682680944;
- constexpr auto beta = 0.018053968510807;
-
- float sign = c < 0.0f ? -1.0f : 1.0f;
- float absolute = abs(c);
-
- if (absolute < beta * 4.5)
- return c / 4.5f;
-
- return sign * static_cast<float>(pow((absolute + alpha - 1) / alpha, 1 / 0.45));
- };
-
- return { to_linear(components[0]), to_linear(components[1]), to_linear(components[2]), components.alpha() };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-rec2020
ColorComponents linear_rec2020_to_rec2020(ColorComponents const& components)
{
@@ -651,21 +556,6 @@ ColorComponents linear_rec2020_to_rec2020(ColorComponents const& components)
return { to_gamma(components[0]), to_gamma(components[1]), to_gamma(components[2]), components.alpha() };
}
-// https://drafts.csswg.org/css-color-4/#predefined-rec2020
-// https://drafts.csswg.org/css-color-4/#color-conversion-code
-ColorComponents linear_rec2020_to_xyz65(ColorComponents const& components)
-{
- float red = components[0];
- float green = components[1];
- float blue = components[2];
- return {
- 0.63695805f * red + 0.14461690f * green + 0.16888098f * blue,
- 0.26270021f * red + 0.67799807f * green + 0.05930172f * blue,
- 0.00000000f * red + 0.02807269f * green + 1.06098506f * blue,
- components.alpha(),
- };
-}
-
// https://drafts.csswg.org/css-color-4/#predefined-rec2020
// https://drafts.csswg.org/css-color-4/#color-conversion-code
ColorComponents xyz65_to_linear_rec2020(ColorComponents const& components)
diff --git a/Libraries/LibGfx/ColorConversion.h b/Libraries/LibGfx/ColorConversion.h
index 68f5dc9ca5b..e4a1daeae27 100644
--- a/Libraries/LibGfx/ColorConversion.h
+++ b/Libraries/LibGfx/ColorConversion.h
@@ -252,22 +252,15 @@ ColorComponents srgb_to_hsl(ColorComponents const&);
ColorComponents srgb_to_hwb(ColorComponents const&);
ColorComponents hwb_to_srgb(ColorComponents const&);
-ColorComponents linear_display_p3_to_display_p3(ColorComponents const&);
ColorComponents xyz65_to_linear_display_p3(ColorComponents const&);
-ColorComponents a98_rgb_to_linear_a98_rgb(ColorComponents const&);
ColorComponents linear_a98_rgb_to_a98_rgb(ColorComponents const&);
-ColorComponents linear_a98_rgb_to_xyz65(ColorComponents const&);
ColorComponents xyz65_to_linear_a98_rgb(ColorComponents const&);
-ColorComponents prophoto_rgb_to_linear_prophoto_rgb(ColorComponents const&);
ColorComponents linear_prophoto_rgb_to_prophoto_rgb(ColorComponents const&);
-ColorComponents linear_prophoto_rgb_to_xyz50(ColorComponents const&);
ColorComponents xyz50_to_linear_prophoto_rgb(ColorComponents const&);
-ColorComponents rec2020_to_linear_rec2020(ColorComponents const&);
ColorComponents linear_rec2020_to_rec2020(ColorComponents const&);
-ColorComponents linear_rec2020_to_xyz65(ColorComponents const&);
ColorComponents xyz65_to_linear_rec2020(ColorComponents const&);
}
diff --git a/Libraries/LibGfx/Font/Font.cpp b/Libraries/LibGfx/Font/Font.cpp
index bbb2a203401..08f4a4016b7 100644
--- a/Libraries/LibGfx/Font/Font.cpp
+++ b/Libraries/LibGfx/Font/Font.cpp
@@ -74,15 +74,6 @@ NonnullRefPtr<Font> Font::invisible_variant() const
return font;
}
-NonnullRefPtr<Font> Font::with_size(float point_size) const
-{
- if (point_size == m_point_height && point_size == m_point_width)
- return *const_cast<Font*>(this);
-
- // FIXME: Should we be discarding m_font_variation_settings and m_shape_features here?
- return m_typeface->font(point_size);
-}
-
float Font::pixel_size() const
{
return m_pixel_size;
diff --git a/Libraries/LibGfx/Font/Font.h b/Libraries/LibGfx/Font/Font.h
index 153a0978ee6..3897f3292f1 100644
--- a/Libraries/LibGfx/Font/Font.h
+++ b/Libraries/LibGfx/Font/Font.h
@@ -83,7 +83,6 @@ public:
float width(Utf16View const&) const;
FlyString const& family() const { return m_typeface->family(); }
- NonnullRefPtr<Font> with_size(float point_size) const;
NonnullRefPtr<Font> invisible_variant() const;
bool is_invisible() const { return m_is_invisible; }
diff --git a/Libraries/LibGfx/PaintingSurface.cpp b/Libraries/LibGfx/PaintingSurface.cpp
index c4c70ebfddb..c697df2b44d 100644
--- a/Libraries/LibGfx/PaintingSurface.cpp
+++ b/Libraries/LibGfx/PaintingSurface.cpp
@@ -188,20 +188,6 @@ PaintingSurface::~PaintingSurface()
m_impl->surface = nullptr;
}
-NonnullRefPtr<Bitmap> PaintingSurface::snapshot_bitmap() const
-{
- auto bitmap = MUST(Bitmap::create(BitmapFormat::BGRA8888, AlphaType::Premultiplied, size()));
- read_into_bitmap(*bitmap);
- return bitmap;
-}
-
-SharedImage PaintingSurface::snapshot_into_shared_image() const
-{
- auto shared_image_buffer = SharedImageBuffer::create(size());
- read_into_bitmap(*shared_image_buffer.bitmap());
- return shared_image_buffer.export_shared_image();
-}
-
void PaintingSurface::read_into_bitmap(Bitmap& bitmap, IntPoint source_position) const
{
auto color_type = to_skia_color_type(bitmap.format());
diff --git a/Libraries/LibGfx/PaintingSurface.h b/Libraries/LibGfx/PaintingSurface.h
index 96fa13b992c..375cbf88b95 100644
--- a/Libraries/LibGfx/PaintingSurface.h
+++ b/Libraries/LibGfx/PaintingSurface.h
@@ -67,9 +67,6 @@ public:
static ErrorOr<NonnullRefPtr<PaintingSurface>> create_from_d3d_texture(NonnullRefPtr<SkiaBackendContext>, NonnullRefPtr<D3DSharedTexture>, Origin = Origin::TopLeft);
#endif
- NonnullRefPtr<Bitmap> snapshot_bitmap() const;
- SharedImage snapshot_into_shared_image() const;
-
void read_into_bitmap(Bitmap&, IntPoint source_position = {}) const;
void write_from_bitmap(Bitmap const&, IntPoint destination_position = {});
void copy_from_surface(PaintingSurface&);
diff --git a/Libraries/LibGfx/Point.cpp b/Libraries/LibGfx/Point.cpp
index 39ad166c140..26fe8b4b707 100644
--- a/Libraries/LibGfx/Point.cpp
+++ b/Libraries/LibGfx/Point.cpp
@@ -17,22 +17,6 @@ void Point<T>::constrain(Rect<T> const& rect)
m_y = AK::clamp<T>(y(), rect.top(), rect.bottom() - 1);
}
-template<typename T>
-[[nodiscard]] Point<T> Point<T>::end_point_for_aspect_ratio(Point<T> const& previous_end_point, float aspect_ratio) const
-{
- VERIFY(aspect_ratio > 0);
- T const x_sign = previous_end_point.x() >= x() ? 1 : -1;
- T const y_sign = previous_end_point.y() >= y() ? 1 : -1;
- T dx = AK::abs(previous_end_point.x() - x());
- T dy = AK::abs(previous_end_point.y() - y());
- if (dx > dy) {
- dy = (T)((float)dx / aspect_ratio);
- } else {
- dx = (T)((float)dy * aspect_ratio);
- }
- return { x() + x_sign * dx, y() + y_sign * dy };
-}
-
template<>
ByteString IntPoint::to_byte_string() const
{
diff --git a/Libraries/LibGfx/Point.h b/Libraries/LibGfx/Point.h
index 2d741d8ecd1..fdf8aecc5d0 100644
--- a/Libraries/LibGfx/Point.h
+++ b/Libraries/LibGfx/Point.h
@@ -221,8 +221,6 @@ public:
return { AK::abs(dx_relative_to(other)), AK::abs(dy_relative_to(other)) };
}
- [[nodiscard]] Point end_point_for_aspect_ratio(Point const& previous_end_point, float aspect_ratio) const;
-
template<typename U>
requires(!IsSame<T, U>)
[[nodiscard]] Point<U> to_type() const
diff --git a/Libraries/LibHTTP/HttpRequest.cpp b/Libraries/LibHTTP/HttpRequest.cpp
index 0ef02ea7f85..086b7c33993 100644
--- a/Libraries/LibHTTP/HttpRequest.cpp
+++ b/Libraries/LibHTTP/HttpRequest.cpp
@@ -46,46 +46,6 @@ StringView HttpRequest::method_name() const
return to_string_view(m_method);
}
-ErrorOr<ByteBuffer> HttpRequest::to_raw_request() const
-{
- StringBuilder builder;
- TRY(builder.try_append(method_name()));
- TRY(builder.try_append(' '));
- auto path = m_url.serialize_path();
- VERIFY(!path.is_empty());
- TRY(builder.try_append(path));
- if (m_url.query().has_value()) {
- TRY(builder.try_append('?'));
- TRY(builder.try_append(*m_url.query()));
- }
- TRY(builder.try_append(" HTTP/1.1\r\nHost: "sv));
- TRY(builder.try_append(m_url.serialized_host()));
- if (m_url.port().has_value())
- TRY(builder.try_appendff(":{}", *m_url.port()));
- TRY(builder.try_append("\r\n"sv));
- // Start headers.
- bool has_content_length = m_headers->contains("Content-Length"sv);
- for (auto const& [name, value] : *m_headers) {
- TRY(builder.try_append(name));
- TRY(builder.try_append(": "sv));
- TRY(builder.try_append(value));
- TRY(builder.try_append("\r\n"sv));
- }
- if (!m_body.is_empty() || method() == Method::POST) {
- // Add Content-Length header if it's not already present.
- if (!has_content_length) {
- TRY(builder.try_appendff("Content-Length: {}\r\n", m_body.size()));
- }
- // Finish headers.
- TRY(builder.try_append("\r\n"sv));
- TRY(builder.try_append((char const*)m_body.data(), m_body.size()));
- } else {
- // Finish headers.
- TRY(builder.try_append("\r\n"sv));
- }
- return builder.to_byte_buffer();
-}
-
ErrorOr<HttpRequest, HttpRequest::ParseError> HttpRequest::from_raw_request(ReadonlyBytes raw_request)
{
enum class State {
diff --git a/Libraries/LibHTTP/HttpRequest.h b/Libraries/LibHTTP/HttpRequest.h
index c455d303796..12d623f9aa9 100644
--- a/Libraries/LibHTTP/HttpRequest.h
+++ b/Libraries/LibHTTP/HttpRequest.h
@@ -73,7 +73,6 @@ public:
void set_body(ByteBuffer&& body) { m_body = move(body); }
StringView method_name() const;
- ErrorOr<ByteBuffer> to_raw_request() const;
static ErrorOr<HttpRequest, HttpRequest::ParseError> from_raw_request(ReadonlyBytes);
diff --git a/Libraries/LibIPC/File.cpp b/Libraries/LibIPC/File.cpp
index 30ee5ae9d55..04581416ec4 100644
--- a/Libraries/LibIPC/File.cpp
+++ b/Libraries/LibIPC/File.cpp
@@ -54,13 +54,6 @@ File::~File()
(void)Core::System::close(m_fd);
}
-// FIXME: IPC::Files transferred over the wire always set O_CLOEXEC during decoding. Perhaps we should add an option to
-// allow the receiver to decide whether to make it O_CLOEXEC or not. Or an attribute in the .ipc file?
-ErrorOr<void> File::clear_close_on_exec()
-{
- return Core::System::set_close_on_exec(m_fd, false);
-}
-
template<>
ErrorOr<File> decode(Decoder& decoder)
{
diff --git a/Libraries/LibIPC/File.h b/Libraries/LibIPC/File.h
index d0b311a1b65..2fd7fb2830f 100644
--- a/Libraries/LibIPC/File.h
+++ b/Libraries/LibIPC/File.h
@@ -33,8 +33,6 @@ public:
// This is 'const' since generated IPC messages expose all parameters by const reference.
[[nodiscard]] int take_fd() const { return exchange(m_fd, -1); }
- ErrorOr<void> clear_close_on_exec();
-
private:
explicit File(int fd);
diff --git a/Libraries/LibIPC/Message.cpp b/Libraries/LibIPC/Message.cpp
index fb4d2623e2d..510f38f5ba3 100644
--- a/Libraries/LibIPC/Message.cpp
+++ b/Libraries/LibIPC/Message.cpp
@@ -25,12 +25,6 @@ ErrorOr<void> MessageBuffer::append_data(u8 const* values, size_t count)
return {};
}
-ErrorOr<void> MessageBuffer::append_file_descriptor(int fd)
-{
- TRY(m_attachments.try_append(Attachment::from_fd(fd)));
- return {};
-}
-
ErrorOr<void> MessageBuffer::append_attachment(Attachment attachment)
{
TRY(m_attachments.try_append(move(attachment)));
diff --git a/Libraries/LibIPC/Message.h b/Libraries/LibIPC/Message.h
index 3fcca153827..1237e0b0fa0 100644
--- a/Libraries/LibIPC/Message.h
+++ b/Libraries/LibIPC/Message.h
@@ -31,7 +31,6 @@ public:
ErrorOr<void> extend_data_capacity(size_t capacity);
ErrorOr<void> append_data(u8 const* values, size_t count);
- ErrorOr<void> append_file_descriptor(int fd);
ErrorOr<void> append_attachment(Attachment);
ErrorOr<void> extend(MessageBuffer&& buffer);
diff --git a/Libraries/LibMain/Main.cpp b/Libraries/LibMain/Main.cpp
index d09af37330b..797bd0a899a 100644
--- a/Libraries/LibMain/Main.cpp
+++ b/Libraries/LibMain/Main.cpp
@@ -24,11 +24,6 @@ int return_code_for_errors()
return s_return_code_for_errors;
}
-void set_return_code_for_errors(int code)
-{
- s_return_code_for_errors = code;
-}
-
}
int main(int argc, char** argv)
diff --git a/Libraries/LibMain/Main.h b/Libraries/LibMain/Main.h
index 9c024ed1500..044597eba6b 100644
--- a/Libraries/LibMain/Main.h
+++ b/Libraries/LibMain/Main.h
@@ -20,7 +20,6 @@ struct Arguments {
};
int return_code_for_errors();
-void set_return_code_for_errors(int);
}
diff --git a/Libraries/LibMedia/Codecs/Vorbis.cpp b/Libraries/LibMedia/Codecs/Vorbis.cpp
index cfc8d0835f4..2f2c1e1b3c2 100644
--- a/Libraries/LibMedia/Codecs/Vorbis.cpp
+++ b/Libraries/LibMedia/Codecs/Vorbis.cpp
@@ -66,12 +66,4 @@ Optional<u32> Vorbis::Parser::parse_packet_duration_in_samples(ReadonlyBytes pac
return duration;
}
-Optional<AK::Duration> Vorbis::Parser::parse_packet_duration(ReadonlyBytes packet, u32 sample_rate) const
-{
- auto duration = parse_packet_duration_in_samples(packet);
- if (!duration.has_value())
- return {};
- return AK::Duration::from_time_units(duration.value(), 1, sample_rate);
-}
-
}
diff --git a/Libraries/LibMedia/Codecs/Vorbis.h b/Libraries/LibMedia/Codecs/Vorbis.h
index f5e81a662d6..51149d47aae 100644
--- a/Libraries/LibMedia/Codecs/Vorbis.h
+++ b/Libraries/LibMedia/Codecs/Vorbis.h
@@ -29,7 +29,6 @@ public:
void reset() const;
Optional<u32> parse_packet_duration_in_samples(ReadonlyBytes packet) const;
- Optional<AK::Duration> parse_packet_duration(ReadonlyBytes packet, u32 sample_rate) const;
private:
explicit Parser(AVVorbisParseContext*);
diff --git a/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.cpp b/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.cpp
index 55ad2fd1c90..81735e280a1 100644
--- a/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.cpp
+++ b/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.cpp
@@ -63,13 +63,6 @@ void SourceBufferProcessor::run_pending_commands()
m_running_commands = false;
}
-void SourceBufferProcessor::abandon_buffer_append()
-{
- m_pending_commands.remove_all_matching([](Command const& command) {
- return command.has<Commands::BufferAppend>();
- });
-}
-
void SourceBufferProcessor::execute(Command& command)
{
command.visit(
diff --git a/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.h b/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.h
index a2b68149730..a2dff9d77f7 100644
--- a/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.h
+++ b/Libraries/LibMedia/MediaSourceExtensions/SourceBufferProcessor.h
@@ -162,11 +162,6 @@ public:
void enqueue(Command);
void run_pending_commands();
- // NB: Abandons a queued or in-progress buffer append. The spec leaves the interruption point
- // undefined, so a partly consumed input buffer keeps whatever it already produced; see
- // https://github.com/w3c/media-source/issues/71.
- void abandon_buffer_append();
-
using DurationChangeCallback = Function<void(double new_duration)>;
using InitializationSegmentCallback = Function<void(InitializationSegmentData&&)>;
using AppendErrorCallback = Function<void()>;
diff --git a/Libraries/LibThreading/Thread.cpp b/Libraries/LibThreading/Thread.cpp
index 2da106761bf..b2a9d922f0b 100644
--- a/Libraries/LibThreading/Thread.cpp
+++ b/Libraries/LibThreading/Thread.cpp
@@ -33,16 +33,6 @@ ErrorOr<void> Thread::set_priority(int priority)
return {};
}
-ErrorOr<int> Thread::get_priority() const
-{
- sched_param scheduling_parameters {};
- int policy;
- int result = pthread_getschedparam(m_tid, &policy, &scheduling_parameters);
- if (result != 0)
- return Error::from_errno(result);
- return scheduling_parameters.sched_priority;
-}
-
ByteString Thread::thread_name() const { return m_thread_name; }
pthread_t Thread::tid() const { return m_tid; }
diff --git a/Libraries/LibThreading/Thread.h b/Libraries/LibThreading/Thread.h
index 049d1b63998..49526f54f9e 100644
--- a/Libraries/LibThreading/Thread.h
+++ b/Libraries/LibThreading/Thread.h
@@ -58,7 +58,6 @@ public:
~Thread();
ErrorOr<void> set_priority(int priority);
- ErrorOr<int> get_priority() const;
void set_stack_size(size_t size) { m_stack_size = size; }
// Only takes effect for threads that have not been started yet.
diff --git a/Libraries/LibUnicode/CharacterTypes.cpp b/Libraries/LibUnicode/CharacterTypes.cpp
index 2cd61693a9b..a4bbfba309a 100644
--- a/Libraries/LibUnicode/CharacterTypes.cpp
+++ b/Libraries/LibUnicode/CharacterTypes.cpp
@@ -258,11 +258,6 @@ bool code_point_has_emoji_property(u32 code_point)
return code_point_has_property(code_point, UCHAR_EMOJI);
}
-bool code_point_has_emoji_modifier_base_property(u32 code_point)
-{
- return code_point_has_property(code_point, UCHAR_EMOJI_MODIFIER_BASE);
-}
-
bool code_point_has_emoji_presentation_property(u32 code_point)
{
return code_point_has_property(code_point, UCHAR_EMOJI_PRESENTATION);
@@ -283,16 +278,6 @@ bool code_point_has_identifier_continue_property(u32 code_point)
return u_isIDPart(static_cast<UChar32>(code_point));
}
-bool code_point_has_regional_indicator_property(u32 code_point)
-{
- return code_point_has_property(code_point, UCHAR_REGIONAL_INDICATOR);
-}
-
-bool code_point_has_variation_selector_property(u32 code_point)
-{
- return code_point_has_property(code_point, UCHAR_VARIATION_SELECTOR);
-}
-
bool code_point_has_white_space_property(u32 code_point)
{
return code_point_has_property(code_point, UCHAR_WHITE_SPACE);
diff --git a/Libraries/LibUnicode/CharacterTypes.h b/Libraries/LibUnicode/CharacterTypes.h
index d148ea699bd..b61885e0c61 100644
--- a/Libraries/LibUnicode/CharacterTypes.h
+++ b/Libraries/LibUnicode/CharacterTypes.h
@@ -33,13 +33,10 @@ Optional<Property> property_from_string(StringView);
bool code_point_has_property(u32 code_point, Property property, CaseSensitivity case_sensitivity = CaseSensitivity::CaseSensitive);
bool code_point_has_emoji_property(u32 code_point);
-bool code_point_has_emoji_modifier_base_property(u32 code_point);
bool code_point_has_emoji_presentation_property(u32 code_point);
bool code_point_has_default_ignorable_code_point_property(u32 code_point);
bool code_point_has_identifier_start_property(u32 code_point);
bool code_point_has_identifier_continue_property(u32 code_point);
-bool code_point_has_regional_indicator_property(u32 code_point);
-bool code_point_has_variation_selector_property(u32 code_point);
bool code_point_has_white_space_property(u32 code_point);
bool is_ecma262_property(Property);
diff --git a/Libraries/LibWeb/ARIA/Roles.cpp b/Libraries/LibWeb/ARIA/Roles.cpp
index 5edb6ca6a45..d37cdd5b913 100644
--- a/Libraries/LibWeb/ARIA/Roles.cpp
+++ b/Libraries/LibWeb/ARIA/Roles.cpp
@@ -52,112 +52,6 @@ bool is_abstract_role(Role role)
Role::window);
}
-// https://www.w3.org/TR/wai-aria-1.2/#widget_roles
-bool is_widget_role(Role role)
-{
- return first_is_one_of(role,
- Role::button,
- Role::checkbox,
- Role::gridcell,
- Role::link,
- Role::menuitem,
- Role::menuitemcheckbox,
- Role::menuitemradio,
- Role::option,
- Role::progressbar,
- Role::radio,
- Role::scrollbar,
- Role::searchbox,
- Role::separator, // TODO: Only when focusable
- Role::slider,
- Role::spinbutton,
- Role::switch_,
- Role::tab,
- Role::tabpanel,
- Role::textbox,
- Role::treeitem,
- Role::combobox,
- Role::grid,
- Role::listbox,
- Role::menu,
- Role::menubar,
- Role::radiogroup,
- Role::tablist,
- Role::tree,
- Role::treegrid);
-}
-
-// https://www.w3.org/TR/wai-aria-1.2/#document_structure_roles
-bool is_document_structure_role(Role role)
-{
- return first_is_one_of(role,
- Role::application,
- Role::article,
- Role::blockquote,
- Role::caption,
- Role::cell,
- Role::code,
- Role::columnheader,
- Role::definition,
- Role::deletion,
- Role::directory,
- Role::document,
- Role::emphasis,
- Role::feed,
- Role::figure,
- Role::generic,
- Role::group,
- Role::heading,
- Role::img,
- Role::insertion,
- Role::list,
- Role::listitem,
- Role::math,
- Role::meter,
- Role::none,
- Role::note,
- Role::paragraph,
- Role::presentation,
- Role::row,
- Role::rowgroup,
- Role::rowheader,
- Role::separator, // TODO: Only when not focusable
- Role::strong,
- Role::subscript,
- Role::suggestion,
- Role::superscript,
- Role::table,
- Role::term,
- Role::time,
- Role::toolbar,
- Role::tooltip);
-}
-
-// https://www.w3.org/TR/wai-aria-1.2/#landmark_roles
-bool is_landmark_role(Role role)
-{
- return first_is_one_of(role,
- Role::banner,
- Role::complementary,
- Role::contentinfo,
- Role::form,
- Role::main,
- Role::navigation,
- Role::region,
- Role::search);
-}
-
-// https://www.w3.org/TR/wai-aria-1.2/#live_region_roles
-bool is_live_region_role(Role role)
-{
- return first_is_one_of(role,
- Role::alert,
- Role::log,
- Role::marquee,
- Role::status,
- Role::timer);
-}
-
Optional<AriaLive> implicit_aria_live_for_role(Role role)
{
// ARIA 1.2 gives alert, log, and status a default aria-live in their Implicit Value for Role entries,
@@ -178,14 +72,6 @@ Optional<AriaLive> implicit_aria_live_for_role(Role role)
}
}
-// https://www.w3.org/TR/wai-aria-1.2/#window_roles
-bool is_windows_role(Role role)
-{
- return first_is_one_of(role,
- Role::alertdialog,
- Role::dialog);
-}
-
// https://www.w3.org/TR/wai-aria-1.2/#namefromcontent
bool allows_name_from_content(Role role)
{
diff --git a/Libraries/LibWeb/ARIA/Roles.h b/Libraries/LibWeb/ARIA/Roles.h
index 05686048a21..2da756e2b4d 100644
--- a/Libraries/LibWeb/ARIA/Roles.h
+++ b/Libraries/LibWeb/ARIA/Roles.h
@@ -130,14 +130,9 @@ WEB_API Utf16String const& role_name(Role);
Optional<Role> role_from_string(Utf16View role_name);
bool is_abstract_role(Role);
-bool is_widget_role(Role);
-bool is_document_structure_role(Role);
-bool is_landmark_role(Role);
-bool is_live_region_role(Role);
// The aria-live value a live-region role carries when the element sets none: assertive for alert, polite for log and
// status, off for marquee and timer.
Optional<AriaLive> implicit_aria_live_for_role(Role);
-bool is_windows_role(Role);
bool allows_name_from_content(Role);
diff --git a/Libraries/LibWeb/Animations/Animatable.cpp b/Libraries/LibWeb/Animations/Animatable.cpp
index f31f56e519a..3c409599962 100644
--- a/Libraries/LibWeb/Animations/Animatable.cpp
+++ b/Libraries/LibWeb/Animations/Animatable.cpp
@@ -220,19 +220,6 @@ bool Animatable::has_relevant_animations() const
return false;
}
-bool Animatable::has_relevant_animations_other_than_transitions() const
-{
- if (!m_impl)
- return false;
-
- for (auto const& animation : m_impl->associated_animations) {
- if (!animation->is_css_transition() && animation->is_relevant())
- return true;
- }
-
- return false;
-}
-
void Animatable::associate_with_animation(GC::Ref<Animation> animation)
{
auto& impl = ensure_impl();
diff --git a/Libraries/LibWeb/Animations/Animatable.h b/Libraries/LibWeb/Animations/Animatable.h
index effa10ec6e7..d8d6f17c5b3 100644
--- a/Libraries/LibWeb/Animations/Animatable.h
+++ b/Libraries/LibWeb/Animations/Animatable.h
@@ -53,7 +53,6 @@ public:
void invalidate_associated_animation_composite_order();
bool has_relevant_animations() const;
bool has_associated_animations() const;
- bool has_relevant_animations_other_than_transitions() const;
void associate_with_animation(GC::Ref<Animation>);
void disassociate_with_animation(GC::Ref<Animation>);
diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Libraries/LibWeb/Animations/KeyframeEffect.cpp
index 773179d632f..91748f5cf24 100644
--- a/Libraries/LibWeb/Animations/KeyframeEffect.cpp
+++ b/Libraries/LibWeb/Animations/KeyframeEffect.cpp
@@ -1337,19 +1337,4 @@ CompositeOperationOrAuto css_animation_composition_to_composite_operation_or_aut
return css_animation_composition_to_bindings_composite_operation_or_auto(composition);
}
-StringView composite_operation_or_auto_to_string(CompositeOperationOrAuto operation)
-{
- switch (operation) {
- case CompositeOperationOrAuto::Replace:
- return "replace"sv;
- case CompositeOperationOrAuto::Add:
- return "add"sv;
- case CompositeOperationOrAuto::Accumulate:
- return "accumulate"sv;
- case CompositeOperationOrAuto::Auto:
- return "auto"sv;
- }
- VERIFY_NOT_REACHED();
-}
-
}
diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.h b/Libraries/LibWeb/Animations/KeyframeEffect.h
index ab3f5aa1b00..67a875bfe4b 100644
--- a/Libraries/LibWeb/Animations/KeyframeEffect.h
+++ b/Libraries/LibWeb/Animations/KeyframeEffect.h
@@ -44,7 +44,6 @@ struct BasePropertyIndexedKeyframe {
CompositeOperation css_animation_composition_to_composite_operation(CSS::AnimationComposition composition);
CompositeOperationOrAuto css_animation_composition_to_composite_operation_or_auto(CSS::AnimationComposition composition);
-StringView composite_operation_or_auto_to_string(CompositeOperationOrAuto);
// https://www.w3.org/TR/web-animations-1/#dictdef-basekeyframe
struct BaseKeyframe {
diff --git a/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.cpp b/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.cpp
index e52cbe2065a..4e10bddf789 100644
--- a/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.cpp
+++ b/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.cpp
@@ -286,11 +286,6 @@ void ComputedStyleWorkingSet::set_font_metrics_depend_on_viewport_metrics()
metadata().dependency_flags |= to_underlying(StyleRecordDependencyFlag::FontMetricsDependOnViewportMetrics);
}
-static bool property_affects_computed_font_list(PropertyID id)
-{
- return first_is_one_of(id, PropertyID::FontFamily, PropertyID::FontSize, PropertyID::FontStyle, PropertyID::FontWeight, PropertyID::FontWidth, PropertyID::FontVariationSettings);
-}
-
Display ComputedStyleWorkingSet::display_before_box_type_transformation() const
{
return bit_cast<Display>(metadata().display_before_box_type_transformation);
@@ -301,21 +296,6 @@ void ComputedStyleWorkingSet::set_display_before_box_type_transformation(Display
metadata().display_before_box_type_transformation = bit_cast<u32>(value);
}
-void ComputedStyleWorkingSet::set_animated_property_internal(PropertyID id, NonnullRefPtr<StyleValue const> value, AnimatedPropertyResultOfTransition animated_property_result_of_transition, Inherited inherited)
-{
- VERIFY(id >= first_longhand_property_id && id <= last_longhand_property_id);
-
- mutable_animated_properties().set_property(id, move(value), animated_property_result_of_transition, inherited);
-
- if (property_affects_computed_font_list(id))
- clear_computed_font_list_cache();
-}
-
-void ComputedStyleWorkingSet::set_animated_property(Badge<StyleComputer>, PropertyID id, NonnullRefPtr<StyleValue const> value, AnimatedPropertyResultOfTransition animated_property_result_of_transition, Inherited inherited)
-{
- set_animated_property_internal(id, move(value), animated_property_result_of_transition, inherited);
-}
-
ComputedValuesFFI::AnimatedOverlay* ComputedStyleWorkingSet::prepare_animated_overlay_for_rust_mutation(Badge<StyleComputer>)
{
auto& animated_properties = mutable_animated_properties();
diff --git a/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.h b/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.h
index 7a854bcf1ed..db5aa162699 100644
--- a/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.h
+++ b/Libraries/LibWeb/CSS/ComputedStyleWorkingSet.h
@@ -86,7 +86,6 @@ public:
bool highlight_colors_authored() const { return metadata().dependency_flags & to_underlying(StyleRecordDependencyFlag::HighlightColorsAuthored); }
bool highlight_color_is_current_color() const { return metadata().dependency_flags & to_underlying(StyleRecordDependencyFlag::HighlightColorIsCurrentColor); }
bool has_pseudo_element_style(PseudoElement) const;
- void set_animated_property(Badge<StyleComputer>, PropertyID, NonnullRefPtr<StyleValue const> value, AnimatedPropertyResultOfTransition, Inherited = Inherited::No);
ComputedValuesFFI::AnimatedOverlay* prepare_animated_overlay_for_rust_mutation(Badge<StyleComputer>);
ComputedValuesFFI::AnimatedOverlay* prepare_animated_overlay_for_rust_finalization(Badge<StyleComputer>);
ComputedValuesFFI::AnimatedOverlay const* animated_overlay(Badge<StyleComputer>) const;
@@ -145,7 +144,6 @@ private:
}
ComputedValuesFFI::FfiComputedStyleMetadata const& metadata() const { return *ComputedValuesFFI::rust_computed_longhand_table_metadata(m_computed_longhand_table); }
void ensure_mutable_computed_longhand_table();
- void set_animated_property_internal(PropertyID, NonnullRefPtr<StyleValue const>, AnimatedPropertyResultOfTransition, Inherited);
void clear_computed_font_list_cache()
{
m_cached_computed_font_list = nullptr;
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp
index 402b9db75d5..b22b632d320 100644
--- a/Libraries/LibWeb/DOM/Document.cpp
+++ b/Libraries/LibWeb/DOM/Document.cpp
@@ -4317,16 +4317,6 @@ static void invalidate_text_fragment_range_paint(Vector<GC::Ref<Range>> const& r
}
}
-// https://wicg.github.io/scroll-to-text-fragment/#applying-directives-to-a-document
-void Document::set_pending_text_directives(Optional<Vector<HTML::TextDirective>> directives)
-{
- invalidate_text_fragment_range_paint(m_text_fragment_ranges);
- m_text_fragment_ranges.clear();
- m_pending_text_directives = move(directives);
- if (m_pending_text_directives.has_value())
- update_text_fragment_indication_visibility(!m_pending_text_directives->is_empty());
-}
-
// https://wicg.github.io/scroll-to-text-fragment/#invoking-text-directives
void Document::clear_pending_text_directives()
{
diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h
index 1bb8d835301..59a8d449145 100644
--- a/Libraries/LibWeb/DOM/Document.h
+++ b/Libraries/LibWeb/DOM/Document.h
@@ -843,7 +843,6 @@ public:
// https://wicg.github.io/scroll-to-text-fragment/#feature-detectability
GC::Ref<FragmentDirective> fragment_directive();
Optional<Vector<HTML::TextDirective>> const& pending_text_directives() const { return m_pending_text_directives; }
- void set_pending_text_directives(Optional<Vector<HTML::TextDirective>> directives);
void clear_pending_text_directives();
ReadonlySpan<GC::Ref<Range>> text_fragment_ranges() const { return m_text_fragment_ranges; }
void dismiss_text_fragment_indication();
diff --git a/Libraries/LibWeb/DOM/DocumentObserver.cpp b/Libraries/LibWeb/DOM/DocumentObserver.cpp
index 1958cd4c66b..1a19ddd8dfc 100644
--- a/Libraries/LibWeb/DOM/DocumentObserver.cpp
+++ b/Libraries/LibWeb/DOM/DocumentObserver.cpp
@@ -109,12 +109,4 @@ void DocumentObserver::set_document_visibility_state_observer(Function<void(HTML
m_document_visibility_state_observer = nullptr;
}
-void DocumentObserver::set_document_page_showing_observer(Function<void(bool)> callback)
-{
- if (callback)
- m_document_page_showing_observer = GC::create_function(GC::Heap::the(), move(callback));
- else
- m_document_page_showing_observer = nullptr;
-}
-
}
diff --git a/Libraries/LibWeb/DOM/DocumentObserver.h b/Libraries/LibWeb/DOM/DocumentObserver.h
index 4c67c6f89a1..a8ed4f5a0c0 100644
--- a/Libraries/LibWeb/DOM/DocumentObserver.h
+++ b/Libraries/LibWeb/DOM/DocumentObserver.h
@@ -40,7 +40,6 @@ public:
void set_document_visibility_state_observer(Function<void(HTML::VisibilityState)>);
[[nodiscard]] GC::Ptr<GC::Function<void(bool)>> document_page_showing_observer() const { return m_document_page_showing_observer; }
- void set_document_page_showing_observer(Function<void(bool)>);
GC::Ref<Document> document() { return m_document; }
void set_document(GC::Ref<Document>);
diff --git a/Libraries/LibWeb/Encoding/TextDecoderStream.cpp b/Libraries/LibWeb/Encoding/TextDecoderStream.cpp
index 942b933aee4..fad6aa4a895 100644
--- a/Libraries/LibWeb/Encoding/TextDecoderStream.cpp
+++ b/Libraries/LibWeb/Encoding/TextDecoderStream.cpp
@@ -76,72 +76,6 @@ WebIDL::ExceptionOr<GC::Ref<TextDecoderStream>> TextDecoderStream::create_for_co
return stream;
}
-static bool is_utf8_continuation_byte(u8 byte)
-{
- return (byte & 0xc0) == 0x80;
-}
-
-static bool is_utf8_second_byte_in_range(u8 lead, u8 byte)
-{
- if (!is_utf8_continuation_byte(byte))
- return false;
- if (lead == 0xe0)
- return byte >= 0xa0;
- if (lead == 0xed)
- return byte <= 0x9f;
- if (lead == 0xf0)
- return byte >= 0x90;
- if (lead == 0xf4)
- return byte <= 0x8f;
- return true;
-}
-
-// Returns the largest prefix length of `bytes` that can be safely decoded as UTF-8 without splitting an in-progress
-// multi-byte sequence. The remainder (if any) is held over for the next chunk.
-[[maybe_unused]] static size_t find_utf8_safe_decode_boundary(ReadonlyBytes bytes)
-{
- // A valid UTF-8 sequence is at most 4 bytes long, so we never need to look back more than 3 continuation bytes
- // to find the leading byte of the trailing sequence.
- size_t scan = 0;
- while (scan < bytes.size() && scan < 4) {
- size_t pos = bytes.size() - scan - 1;
- u8 byte = bytes[pos];
-
- // Continuation byte (10xxxxxx): keep walking back to find the leading byte.
- if (is_utf8_continuation_byte(byte)) {
- ++scan;
- continue;
- }
-
- // ASCII byte (0xxxxxxx): the trailing sequence ends here and is complete.
- if ((byte & 0x80) == 0)
- return pos + 1;
-
- // Multi-byte leading byte. If it's a recognized leading byte and the buffer doesn't yet hold the full
- // sequence, cut before it so the next chunk can complete it. Otherwise (recognized and complete, or
- // unrecognized so it'll just become a replacement character) include all bytes up to the end.
- size_t expected_length = 0;
- if (byte >= 0xc2 && byte <= 0xdf)
- expected_length = 2;
- else if (byte >= 0xe0 && byte <= 0xef)
- expected_length = 3;
- else if (byte >= 0xf0 && byte <= 0xf4)
- expected_length = 4;
- else
- return bytes.size();
- if (bytes.size() - pos >= 2 && !is_utf8_second_byte_in_range(byte, bytes[pos + 1]))
- return bytes.size();
- if (bytes.size() - pos >= expected_length)
- return bytes.size();
- return pos;
- }
-
- // No leading byte found within the last 4 bytes. Either the buffer is shorter than that, or it ends with 4
- // continuation bytes (malformed UTF-8). Either way, decode everything; the decoder will produce replacement
- // characters as needed.
- return bytes.size();
-}
-
TextDecoderStream::TextDecoderStream(GC::Ref<Streams::TransformStream> transform, FlyString encoding, TextCodec::ErrorMode error_mode, bool ignore_bom)
: Streams::GenericTransformStreamMixin(transform)
, TextDecoderCommonMixin(move(encoding), error_mode, ignore_bom)
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
index 18e250e94ae..b3e7f4c394e 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.cpp
@@ -118,26 +118,6 @@ bool Request::is_subresource_request() const
}) || !m_destination.has_value();
}
-// https://fetch.spec.whatwg.org/#non-subresource-request
-bool Request::is_non_subresource_request() const
-{
- // A non-subresource request is a request whose destination is "document", "embed", "frame", "iframe", "object", "report", "serviceworker", "sharedworker", or "worker".
- static constexpr Array non_subresource_request_destinations = {
- Destination::Document,
- Destination::Embed,
- Destination::Frame,
- Destination::IFrame,
- Destination::Object,
- Destination::Report,
- Destination::ServiceWorker,
- Destination::SharedWorker,
- Destination::Worker,
- };
- return any_of(non_subresource_request_destinations, [this](auto destination) {
- return m_destination == destination;
- });
-}
-
// https://fetch.spec.whatwg.org/#navigation-request
bool Request::is_navigation_request() const
{
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
index 14ed25ecf97..89b52f012ea 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
@@ -308,7 +308,6 @@ public:
[[nodiscard]] bool destination_is_script_like() const;
[[nodiscard]] bool is_subresource_request() const;
- [[nodiscard]] bool is_non_subresource_request() const;
[[nodiscard]] bool is_navigation_request() const;
[[nodiscard]] RedirectTaint redirect_taint() const;
diff --git a/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Libraries/LibWeb/HTML/BrowsingContext.cpp
index 69d1aae8c3c..ceeed5a010b 100644
--- a/Libraries/LibWeb/HTML/BrowsingContext.cpp
+++ b/Libraries/LibWeb/HTML/BrowsingContext.cpp
@@ -414,13 +414,6 @@ void BrowsingContext::set_window_proxy(GC::Ptr<WindowProxy> window_proxy)
m_window_proxy = move(window_proxy);
}
-// https://html.spec.whatwg.org/multipage/origin.html#one-permitted-sandboxed-navigator
-BrowsingContext const* BrowsingContext::the_one_permitted_sandboxed_navigator() const
-{
- // FIXME: Implement this.
- return nullptr;
-}
-
// https://html.spec.whatwg.org/multipage/document-sequences.html#ancestor-browsing-context
bool BrowsingContext::is_ancestor_of(BrowsingContext const& potential_descendant) const
{
diff --git a/Libraries/LibWeb/HTML/BrowsingContext.h b/Libraries/LibWeb/HTML/BrowsingContext.h
index da44a396cae..282779d4010 100644
--- a/Libraries/LibWeb/HTML/BrowsingContext.h
+++ b/Libraries/LibWeb/HTML/BrowsingContext.h
@@ -62,8 +62,6 @@ public:
Optional<u64> browsing_context_group_id() const { return m_browsing_context_group_id; }
void set_browsing_context_group_id(Optional<u64> id) { m_browsing_context_group_id = id; }
- // https://html.spec.whatwg.org/multipage/origin.html#one-permitted-sandboxed-navigator
- BrowsingContext const* the_one_permitted_sandboxed_navigator() const;
void set_the_one_permitted_sandboxed_navigator(BrowsingContext const*)
{
// FIXME: Implement this
diff --git a/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp b/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp
index 4c3b04dcead..b4644e88280 100644
--- a/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp
+++ b/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.cpp
@@ -143,15 +143,6 @@ Vector<CrossOriginProperty> cross_origin_properties(Variant<HTML::Location const
});
}
-// https://html.spec.whatwg.org/multipage/browsers.html#cross-origin-accessible-window-property-name
-bool is_cross_origin_accessible_window_property_name(JS::PropertyKey const& property_key)
-{
- // A JavaScript property name P is a cross-origin accessible window property name if it is "window", "self", "location", "close", "closed", "focus", "blur", "frames", "length", "top", "opener", "parent", "postMessage", or an array index property name.
- static NeverDestroyed<Array<Utf16FlyString, 13>> property_names { Array<Utf16FlyString, 13> {
- "window"_utf16_fly_string, "self"_utf16_fly_string, "location"_utf16_fly_string, "close"_utf16_fly_string, "closed"_utf16_fly_string, "focus"_utf16_fly_string, "blur"_utf16_fly_string, "frames"_utf16_fly_string, "length"_utf16_fly_string, "top"_utf16_fly_string, "opener"_utf16_fly_string, "parent"_utf16_fly_string, "postMessage"_utf16_fly_string } };
- return (property_key.is_string() && any_of(*property_names, [&](auto const& name) { return property_key.as_string() == name; })) || property_key.is_number();
-}
-
// 7.2.3.2 CrossOriginPropertyFallback ( P ), https://html.spec.whatwg.org/multipage/browsers.html#crossoriginpropertyfallback-(-p-)
JS::ThrowCompletionOr<JS::PropertyDescriptor> cross_origin_property_fallback(JS::VM& vm, JS::PropertyKey const& property_key)
{
diff --git a/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.h b/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.h
index 5a2fbdcedef..da10265fe89 100644
--- a/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.h
+++ b/Libraries/LibWeb/HTML/CrossOrigin/AbstractOperations.h
@@ -41,7 +41,6 @@ decltype(auto) invoke_on_window(Window* window, RemoteWindow* remote_window, Cal
}
Vector<CrossOriginProperty> cross_origin_properties(Variant<HTML::Location const*, HTML::Window const*, HTML::RemoteWindow const*> const&);
-bool is_cross_origin_accessible_window_property_name(JS::PropertyKey const&);
JS::ThrowCompletionOr<JS::PropertyDescriptor> cross_origin_property_fallback(JS::VM&, JS::PropertyKey const&);
bool is_cross_origin_platform_object(JS::Object const&);
bool is_platform_object_same_origin(JS::Object const&);
diff --git a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
index 424105128e5..d2ae1cab5f5 100644
--- a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
+++ b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
@@ -181,13 +181,4 @@ Task const* TaskQueue::last_added_task() const
return m_last_added_task.ptr();
}
-bool TaskQueue::has_rendering_tasks() const
-{
- for (auto const& task : m_tasks) {
- if (task.source() == Task::Source::Rendering)
- return true;
- }
- return false;
-}
-
}
diff --git a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h
index 0682b44ae8c..308e4814eb7 100644
--- a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h
+++ b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h
@@ -23,7 +23,6 @@ public:
size_t size_slow() const { return m_tasks.size_slow() + m_idle_tasks.size_slow(); }
bool has_runnable_tasks() const;
- bool has_rendering_tasks() const;
void add(GC::Ref<HTML::Task>);
GC::Ptr<HTML::Task> take_first_runnable();
diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp
index 30691141834..47d22780bdd 100644
--- a/Libraries/LibWeb/HTML/FormAssociatedElement.cpp
+++ b/Libraries/LibWeb/HTML/FormAssociatedElement.cpp
@@ -103,11 +103,6 @@ FormAssociatedElement::FACESubmissionValue const& FormAssociatedElement::face_su
return face_rare_data().submission_value;
}
-FormAssociatedElement::FACESubmissionValue const& FormAssociatedElement::face_state() const
-{
- return face_rare_data().state;
-}
-
static SelectionDirection string_to_selection_direction(Utf16View value)
{
if (value == u"forward"sv)
diff --git a/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Libraries/LibWeb/HTML/FormAssociatedElement.h
index 69d38a1152b..89f55f7ebc7 100644
--- a/Libraries/LibWeb/HTML/FormAssociatedElement.h
+++ b/Libraries/LibWeb/HTML/FormAssociatedElement.h
@@ -151,7 +151,6 @@ public:
FACESubmissionValue const& face_submission_value() const;
void set_face_submission_value(Badge<ElementInternals>, FACESubmissionValue const& value);
- FACESubmissionValue const& face_state() const;
void set_face_state(Badge<ElementInternals>, FACESubmissionValue const& value);
void set_custom_validity_error_message(Badge<ElementInternals>, Utf16View value);
diff --git a/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
index 7264459d8b3..8e16b160fa3 100644
--- a/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
@@ -36,31 +36,4 @@ void HTMLHtmlElement::publish_body_construction_facts()
}
}
-bool HTMLHtmlElement::should_use_body_background_properties(Layout::BegunRead const& read) const
-{
- // https://drafts.csswg.org/css-contain-2/#contain-property
- // Additionally, when any containments are active on either the HTML <html> or <body> elements, propagation of
- // properties from the <body> element to the initial containing block, the viewport, or the canvas background, is
- // disabled. Notably, this affects:
- // - 'background' and its longhands (see CSS Backgrounds 3 § 2.11.2 The Canvas Background and the HTML <body> Element)
- // NB: Called during rendering, reading style off the layout nodes.
- auto has_containment = [](Layout::NodeWithStyle const& layout_node) {
- return !layout_node.contain().is_empty();
- };
-
- auto const* layout_node = unsafe_layout_node(read);
- if (!layout_node || has_containment(*layout_node))
- return false;
-
- auto const* body_element = first_child_of_type<HTML::HTMLBodyElement>();
- if (!body_element)
- return false;
- auto const* body_layout_node = body_element->unsafe_layout_node(read);
- if (!body_layout_node || has_containment(*body_layout_node))
- return false;
-
- return layout_node->background_color() == Color::Transparent
- && !any_of(layout_node->background_images(), [](auto const& image) { return image != nullptr; });
-}
-
}
diff --git a/Libraries/LibWeb/HTML/HTMLHtmlElement.h b/Libraries/LibWeb/HTML/HTMLHtmlElement.h
index 351bf5b69e1..cabe803c079 100644
--- a/Libraries/LibWeb/HTML/HTMLHtmlElement.h
+++ b/Libraries/LibWeb/HTML/HTMLHtmlElement.h
@@ -19,8 +19,6 @@ class WEB_API HTMLHtmlElement final : public HTMLElement {
public:
virtual ~HTMLHtmlElement() override;
- bool should_use_body_background_properties(Layout::BegunRead const& read) const;
-
// Being the document's body is one of the facts a layout row is built with, and which child is the body moves
// with this element's children. Called wherever they move.
void publish_body_construction_facts();
diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index 83e45a871ca..1d019a17ea7 100644
--- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -378,24 +378,6 @@ FileFilter HTMLInputElement::parse_accept_attribute() const
return filter;
}
-// https://html.spec.whatwg.org/multipage/input.html#update-the-file-selection
-void HTMLInputElement::update_the_file_selection(GC::Ref<FileAPI::FileList> files)
-{
- // 1. Queue an element task on the user interaction task source given element and the following steps:
- // https://github.com/whatwg/html/issues/1080
- // INTEROP: Other engines perform these steps synchronously once the user has selected the files.
-
- set_files(files.ptr());
-
- // 2. Fire an event named input at the input element, with the bubbles and composed attributes initialized to true.
- auto input_event = create_event_for_element(*this, EventNames::input, { .bubbles = true, .composed = true });
- this->dispatch_event(input_event);
-
- // 3. Fire an event named change at the input element, with the bubbles attribute initialized to true.
- auto change_event = create_event_for_element(*this, EventNames::change, { .bubbles = true });
- this->dispatch_event(change_event);
-}
-
// https://html.spec.whatwg.org/multipage/input.html#show-the-picker,-if-applicable
static void show_the_picker_if_applicable(HTMLInputElement& element)
{
diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.h b/Libraries/LibWeb/HTML/HTMLInputElement.h
index 22ae3695926..4b7fe362bcb 100644
--- a/Libraries/LibWeb/HTML/HTMLInputElement.h
+++ b/Libraries/LibWeb/HTML/HTMLInputElement.h
@@ -134,10 +134,6 @@ public:
FileFilter parse_accept_attribute() const;
- // NOTE: User interaction
- // https://html.spec.whatwg.org/multipage/input.html#update-the-file-selection
- void update_the_file_selection(GC::Ref<FileAPI::FileList>);
-
WebIDL::Long max_length() const;
WebIDL::ExceptionOr<void> set_max_length(WebIDL::Long);
diff --git a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
index d086c069101..140ef420b3a 100644
--- a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
@@ -697,16 +697,6 @@ void HTMLScriptElement::mark_as_ready(Result result)
m_preparation_time_document->schedule_html_parser_end_check();
}
-void HTMLScriptElement::unmark_as_already_started(Badge<DOM::Range>)
-{
- m_already_started = false;
-}
-
-void HTMLScriptElement::unmark_as_parser_inserted(Badge<DOM::Range>)
-{
- m_parser_document = nullptr;
-}
-
// https://github.com/w3c/trusted-types/blob/0f01aee35c3684e8cb20e7d83445ad65938f545d/spec/index.bs#L1341
TrustedTypes::TrustedScriptURLOrString HTMLScriptElement::src() const
{
diff --git a/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Libraries/LibWeb/HTML/HTMLScriptElement.h
index dd393272ad9..40f595b9627 100644
--- a/Libraries/LibWeb/HTML/HTMLScriptElement.h
+++ b/Libraries/LibWeb/HTML/HTMLScriptElement.h
@@ -55,9 +55,6 @@ public:
void set_source_line_number(Badge<HTMLParser>, size_t source_line_number) { m_source_line_number = source_line_number; }
- void unmark_as_already_started(Badge<DOM::Range>);
- void unmark_as_parser_inserted(Badge<DOM::Range>);
-
TrustedTypes::TrustedScriptOrString text() const { return child_text_content(); }
WebIDL::ExceptionOr<void> set_text(TrustedTypes::TrustedScriptOrString);
diff --git a/Libraries/LibWeb/HTML/StructuredSerialize.cpp b/Libraries/LibWeb/HTML/StructuredSerialize.cpp
index 0e9ecb06d06..103d1c6d64e 100644
--- a/Libraries/LibWeb/HTML/StructuredSerialize.cpp
+++ b/Libraries/LibWeb/HTML/StructuredSerialize.cpp
@@ -1187,17 +1187,6 @@ WebIDL::Exception data_clone_error_from_serialization_error(JS::Realm& realm, AK
return WebIDL::Exception { WebIDL::DataCloneError::create(realm, "Unable to process structured serialized data"_utf16) };
}
-WebIDL::ExceptionOr<String> decode_utf8_text_or_throw_data_clone_error(JS::Realm& realm, StructuredSerializeReader& reader)
-{
- auto text = reader.decode<Utf16String>();
- if (text.is_error())
- return data_clone_error_from_serialization_error(realm, text.release_error());
- auto utf8 = utf16_to_utf8_text(text.value());
- if (utf8.is_error())
- return data_clone_error_from_serialization_error(realm, utf8.release_error());
- return utf8.release_value();
-}
-
static GC::Ref<WebIDL::DOMException> data_clone_error(Utf16String message)
{
return WebIDL::DataCloneError::create(move(message));
diff --git a/Libraries/LibWeb/HTML/StructuredSerialize.h b/Libraries/LibWeb/HTML/StructuredSerialize.h
index d5dda91db71..f25a1ee8fcb 100644
--- a/Libraries/LibWeb/HTML/StructuredSerialize.h
+++ b/Libraries/LibWeb/HTML/StructuredSerialize.h
@@ -181,9 +181,6 @@ WebIDL::ExceptionOr<T> decode_or_throw_data_clone_error(JS::Realm& realm, Struct
return result.release_value();
}
-// Decode stored text to UTF-8 and reject lone surrogates as DataCloneError.
-WEB_API WebIDL::ExceptionOr<String> decode_utf8_text_or_throw_data_clone_error(JS::Realm& realm, StructuredSerializeReader& reader);
-
// Pairs each serializable interface with its storage identifier.
struct SerializableRegistryEntry {
Bindings::InterfaceName interface_name;
diff --git a/Libraries/LibWeb/IndexedDB/Internal/Algorithms.cpp b/Libraries/LibWeb/IndexedDB/Internal/Algorithms.cpp
index 7fb596242f5..637390414d9 100644
--- a/Libraries/LibWeb/IndexedDB/Internal/Algorithms.cpp
+++ b/Libraries/LibWeb/IndexedDB/Internal/Algorithms.cpp
@@ -2047,37 +2047,6 @@ JS::Value retrieve_a_key_from_an_object_store(JS::Realm& realm, GC::Ref<ObjectSt
return convert_a_key_to_a_value(realm, record.value().key);
}
-// https://w3c.github.io/IndexedDB/#retrieve-multiple-values-from-an-object-store
-WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_values_from_an_object_store(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
-{
- // 1. If count is not given or is 0 (zero), let count be infinity.
- if (count.has_value() && *count == 0)
- count = OptionalNone();
-
- // 2. Let records be a list containing the first count records in store’s list of records whose key is in range.
- auto records = store->first_n_in_range(range, count);
-
- // 3. Let list be an empty list.
- auto list = MUST(JS::Array::create(realm, records.size()));
-
- // 4. For each record of records:
- for (u32 i = 0; i < records.size(); ++i) {
- auto& record = records[i];
-
- // 1. Let serialized be record’s value. If an error occurs while reading the value from the underlying storage, return a newly created "NotReadableError" DOMException.
- auto const& serialized = *record.value;
-
- // 2. Let entry be ! StructuredDeserialize(serialized, targetRealm).
- auto entry = TRY(deserialize_a_stored_record(realm, serialized));
-
- // 3. Append entry to list.
- MUST(list->create_data_property_or_throw(i, entry));
- }
-
- // 5. Return list converted to a sequence<any>.
- return list;
-}
-
// https://pr-preview.s3.amazonaws.com/w3c/IndexedDB/pull/461.html#retrieve-multiple-items-from-an-object-store
WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_items_from_an_object_store(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBKeyRange> range, RecordKind kind, CursorDirection direction, Optional<WebIDL::UnsignedLong> count)
{
@@ -2149,34 +2118,6 @@ WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_items_from_an_object_s
return list;
}
-// https://w3c.github.io/IndexedDB/#retrieve-multiple-keys-from-an-object-store
-GC::Ref<JS::Array> retrieve_multiple_keys_from_an_object_store(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
-{
- // 1. If count is not given or is 0 (zero), let count be infinity.
- if (count.has_value() && *count == 0)
- count = OptionalNone();
-
- // 2. Let records be a list containing the first count records in store’s list of records whose key is in range.
- auto records = store->first_n_in_range(range, count);
-
- // 3. Let list be an empty list.
- auto list = MUST(JS::Array::create(realm, records.size()));
-
- // 4. For each record of records:
- for (u32 i = 0; i < records.size(); ++i) {
- auto& record = records[i];
-
- // 1. Let entry be the result of converting a key to a value with record’s key.
- auto entry = convert_a_key_to_a_value(realm, record.key);
-
- // 2. Append entry to list.
- MUST(list->create_data_property_or_throw(i, entry));
- }
-
- // 5. Return list converted to a sequence<any>.
- return list;
-}
-
// https://w3c.github.io/IndexedDB/#retrieve-a-referenced-value-from-an-index
WebIDL::ExceptionOr<JS::Value> retrieve_a_referenced_value_from_an_index(JS::Realm& realm, GC::Ref<Index> index, GC::Ref<IDBKeyRange> range)
{
@@ -2208,65 +2149,6 @@ JS::Value retrieve_a_value_from_an_index(JS::Realm& realm, GC::Ref<Index> index,
return convert_a_key_to_a_value(realm, record->value);
}
-// https://w3c.github.io/IndexedDB/#retrieve-multiple-referenced-values-from-an-index
-WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_referenced_values_from_an_index(JS::Realm& realm, GC::Ref<Index> index, GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
-{
- // 1. If count is not given or is 0 (zero), let count be infinity.
- if (count.has_value() && *count == 0)
- count = OptionalNone();
-
- // 2. Let records be a list containing the first count records in index’s list of records whose key is in range.
- auto records = index->first_n_in_range(range, count);
-
- // 3. Let list be an empty list.
- auto list = MUST(JS::Array::create(realm, records.size()));
-
- // 4. For each record of records:
- for (u32 i = 0; i < records.size(); ++i) {
- auto& record = records[i];
-
- // 1. Let serialized be record’s referenced value.
- auto serialized = index->referenced_value(record);
-
- // 2. Let entry be ! StructuredDeserialize(serialized, targetRealm).
- auto entry = TRY(deserialize_a_stored_record(realm, serialized));
-
- // 3. Append entry to list.
- MUST(list->create_data_property_or_throw(i, entry));
- }
-
- // 5. Return list converted to a sequence<any>.
- return list;
-}
-
-// https://w3c.github.io/IndexedDB/#retrieve-multiple-values-from-an-index
-GC::Ref<JS::Array> retrieve_multiple_values_from_an_index(JS::Realm& realm, GC::Ref<Index> index, GC::Ref<IDBKeyRange> range, Optional<WebIDL::UnsignedLong> count)
-{
- // 1. If count is not given or is 0 (zero), let count be infinity.
- if (count.has_value() && *count == 0)
- count = OptionalNone();
-
- // 2. Let records be a list containing the first count records in index’s list of records whose key is in range.
- auto records = index->first_n_in_range(range, count);
-
- // 3. Let list be an empty list.
- auto list = MUST(JS::Array::create(realm, records.size()));
-
- // 4. For each record of records:
- for (u32 i = 0; i < records.size(); ++i) {
- auto& record = records[i];
-
- // 1. Let entry be the result of converting a key to a value with record’s value.
- auto entry = convert_a_key_to_a_value(realm, record.value);
-
- // 2. Append entry to list.
- MUST(list->create_data_property_or_throw(i, entry));
- }
-
- // 7. Return list converted to a sequence<any>.
- return list;
-}
-
// https://w3c.github.io/IndexedDB/#queue-a-database-task
void queue_a_database_task(GC::Ref<GC::Function<void()>> steps)
{
diff --git a/Libraries/LibWeb/IndexedDB/Internal/Algorithms.h b/Libraries/LibWeb/IndexedDB/Internal/Algorithms.h
index 8351b6ae6fd..c61fc0aac04 100644
--- a/Libraries/LibWeb/IndexedDB/Internal/Algorithms.h
+++ b/Libraries/LibWeb/IndexedDB/Internal/Algorithms.h
@@ -64,12 +64,8 @@ WebIDL::ExceptionOr<JS::Value> retrieve_a_value_from_an_object_store(JS::Realm&,
WebIDL::ExceptionOr<GC::Ptr<IDBCursor>> iterate_a_cursor(JS::Realm&, GC::Ref<IDBCursor>, GC::Ptr<Key> = nullptr, GC::Ptr<Key> = nullptr, u64 = 1);
JS::Value clear_an_object_store(GC::Ref<ObjectStore>);
JS::Value retrieve_a_key_from_an_object_store(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>);
-WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_values_from_an_object_store(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>, Optional<WebIDL::UnsignedLong>);
-GC::Ref<JS::Array> retrieve_multiple_keys_from_an_object_store(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBKeyRange>, Optional<WebIDL::UnsignedLong>);
WebIDL::ExceptionOr<JS::Value> retrieve_a_referenced_value_from_an_index(JS::Realm&, GC::Ref<Index>, GC::Ref<IDBKeyRange>);
JS::Value retrieve_a_value_from_an_index(JS::Realm&, GC::Ref<Index>, GC::Ref<IDBKeyRange>);
-WebIDL::ExceptionOr<GC::Ref<JS::Array>> retrieve_multiple_referenced_values_from_an_index(JS::Realm&, GC::Ref<Index>, GC::Ref<IDBKeyRange>, Optional<WebIDL::UnsignedLong>);
-GC::Ref<JS::Array> retrieve_multiple_values_from_an_index(JS::Realm&, GC::Ref<Index>, GC::Ref<IDBKeyRange>, Optional<WebIDL::UnsignedLong>);
void queue_a_database_task(GC::Ref<GC::Function<void()>>);
bool cleanup_indexed_database_transactions(GC::Ref<HTML::EventLoop>);
bool is_a_potentially_valid_key_range(JS::Realm&, JS::Value);
diff --git a/Libraries/LibWeb/Infra/ByteSequences.cpp b/Libraries/LibWeb/Infra/ByteSequences.cpp
index 7009df471cf..61f00af4faa 100644
--- a/Libraries/LibWeb/Infra/ByteSequences.cpp
+++ b/Libraries/LibWeb/Infra/ByteSequences.cpp
@@ -9,22 +9,6 @@
namespace Web::Infra {
-// https://infra.spec.whatwg.org/#byte-lowercase
-void byte_lowercase(ByteBuffer& bytes)
-{
- // To byte-lowercase a byte sequence, increase each byte it contains, in the range 0x41 (A) to 0x5A (Z), inclusive, by 0x20.
- for (size_t i = 0; i < bytes.size(); ++i)
- bytes[i] = to_ascii_lowercase(bytes[i]);
-}
-
-// https://infra.spec.whatwg.org/#byte-uppercase
-void byte_uppercase(ByteBuffer& bytes)
-{
- // To byte-uppercase a byte sequence, subtract each byte it contains, in the range 0x61 (a) to 0x7A (z), inclusive, by 0x20.
- for (size_t i = 0; i < bytes.size(); ++i)
- bytes[i] = to_ascii_uppercase(bytes[i]);
-}
-
// https://infra.spec.whatwg.org/#byte-sequence-starts-with
bool is_prefix_of(ReadonlyBytes potential_prefix, ReadonlyBytes input)
{
diff --git a/Libraries/LibWeb/Infra/ByteSequences.h b/Libraries/LibWeb/Infra/ByteSequences.h
index 50c67269bbc..63484e7ee33 100644
--- a/Libraries/LibWeb/Infra/ByteSequences.h
+++ b/Libraries/LibWeb/Infra/ByteSequences.h
@@ -10,8 +10,6 @@
namespace Web::Infra {
-void byte_lowercase(ByteBuffer&);
-void byte_uppercase(ByteBuffer&);
bool is_prefix_of(ReadonlyBytes potential_prefix, ReadonlyBytes input);
bool is_byte_less_than(ReadonlyBytes a, ReadonlyBytes b);
diff --git a/Libraries/LibWeb/Layout/SearchableText.cpp b/Libraries/LibWeb/Layout/SearchableText.cpp
index 18a41c310ac..07e60567b00 100644
--- a/Libraries/LibWeb/Layout/SearchableText.cpp
+++ b/Libraries/LibWeb/Layout/SearchableText.cpp
@@ -484,44 +484,6 @@ Optional<DOM::BoundaryPoint> SearchableText::boundary_point_at_offset(Block cons
return DOM::BoundaryPoint { *node, static_cast<WebIDL::UnsignedLong>(dom_offset) };
}
-Optional<GC::Ref<DOM::Range>> SearchableText::range_from_offsets(Block const& block, size_t start_offset, size_t end_offset) const
-{
- if (block.segments.is_empty() || block.offset_mapping.is_empty() || start_offset > end_offset || end_offset > block.offset_mapping.size())
- return {};
-
- auto segment_for_code_unit = [&](size_t code_unit_offset) -> Segment const& {
- auto const* segment = &block.segments.first();
- for (size_t i = 1; i < block.segments.size() && block.segments[i].start_offset <= code_unit_offset; ++i)
- segment = &block.segments[i];
- return *segment;
- };
-
- auto const start_mapping_index = start_offset < block.offset_mapping.size() ? start_offset : block.offset_mapping.size() - 1;
- auto const end_mapping_index = end_offset > 0 ? end_offset - 1 : 0;
- auto const& start_mapping = block.offset_mapping[start_mapping_index];
- auto const& end_mapping = block.offset_mapping[end_mapping_index];
- auto start_node = segment_for_code_unit(start_mapping_index).dom_node.ptr();
- auto end_node = segment_for_code_unit(end_mapping_index).dom_node.ptr();
- if (!start_node || !end_node)
- return {};
-
- auto const start_dom_offset = start_offset < block.offset_mapping.size()
- ? start_mapping.dom_start_offset
- : start_mapping.dom_end_offset;
- auto const end_dom_offset = end_offset > 0
- ? end_mapping.dom_end_offset
- : end_mapping.dom_start_offset;
-
- if (&start_node->root() != &end_node->root()
- || !start_node->is_connected()
- || !end_node->is_connected()
- || start_dom_offset > start_node->length()
- || end_dom_offset > end_node->length())
- return {};
-
- return DOM::Range::create(*start_node, start_dom_offset, *end_node, end_dom_offset);
-}
-
SearchableText const& SearchableTextCache::get()
{
if (!m_searchable_text.has_value())
diff --git a/Libraries/LibWeb/Layout/SearchableText.h b/Libraries/LibWeb/Layout/SearchableText.h
index b44dcd857df..a099468dd0a 100644
--- a/Libraries/LibWeb/Layout/SearchableText.h
+++ b/Libraries/LibWeb/Layout/SearchableText.h
@@ -49,7 +49,6 @@ public:
Vector<Block> const& blocks() const { return m_blocks; }
Vector<Block> const& find_in_page_blocks() const { return m_find_in_page_blocks.has_value() ? *m_find_in_page_blocks : m_blocks; }
Optional<DOM::BoundaryPoint> boundary_point_at_offset(Block const&, size_t offset, bool is_end) const;
- Optional<GC::Ref<DOM::Range>> range_from_offsets(Block const&, size_t start_offset, size_t end_offset) const;
private:
explicit SearchableText(Vector<Block> blocks, Optional<Vector<Block>> find_in_page_blocks)
diff --git a/Libraries/LibWeb/PermissionsAPI/PermissionStatus.cpp b/Libraries/LibWeb/PermissionsAPI/PermissionStatus.cpp
index 55c6821caff..ed852427964 100644
--- a/Libraries/LibWeb/PermissionsAPI/PermissionStatus.cpp
+++ b/Libraries/LibWeb/PermissionsAPI/PermissionStatus.cpp
@@ -66,34 +66,6 @@ JS::Object& PermissionStatus::relevant_global_object() const
return HTML::relevant_global_object(HTML::relevant_window_or_worker_global_scope(*m_global_object));
}
-// https://w3c.github.io/permissions/#dfn-permissionstatus-update-steps
-void PermissionStatus::update_steps()
-{
- auto& relevant_global_object = this->relevant_global_object();
- // 1. If this's relevant global object is a Window object, then:
- if (auto* window = HTML::window_from_global_object(relevant_global_object)) {
- // 1. Let document be status's relevant global object's associated Document.
- auto const& document = window->associated_document();
- // 2. If document is null or document is not fully active, terminate this algorithm.
- if (!document.is_fully_active()) {
- return;
- }
- }
-
- // 2. Let query be status's [[query]] internal slot.
- auto query = m_query;
-
- // 3. Run query's name's permission query algorithm, passing query and status.
- permission_query_algorithm(query, *this);
-
- // 4. Queue a task on the permissions task source to fire an event named change at status.
- HTML::queue_global_task(HTML::Task::Source::Permissions, relevant_global_object,
- GC::create_function(GC::Heap::the(), [this, relevant_global_object = GC::Ref(relevant_global_object)] {
- dispatch_event(DOM::Event::create(HTML::EventNames::change,
- HighResolutionTime::current_high_resolution_time(*relevant_global_object)));
- }));
-}
-
// https://w3c.github.io/permissions/#dom-permissionstatus-onchange
void PermissionStatus::set_onchange(GC::Ptr<WebIDL::CallbackType> event_handler)
{
diff --git a/Libraries/LibWeb/PermissionsAPI/PermissionStatus.h b/Libraries/LibWeb/PermissionsAPI/PermissionStatus.h
index d2e6052bfce..f38a386e415 100644
--- a/Libraries/LibWeb/PermissionsAPI/PermissionStatus.h
+++ b/Libraries/LibWeb/PermissionsAPI/PermissionStatus.h
@@ -28,9 +28,6 @@ public:
PermissionDescriptor const& query() const { return m_query; }
- // https://w3c.github.io/permissions/#dfn-permissionstatus-update-steps
- void update_steps();
-
// https://w3c.github.io/permissions/#dom-permissionstatus-onchange
void set_onchange(GC::Ptr<WebIDL::CallbackType> event_handler);
GC::Ptr<WebIDL::CallbackType> onchange();
diff --git a/Libraries/LibWeb/PermissionsAPI/PermissionStore.cpp b/Libraries/LibWeb/PermissionsAPI/PermissionStore.cpp
index cb16d662c78..21332032926 100644
--- a/Libraries/LibWeb/PermissionsAPI/PermissionStore.cpp
+++ b/Libraries/LibWeb/PermissionsAPI/PermissionStore.cpp
@@ -74,12 +74,4 @@ void PermissionStore::set_permission_store_entry(PermissionDescriptor const& des
m_entries.append(move(new_entry));
}
-void PermissionStore::remove_permission_store_entry(PermissionDescriptor const& descriptor, URL::Origin const& key)
-{
- // 1. Remove the entry whose descriptor is descriptor, and whose key is equal to key given descriptor, from the user agent's permission store.
- m_entries.remove_all_matching([&](auto const& entry) {
- return entry.descriptor.name == descriptor.name && permission_key_is_equal_to(descriptor, entry.permission_key, key);
- });
-}
-
}
diff --git a/Libraries/LibWeb/PermissionsAPI/PermissionStore.h b/Libraries/LibWeb/PermissionsAPI/PermissionStore.h
index 2a93d34e707..0eb469cdf8d 100644
--- a/Libraries/LibWeb/PermissionsAPI/PermissionStore.h
+++ b/Libraries/LibWeb/PermissionsAPI/PermissionStore.h
@@ -35,9 +35,6 @@ public:
// https://w3c.github.io/permissions/#dfn-set-a-permission-store-entry
void set_permission_store_entry(PermissionDescriptor const& descriptor, URL::Origin const& key, PermissionState state);
- // https://w3c.github.io/permissions/#dfn-remove-a-permission-store-entry
- void remove_permission_store_entry(PermissionDescriptor const& descriptor, URL::Origin const& key);
-
private:
PermissionStore() = default;
diff --git a/Libraries/LibWeb/PermissionsAPI/Permissions.cpp b/Libraries/LibWeb/PermissionsAPI/Permissions.cpp
index 3edac39fc04..7d4bc79c65b 100644
--- a/Libraries/LibWeb/PermissionsAPI/Permissions.cpp
+++ b/Libraries/LibWeb/PermissionsAPI/Permissions.cpp
@@ -225,16 +225,6 @@ void Permissions::query(GC::Ref<JS::Object> permission_desc, GC::Ref<WebIDL::Pro
}
}
-// https://w3c.github.io/permissions/#dfn-getting-the-current-permission-state
-PermissionState get_current_permission_state(Utf16String const& name, Optional<HTML::EnvironmentSettingsObject&> settings)
-{
- // 1. Let descriptor be a newly-created PermissionDescriptor with name initialized to name.
- PermissionDescriptor descriptor { name };
-
- // 2. Return the permission state of descriptor with settings.
- return permission_state(descriptor, settings);
-}
-
// https://w3c.github.io/permissions/#dfn-permission-query-algorithm
void permission_query_algorithm(PermissionDescriptor const& permission_desc, PermissionStatus& status)
{
diff --git a/Libraries/LibWeb/PermissionsAPI/Permissions.h b/Libraries/LibWeb/PermissionsAPI/Permissions.h
index f883d6398f3..186dd2fdf03 100644
--- a/Libraries/LibWeb/PermissionsAPI/Permissions.h
+++ b/Libraries/LibWeb/PermissionsAPI/Permissions.h
@@ -26,8 +26,6 @@ bool is_permission_supported(Utf16View);
PermissionState permission_state(PermissionDescriptor descriptor, Optional<HTML::EnvironmentSettingsObject&> settings = {});
-PermissionState get_current_permission_state(Utf16String const& name, Optional<HTML::EnvironmentSettingsObject&> settings = {});
-
PermissionState request_permission(PermissionDescriptor const& descriptor);
// Asks the user when the state is "prompt"; the callback runs once a state other than "prompt" is known.
diff --git a/Libraries/LibWeb/Platform/FontPlugin.cpp b/Libraries/LibWeb/Platform/FontPlugin.cpp
index b8fd9e11517..d1a1412afdf 100644
--- a/Libraries/LibWeb/Platform/FontPlugin.cpp
+++ b/Libraries/LibWeb/Platform/FontPlugin.cpp
@@ -65,11 +65,6 @@ RefPtr<Gfx::Font> FontPlugin::default_font(float point_size, Optional<Gfx::FontV
return Gfx::FontDatabase::the().get(font_name, point_size, 400, Gfx::FontWidth::Normal, 0, font_variation_settings, shape_features);
}
-Gfx::Font& FontPlugin::default_fixed_width_font()
-{
- return *m_default_fixed_width_font;
-}
-
Vector<FlyString> FontPlugin::symbol_font_names()
{
return m_symbol_font_names;
diff --git a/Libraries/LibWeb/Platform/FontPlugin.h b/Libraries/LibWeb/Platform/FontPlugin.h
index 4efe54e91fd..e7687b6493e 100644
--- a/Libraries/LibWeb/Platform/FontPlugin.h
+++ b/Libraries/LibWeb/Platform/FontPlugin.h
@@ -43,7 +43,6 @@ public:
static void install(FontPlugin&);
RefPtr<Gfx::Font> default_font(float point_size, Optional<Gfx::FontVariationSettings> const& font_variation_settings = {}, Optional<Gfx::ShapeFeatures> const& shape_features = {});
- Gfx::Font& default_fixed_width_font();
FlyString generic_font_name(GenericFont);
Vector<FlyString> symbol_font_names();
diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Libraries/LibWeb/SVG/SVGMaskElement.cpp
index 9d1c7bfc59f..f9e20eeef3f 100644
--- a/Libraries/LibWeb/SVG/SVGMaskElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGMaskElement.cpp
@@ -105,48 +105,4 @@ NumberPercentage SVGMaskElement::mask_height() const
return m_height.value_or(NumberPercentage::create_percentage(120));
}
-// https://drafts.csswg.org/css-masking/#element-attrdef-mask-maskunits
-CSSPixelRect SVGMaskElement::resolve_masking_area(CSSPixelRect const& target_object_bounding_box, Gfx::FloatSize const& viewport_size, Gfx::AffineTransform const& user_space_to_css_pixels) const
-{
- Gfx::FloatRect masking_area;
- if (mask_units() == MaskUnits::ObjectBoundingBox) {
- // objectBoundingBox
- // x, y, width and height represent fractions or percentages of the object bounding box of the element to
- // which the mask is applied.
- auto target = target_object_bounding_box.to_type<float>();
- masking_area = {
- target.x() + (mask_x().value() * target.width()),
- target.y() + (mask_y().value() * target.height()),
- mask_width().value() * target.width(),
- mask_height().value() * target.height(),
- };
- } else {
- // userSpaceOnUse
- // x, y, width and height represent values in the current user coordinate system in place at the time when
- // the mask element is referenced (i.e., the user coordinate system for the element referencing the mask
- // element via the mask property).
- // Percentages resolve against the SVG viewport; from https://svgwg.org/svg2-draft/coords.html#Units:
- // For any x-coordinate value or width value expressed as a percentage of the SVG viewport, the value to use
- // must be the percentage, in user units, of the width parameter of the 'viewBox' applied to that viewport.
- // If no 'viewBox' is specified, then the value to use must be the percentage, in user units, of the width
- // of the SVG viewport.
- // (Correspondingly with the height parameter for y-coordinate and height values.)
- Gfx::FloatRect user_space_masking_area {
- mask_x().resolve_relative_to(viewport_size.width()),
- mask_y().resolve_relative_to(viewport_size.height()),
- mask_width().resolve_relative_to(viewport_size.width()),
- mask_height().resolve_relative_to(viewport_size.height()),
- };
- if (user_space_masking_area.is_empty())
- return {};
- masking_area = user_space_to_css_pixels.map(user_space_masking_area);
- }
-
- // To convey "a negative value or a value of zero disables rendering of the element" to the caller, we return an
- // empty masking area.
- if (masking_area.is_empty())
- return {};
- return masking_area.to_type<CSSPixels>();
-}
-
}
diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.h b/Libraries/LibWeb/SVG/SVGMaskElement.h
index 21d6b96df77..fbbcf5df077 100644
--- a/Libraries/LibWeb/SVG/SVGMaskElement.h
+++ b/Libraries/LibWeb/SVG/SVGMaskElement.h
@@ -35,8 +35,6 @@ public:
virtual CSS::ElementBoxKind box_kind() const override;
- CSSPixelRect resolve_masking_area(CSSPixelRect const& target_object_bounding_box, Gfx::FloatSize const& viewport_size, Gfx::AffineTransform const& user_space_to_css_pixels) const;
-
MaskContentUnits mask_content_units() const;
MaskUnits mask_units() const;
NumberPercentage mask_x() const;
diff --git a/Libraries/LibWeb/ServiceWorker/Registration.cpp b/Libraries/LibWeb/ServiceWorker/Registration.cpp
index e19edcfa075..58bd01e8d5a 100644
--- a/Libraries/LibWeb/ServiceWorker/Registration.cpp
+++ b/Libraries/LibWeb/ServiceWorker/Registration.cpp
@@ -28,15 +28,6 @@ Registration::Registration(StorageAPI::StorageKey storage_key, URL::URL scope, S
{
}
-// https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration-unregistered
-bool Registration::is_unregistered()
-{
- // A service worker registration is said to be unregistered if registration map[this service worker registration's (storage key, serialized scope url)] is not this service worker registration.
- // FIXME: Suspect that spec should say to serialize without fragment
- auto const key = RegistrationKey { m_storage_key, m_scope_url.serialize(URL::ExcludeFragment::Yes).to_byte_string() };
- return registration_map().get(key).value_or(nullptr) != this;
-}
-
// https://w3c.github.io/ServiceWorker/#service-worker-registration-stale
bool Registration::is_stale() const
{
diff --git a/Libraries/LibWeb/ServiceWorker/Registration.h b/Libraries/LibWeb/ServiceWorker/Registration.h
index 7df7c533ee0..2eb427a0ea6 100644
--- a/Libraries/LibWeb/ServiceWorker/Registration.h
+++ b/Libraries/LibWeb/ServiceWorker/Registration.h
@@ -42,8 +42,6 @@ public:
static void remove(StorageAPI::StorageKey const&, URL::URL const&);
- bool is_unregistered();
-
StorageAPI::StorageKey const& storage_key() const { return m_storage_key; }
URL::URL const& scope_url() const { return m_scope_url; }
ServiceWorkerUpdateViaCache update_via_cache() const { return m_update_via_cache_mode; }
diff --git a/Libraries/LibWeb/Streams/ReadableStream.cpp b/Libraries/LibWeb/Streams/ReadableStream.cpp
index c9635c9c33e..076f16b93f7 100644
--- a/Libraries/LibWeb/Streams/ReadableStream.cpp
+++ b/Libraries/LibWeb/Streams/ReadableStream.cpp
@@ -329,55 +329,6 @@ WebIDL::ExceptionOr<GC::Ref<ReadableStreamDefaultReader>> ReadableStream::get_a_
return TRY(acquire_readable_stream_default_reader(realm, *this));
}
-// https://streams.spec.whatwg.org/#readablestream-pull-from-bytes
-WebIDL::ExceptionOr<void> ReadableStream::pull_from_bytes(ByteBuffer bytes)
-{
- auto& realm = this->realm();
- // 1. Assert: stream.[[controller]] implements ReadableByteStreamController.
- auto& controller = this->controller()->get<GC::Ref<ReadableByteStreamController>>();
-
- // 2. Let available be bytes’s length.
- auto available = bytes.size();
-
- // 3. Let desiredSize be available.
- auto desired_size = available;
-
- // 4. If stream’s current BYOB request view is non-null, then set desiredSize to stream’s current BYOB request
- // view's byte length.
- if (auto byob_view = current_byob_request_view(); byob_view.has_value())
- desired_size = byob_view->byte_length();
-
- // 5. Let pullSize be the smaller value of available and desiredSize.
- auto pull_size = min(available, desired_size);
-
- // 6. Let pulled be the first pullSize bytes of bytes.
- auto pulled = pull_size == available ? move(bytes) : MUST(bytes.slice(0, pull_size));
-
- // 7. Remove the first pullSize bytes from bytes.
- // NB: We skip this step. No caller actually wants its bytes trimmed, and we don't take the bytes by reference anyways.
-
- // 8. If stream’s current BYOB request view is non-null, then:
- if (auto byob_view = current_byob_request_view(); byob_view.has_value()) {
- // 1. Write pulled into stream’s current BYOB request view.
- if (byob_view->write_checked(pulled).is_error())
- return WebIDL::InvalidStateError::create(realm, "BYOB request view is detached or out-of-bounds"_utf16);
-
- // 2. Perform ? ReadableByteStreamControllerRespond(stream.[[controller]], pullSize).
- TRY(readable_byte_stream_controller_respond(realm, controller, pull_size));
- }
- // 9. Otherwise,
- else {
- // 1. Set view to the result of creating a Uint8Array from pulled in stream’s relevant Realm.
- auto array_buffer = JS::ArrayBuffer::create(realm, move(pulled));
- auto view = JS::Uint8Array::create(realm, array_buffer->byte_length(), *array_buffer);
-
- // 2. Perform ? ReadableByteStreamControllerEnqueue(stream.[[controller]], view).
- TRY(readable_byte_stream_controller_enqueue(realm, controller, view));
- }
-
- return {};
-}
-
// https://streams.spec.whatwg.org/#readablestream-current-byob-request-view
Optional<WebIDL::ArrayBufferView> ReadableStream::current_byob_request_view()
{
diff --git a/Libraries/LibWeb/Streams/ReadableStream.h b/Libraries/LibWeb/Streams/ReadableStream.h
index f3df5b61a90..864c44e24c6 100644
--- a/Libraries/LibWeb/Streams/ReadableStream.h
+++ b/Libraries/LibWeb/Streams/ReadableStream.h
@@ -105,7 +105,6 @@ public:
void set_result_realm(JS::Realm& realm) { m_result_realm = realm; }
WebIDL::ExceptionOr<GC::Ref<ReadableStreamDefaultReader>> get_a_reader();
- WebIDL::ExceptionOr<void> pull_from_bytes(ByteBuffer);
WebIDL::ExceptionOr<void> enqueue(JS::Value chunk);
void set_up_with_byte_reading_support(JS::Realm&, GC::Ptr<PullAlgorithm> = {}, GC::Ptr<CancelAlgorithm> = {}, double high_water_mark = 0);
GC::Ref<ReadableStream> piped_through(GC::Ref<TransformStream>, bool prevent_close = false, bool prevent_abort = false, bool prevent_cancel = false, GC::Ptr<DOM::AbortSignal> signal = {});
diff --git a/Libraries/LibWeb/VisualLines.cpp b/Libraries/LibWeb/VisualLines.cpp
index 678d5a35037..7816109c5c6 100644
--- a/Libraries/LibWeb/VisualLines.cpp
+++ b/Libraries/LibWeb/VisualLines.cpp
@@ -265,24 +265,6 @@ Optional<CursorLinePosition> cursor_position_at_visual_end(DOM::Text const& dom_
return CursorLinePosition { offset, affinity_for_offset_on_line(lines, lines.size() - 1, offset) };
}
-Optional<CursorLinePosition> cursor_position_on_first_line_closest_to(Layout::BegunRead const& read, DOM::Text const& dom_node, Optional<CSSPixels> inline_coordinate)
-{
- auto lines = visual_lines_with_up_to_date_layout(dom_node);
- if (lines.is_empty())
- return {};
- auto offset = offset_in_visual_line_closest_to_inline_coordinate(read, dom_node, lines.first(), inline_coordinate);
- return CursorLinePosition { offset, affinity_for_offset_on_line(lines, 0, offset) };
-}
-
-Optional<CursorLinePosition> cursor_position_on_last_line_closest_to(Layout::BegunRead const& read, DOM::Text const& dom_node, Optional<CSSPixels> inline_coordinate)
-{
- auto lines = visual_lines_with_up_to_date_layout(dom_node);
- if (lines.is_empty())
- return {};
- auto offset = offset_in_visual_line_closest_to_inline_coordinate(read, dom_node, lines.last(), inline_coordinate);
- return CursorLinePosition { offset, affinity_for_offset_on_line(lines, lines.size() - 1, offset) };
-}
-
size_t find_visual_line_start(DOM::Text const& dom_node, size_t offset, TextAffinity affinity)
{
auto lines = visual_lines_with_up_to_date_layout(dom_node);
diff --git a/Libraries/LibWeb/VisualLines.h b/Libraries/LibWeb/VisualLines.h
index 59b3b841c4b..2b5ec9c91ad 100644
--- a/Libraries/LibWeb/VisualLines.h
+++ b/Libraries/LibWeb/VisualLines.h
@@ -61,8 +61,6 @@ Optional<CSSPixels> cursor_inline_coordinate(Layout::BegunRead const&, DOM::Text
// coordinate). All return nothing for text with no rendered lines.
Optional<CursorLinePosition> cursor_position_at_visual_start(DOM::Text const&);
Optional<CursorLinePosition> cursor_position_at_visual_end(DOM::Text const&);
-Optional<CursorLinePosition> cursor_position_on_first_line_closest_to(Layout::BegunRead const&, DOM::Text const&, Optional<CSSPixels> inline_coordinate);
-Optional<CursorLinePosition> cursor_position_on_last_line_closest_to(Layout::BegunRead const&, DOM::Text const&, Optional<CSSPixels> inline_coordinate);
// Whether any position in the text renders as an empty visual line (between two consecutive newlines, or after a
diff --git a/Libraries/LibWeb/WebIDL/CallbackType.cpp b/Libraries/LibWeb/WebIDL/CallbackType.cpp
index c930b393df0..5b9058dfd3c 100644
--- a/Libraries/LibWeb/WebIDL/CallbackType.cpp
+++ b/Libraries/LibWeb/WebIDL/CallbackType.cpp
@@ -33,19 +33,4 @@ void CallbackType::visit_edges(Cell::Visitor& visitor)
visitor.visit(callback_context);
}
-// Non-standard function to aid in converting a user-provided function into a WebIDL::Callback. This is essentially
-// what the Bindings generator would do at compile time, but at runtime instead.
-JS::ThrowCompletionOr<GC::Ptr<CallbackType>> property_to_callback(JS::VM& vm, JS::Value value, JS::PropertyKey const& property_key, OperationReturnsPromise operation_returns_promise)
-{
- auto property = TRY(value.get(vm, property_key));
-
- if (property.is_undefined())
- return nullptr;
-
- if (!property.is_function())
- return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAFunction, property);
-
- return GC::Heap::the().allocate<CallbackType>(property.as_object(), HTML::incumbent_realm(), operation_returns_promise);
-}
-
}
diff --git a/Libraries/LibWeb/WebIDL/CallbackType.h b/Libraries/LibWeb/WebIDL/CallbackType.h
index 2815ab31509..11ff38a4fd5 100644
--- a/Libraries/LibWeb/WebIDL/CallbackType.h
+++ b/Libraries/LibWeb/WebIDL/CallbackType.h
@@ -39,6 +39,4 @@ private:
virtual void visit_edges(Cell::Visitor&) override;
};
-JS::ThrowCompletionOr<GC::Ptr<WebIDL::CallbackType>> property_to_callback(JS::VM& vm, JS::Value value, JS::PropertyKey const& property_key, WebIDL::OperationReturnsPromise);
-
}
diff --git a/Libraries/LibWeb/WebIDL/OverloadTypes.cpp b/Libraries/LibWeb/WebIDL/OverloadTypes.cpp
index b0119341fed..022f6a8320c 100644
--- a/Libraries/LibWeb/WebIDL/OverloadTypes.cpp
+++ b/Libraries/LibWeb/WebIDL/OverloadTypes.cpp
@@ -61,16 +61,6 @@ bool Type::is_typed_array() const
return m_name.is_one_of("Int8Array", "Int16Array", "Int32Array", "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray", "BigInt64Array", "BigUint64Array", "Float16Array", "Float32Array", "Float64Array");
}
-bool Type::is_buffer_view() const
-{
- return m_name == "DataView" || is_typed_array();
-}
-
-bool Type::is_buffer_source() const
-{
- return is_buffer() || is_buffer_view();
-}
-
Vector<NonnullRefPtr<Type const>> UnionType::flattened_member_types() const
{
Vector<NonnullRefPtr<Type const>> types;
diff --git a/Libraries/LibWeb/WebIDL/OverloadTypes.h b/Libraries/LibWeb/WebIDL/OverloadTypes.h
index d5e5e3794ba..f1ba82bcc68 100644
--- a/Libraries/LibWeb/WebIDL/OverloadTypes.h
+++ b/Libraries/LibWeb/WebIDL/OverloadTypes.h
@@ -73,8 +73,6 @@ public:
bool is_buffer() const;
bool is_typed_array() const;
- bool is_buffer_view() const;
- bool is_buffer_source() const;
bool is_restricted_floating_point() const { return m_name.is_one_of("float", "double"); }
bool is_unrestricted_floating_point() const { return m_name.is_one_of("unrestricted float", "unrestricted double"); }
diff --git a/Libraries/LibWeb/WebVTT/VTTCue.cpp b/Libraries/LibWeb/WebVTT/VTTCue.cpp
index a529d968815..1065ce0fca8 100644
--- a/Libraries/LibWeb/WebVTT/VTTCue.cpp
+++ b/Libraries/LibWeb/WebVTT/VTTCue.cpp
@@ -221,30 +221,4 @@ double VTTCue::computed_position()
return 50;
}
-// https://w3c.github.io/webvtt/#cue-computed-position-alignment
-PositionAlignSetting VTTCue::computed_position_alignment()
-{
- // 1. If the WebVTT cue position alignment is not auto, then return the value of the WebVTT cue position alignment and abort these
- // steps.
- if (m_position_alignment != PositionAlignSetting::Auto)
- return m_position_alignment;
-
- // 2. If the WebVTT cue text alignment is left, return line-left and abort these steps.
- if (m_text_alignment == AlignSetting::Left)
- return PositionAlignSetting::LineLeft;
-
- // 3. If the WebVTT cue text alignment is right, return line-right and abort these steps.
- if (m_text_alignment == AlignSetting::Right)
- return PositionAlignSetting::LineRight;
-
- // FIXME: 4. If the WebVTT cue text alignment is start, return line-left if the base direction of the cue text is left-to-right, line-right
- // otherwise.
-
- // FIXME: 5. If the WebVTT cue text alignment is end, return line-right if the base direction of the cue text is left-to-right, line-left
- // otherwise.
-
- // 6. Otherwise, return center.
- return PositionAlignSetting::Center;
-}
-
}
diff --git a/Libraries/LibWeb/WebVTT/VTTCue.h b/Libraries/LibWeb/WebVTT/VTTCue.h
index c7b2fbc491c..2c1157e08f5 100644
--- a/Libraries/LibWeb/WebVTT/VTTCue.h
+++ b/Libraries/LibWeb/WebVTT/VTTCue.h
@@ -76,7 +76,6 @@ public:
protected:
double computed_line();
double computed_position();
- PositionAlignSetting computed_position_alignment();
private:
VTTCue(GC::Ptr<HTML::TextTrack>);
diff --git a/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
index 7f22eb0fe08..ecec73ccabf 100644
--- a/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
+++ b/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
@@ -372,11 +372,6 @@ void XMLHttpRequest::set_blob_response_object(GC::Ref<FileAPI::Blob> blob)
m_cached_response_objects.clear();
}
-bool XMLHttpRequest::response_body_is_null() const
-{
- return !m_response->body();
-}
-
// https://xhr.spec.whatwg.org/#text-response
Utf16String XMLHttpRequest::get_text_response() const
{
diff --git a/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Libraries/LibWeb/XHR/XMLHttpRequest.h
index 9ad49c2379b..3c4811cd60d 100644
--- a/Libraries/LibWeb/XHR/XMLHttpRequest.h
+++ b/Libraries/LibWeb/XHR/XMLHttpRequest.h
@@ -102,7 +102,6 @@ public:
GC::Ref<XMLHttpRequestUpload> upload() const;
Utf16String get_text_response() const;
ByteBuffer const& received_bytes() const { return m_received_bytes; }
- bool response_body_is_null() const;
bool response_object_is_failure() const { return m_response_object.has<Failure>(); }
GC::Ptr<DOM::Document> response_document() const;
GC::Ptr<FileAPI::Blob> response_blob() const;
diff --git a/Libraries/LibWebCommon/HTML/EmbedderPolicy.cpp b/Libraries/LibWebCommon/HTML/EmbedderPolicy.cpp
index 36186a0c6f4..36acea03502 100644
--- a/Libraries/LibWebCommon/HTML/EmbedderPolicy.cpp
+++ b/Libraries/LibWebCommon/HTML/EmbedderPolicy.cpp
@@ -11,30 +11,6 @@
namespace Web::HTML {
-Utf16View embedder_policy_value_to_string(EmbedderPolicyValue embedder_policy_value)
-{
- switch (embedder_policy_value) {
- case EmbedderPolicyValue::UnsafeNone:
- return u"unsafe-none"sv;
- case EmbedderPolicyValue::RequireCorp:
- return u"require-corp"sv;
- case EmbedderPolicyValue::Credentialless:
- return u"credentialless"sv;
- }
- VERIFY_NOT_REACHED();
-}
-
-Optional<EmbedderPolicyValue> embedder_policy_value_from_string(Utf16View string)
-{
- if (string.equals_ignoring_ascii_case(u"unsafe-none"sv))
- return EmbedderPolicyValue::UnsafeNone;
- if (string.equals_ignoring_ascii_case(u"require-corp"sv))
- return EmbedderPolicyValue::RequireCorp;
- if (string.equals_ignoring_ascii_case(u"credentialless"sv))
- return EmbedderPolicyValue::Credentialless;
- return {};
-}
-
}
namespace IPC {
diff --git a/Libraries/LibWebCommon/HTML/EmbedderPolicy.h b/Libraries/LibWebCommon/HTML/EmbedderPolicy.h
index cc707110dff..449543777b0 100644
--- a/Libraries/LibWebCommon/HTML/EmbedderPolicy.h
+++ b/Libraries/LibWebCommon/HTML/EmbedderPolicy.h
@@ -22,9 +22,6 @@ enum class EmbedderPolicyValue : u8 {
Credentialless,
};
-WEBCOMMON_API Utf16View embedder_policy_value_to_string(EmbedderPolicyValue);
-WEBCOMMON_API Optional<EmbedderPolicyValue> embedder_policy_value_from_string(Utf16View);
-
// https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy
struct EmbedderPolicy {
// https://html.spec.whatwg.org/multipage/browsers.html#embedder-policy-value-2
diff --git a/Libraries/LibWebCommon/MimeSniff/MimeType.cpp b/Libraries/LibWebCommon/MimeSniff/MimeType.cpp
index 414d7f1f64f..f7e1a5c482e 100644
--- a/Libraries/LibWebCommon/MimeSniff/MimeType.cpp
+++ b/Libraries/LibWebCommon/MimeSniff/MimeType.cpp
@@ -539,24 +539,6 @@ bool MimeType::is_font() const
"application/vnd.ms-opentype"sv);
}
-// https://mimesniff.spec.whatwg.org/#zip-based-mime-type
-bool MimeType::is_zip_based() const
-{
- // A ZIP-based MIME type is any MIME type whose subtype ends in "+zip" or whose essence is one of the following:
- // - application/zip
- return subtype().ends_with_bytes("+zip"sv) || essence().is_one_of("application/zip"sv);
-}
-
-// https://mimesniff.spec.whatwg.org/#archive-mime-type
-bool MimeType::is_archive() const
-{
- // An archive MIME type is any MIME type whose essence is one of the following:
- // - application/x-rar-compressed
- // - application/zip
- // - application/x-gzip
- return essence().is_one_of("application/x-rar-compressed"sv, "application/zip"sv, "application/x-gzip"sv);
-}
-
// https://mimesniff.spec.whatwg.org/#xml-mime-type
bool MimeType::is_xml() const
{
@@ -571,13 +553,6 @@ bool MimeType::is_html() const
return essence().is_one_of("text/html"sv);
}
-// https://mimesniff.spec.whatwg.org/#scriptable-mime-type
-bool MimeType::is_scriptable() const
-{
- // A scriptable MIME type is an XML MIME type, HTML MIME type, or any MIME type whose essence is "application/pdf".
- return is_xml() || is_html() || essence() == "application/pdf"sv;
-}
-
// https://mimesniff.spec.whatwg.org/#javascript-mime-type
bool MimeType::is_javascript() const
{
diff --git a/Libraries/LibWebCommon/MimeSniff/MimeType.h b/Libraries/LibWebCommon/MimeSniff/MimeType.h
index 2ec9f39d24e..c6512ea640b 100644
--- a/Libraries/LibWebCommon/MimeSniff/MimeType.h
+++ b/Libraries/LibWebCommon/MimeSniff/MimeType.h
@@ -60,11 +60,8 @@ public:
bool is_image() const;
bool is_audio_or_video() const;
bool is_font() const;
- bool is_zip_based() const;
- bool is_archive() const;
bool is_xml() const;
bool is_html() const;
- bool is_scriptable() const;
bool is_javascript() const;
bool is_json() const;
diff --git a/Libraries/LibWebView/SessionStore.cpp b/Libraries/LibWebView/SessionStore.cpp
index 802a4e32554..e6544855073 100644
--- a/Libraries/LibWebView/SessionStore.cpp
+++ b/Libraries/LibWebView/SessionStore.cpp
@@ -351,17 +351,6 @@ void SessionStore::TransientStorage::mark_tab_flushed(SessionTabId tab_id, size_
tab->value.history.clear();
}
-Optional<SessionHistorySnapshot> SessionStore::TransientStorage::take_tab_history(SessionTabId tab_id)
-{
- auto tab = m_tabs.find(tab_id);
- if (tab == m_tabs.end())
- return {};
-
- auto history = move(tab->value.history);
- tab->value.history.clear();
- return history;
-}
-
void SessionStore::TransientStorage::set_active_tab(SessionTabId tab_id)
{
auto tab = m_tabs.find(tab_id);
diff --git a/Libraries/LibWebView/SessionStore.h b/Libraries/LibWebView/SessionStore.h
index d5eab3e2e0f..c035cbda2c4 100644
--- a/Libraries/LibWebView/SessionStore.h
+++ b/Libraries/LibWebView/SessionStore.h
@@ -356,7 +356,6 @@ private:
void set_tab_state(SessionTabId, Optional<SessionHistorySnapshot>, URL::URL, bool dirty);
void mark_tab_flushed(SessionTabId, size_t current_used_step_index);
- Optional<SessionHistorySnapshot> take_tab_history(SessionTabId);
void set_active_tab(SessionTabId);
void set_tab_order(SessionWindowId, Vector<SessionTabId> const&);
Optional<SessionWindowId> move_tab(SessionTabId, SessionWindowId, size_t ordinal);
diff --git a/Meta/Linters/check_libweb_realm_mentions.py b/Meta/Linters/check_libweb_realm_mentions.py
index 02a3321a6a5..50e463bee36 100755
--- a/Meta/Linters/check_libweb_realm_mentions.py
+++ b/Meta/Linters/check_libweb_realm_mentions.py
@@ -52,12 +52,12 @@ ALLOWED_REALM_MENTIONS = {
"FileAPI": (6, 11, "File/Blob/FileReader algorithms still create streams, buffers, and events in selected realms"),
"HTML": (
64,
- 202,
+ 200,
"HTML algorithms still contain structured serialization, including posted-message preparation, canvas, navigation transfer/reconstruction, worker/worklet, and event realm use, and cross-origin Window/Location property functions are created in the current realm; RemoteWindow mirrors Window's postMessage",
),
"IndexedDB": (
14,
- 100,
+ 92,
"IndexedDB requests/cursors/records still materialize structured-clone values in selected realms",
),
"Infra": (2, 13, "JSON parse/serialization helpers still expose JS values in selected realms"),
diff --git a/Services/AudioServer/PulseAudioWrappers.cpp b/Services/AudioServer/PulseAudioWrappers.cpp
index 60919baf3b6..105aa194d9c 100644
--- a/Services/AudioServer/PulseAudioWrappers.cpp
+++ b/Services/AudioServer/PulseAudioWrappers.cpp
@@ -743,11 +743,6 @@ ErrorOr<void> PulseAudioStream::cancel_write()
return {};
}
-bool PulseAudioStream::is_suspended() const
-{
- return m_suspended;
-}
-
StringView pulse_audio_error_to_string(PulseAudioErrorCode code)
{
if (code < PulseAudioErrorCode::OK || code >= PulseAudioErrorCode::Sentinel)
diff --git a/Services/AudioServer/PulseAudioWrappers.h b/Services/AudioServer/PulseAudioWrappers.h
index 2845066d12a..71644eaa970 100644
--- a/Services/AudioServer/PulseAudioWrappers.h
+++ b/Services/AudioServer/PulseAudioWrappers.h
@@ -125,7 +125,6 @@ public:
// Cancels the previous begin_write() call.
ErrorOr<void> cancel_write();
- bool is_suspended() const;
// Plays back all buffered data and corks the stream. Until resume() is called, no data
// will be written to the stream.
ErrorOr<void> drain_and_suspend();
diff --git a/Services/Compositor/CanvasHost.cpp b/Services/Compositor/CanvasHost.cpp
index c9c0941fb26..e75b4ade15d 100644
--- a/Services/Compositor/CanvasHost.cpp
+++ b/Services/Compositor/CanvasHost.cpp
@@ -152,11 +152,6 @@ void CanvasHost::destroy_context(Compositing::CanvasId canvas_id)
m_canvas_surface_registry.remove_canvas_surface(canvas_id);
}
-bool CanvasHost::has_context(Compositing::CanvasId canvas_id) const
-{
- return m_contexts.contains(canvas_id);
-}
-
CanvasHost::Context* CanvasHost::context(Compositing::CanvasId canvas_id)
{
auto it = m_contexts.find(canvas_id);
diff --git a/Services/Compositor/CanvasHost.h b/Services/Compositor/CanvasHost.h
index cb6a4d16302..d1a9bfe84fa 100644
--- a/Services/Compositor/CanvasHost.h
+++ b/Services/Compositor/CanvasHost.h
@@ -62,7 +62,6 @@ public:
bool create_2d_context(Compositing::CanvasId, Gfx::IntSize, bool alpha);
CreateWebGLContextResult create_webgl_context(Compositing::WebGL::WebGLVersion, Gfx::IntSize, bool depth, bool stencil, bool antialias);
void destroy_context(Compositing::CanvasId);
- bool has_context(Compositing::CanvasId) const;
void execute_canvas_2d_stream(Vector<Compositing::Canvas2DCommandStreamSegment> const&, Vector<Compositing::FontResourceId> const& kept_font_ids, Vector<Compositing::DisplayListFontResource> const& added_fonts, Vector<Compositing::DisplayListImageFrameResource> const& image_frames);
void execute_webgl_commands(Compositing::CanvasId, ReadonlyBytes, Vector<Compositing::WebGL::ImageSourceFrame> const&);
diff --git a/Tests/LibMedia/TestBufferedRanges.cpp b/Tests/LibMedia/TestBufferedRanges.cpp
index a21cdd42bb3..a2cb31d6ec6 100644
--- a/Tests/LibMedia/TestBufferedRanges.cpp
+++ b/Tests/LibMedia/TestBufferedRanges.cpp
@@ -100,11 +100,6 @@ static void expect_valid_ranges(Media::TimeRanges const& ranges)
}
}
-[[maybe_unused]] static bool nearly_greater_than_or_equal(AK::Duration lhs, AK::Duration rhs)
-{
- return rhs - lhs <= AK::Duration::from_microseconds(5);
-}
-
static void expect_complete_file_is_fully_buffered(Fixture const& fixture)
{
dbgln("-- '{}' fully buffered --", fixture.path);
diff --git a/UI/Qt/Conversions.h b/UI/Qt/Conversions.h
index a74c79d57a0..1a6c201a2c8 100644
--- a/UI/Qt/Conversions.h
+++ b/UI/Qt/Conversions.h
@@ -25,32 +25,9 @@ namespace Ladybird {
String ns_string_to_string(NSString*);
NSString* string_to_ns_string(StringView);
-Utf16String ns_string_to_utf16_string(NSString*);
-NSString* utf16_string_to_ns_string(Utf16View const&);
-
-ByteString ns_string_to_byte_string(NSString*);
-
-ByteString ns_data_to_string(NSData*);
NSData* string_to_ns_data(StringView);
-NSImage* image_from_png(ReadonlyBytes, NSSize size);
-
-NSDictionary* deserialize_json_to_dictionary(StringView);
-
-Gfx::IntRect ns_rect_to_gfx_rect(NSRect);
-NSRect gfx_rect_to_ns_rect(Gfx::IntRect);
-
-Gfx::IntSize ns_size_to_gfx_size(NSSize);
-NSSize gfx_size_to_ns_size(Gfx::IntSize);
-
-Gfx::IntPoint ns_point_to_gfx_point(NSPoint);
-NSPoint gfx_point_to_ns_point(Gfx::IntPoint);
Gfx::Color ns_color_to_gfx_color(NSColor*);
-NSColor* gfx_color_to_ns_color(Gfx::Color);
-
-Gfx::IntPoint compute_origin_relative_to_window(NSWindow*, Gfx::IntPoint);
-
-NSImage* gfx_bitmap_to_ns_image(Gfx::Bitmap const&);
NSURL* url_to_ns_url(URL::URL const&);
diff --git a/UI/Qt/Conversions.mm b/UI/Qt/Conversions.mm
index d400909d355..b289c604596 100644
--- a/UI/Qt/Conversions.mm
+++ b/UI/Qt/Conversions.mm
@@ -22,115 +22,11 @@ NSString* string_to_ns_string(StringView string)
return [[NSString alloc] initWithData:string_to_ns_data(string) encoding:NSUTF8StringEncoding];
}
-Utf16String ns_string_to_utf16_string(NSString* string)
-{
- // FIXME: There isn't a great way to get the underlying UTF-16 data from an NSString. There is [NSString getCharacters],
- // but that requires pre-allocated a separate buffer to hold the code units. We could add a macOS-only factory
- // to UTF-16 string to handle that, but it's tricky with inline and ASCII storage.
- auto const* utf8 = [string UTF8String];
- return Utf16String::from_utf8({ utf8, strlen(utf8) });
-}
-
-NSString* utf16_string_to_ns_string(Utf16View const& string)
-{
- if (string.has_ascii_storage())
- return string_to_ns_string(string.bytes());
-
- return [[NSString alloc] initWithCharacters:reinterpret_cast<unichar const*>(string.utf16_span().data())
- length:string.length_in_code_units()];
-}
-
-ByteString ns_string_to_byte_string(NSString* string)
-{
- auto const* utf8 = [string UTF8String];
- return ByteString(utf8, strlen(utf8));
-}
-
-ByteString ns_data_to_string(NSData* data)
-{
- return { reinterpret_cast<char const*>([data bytes]), [data length] };
-}
-
NSData* string_to_ns_data(StringView string)
{
return [NSData dataWithBytes:string.characters_without_null_termination() length:string.length()];
}
-NSImage* image_from_png(ReadonlyBytes bytes, NSSize size)
-{
- auto* data = [NSData dataWithBytes:bytes.data()
- length:bytes.size()];
- auto* image = [[NSImage alloc] initWithData:data];
- [image setSize:size];
- return image;
-}
-
-NSDictionary* deserialize_json_to_dictionary(StringView json)
-{
- auto* ns_json = string_to_ns_string(json);
- auto* json_data = [ns_json dataUsingEncoding:NSUTF8StringEncoding];
-
- NSError* error = nil;
- NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:json_data
- options:0
- error:&error];
-
- if (!dictionary) {
- NSLog(@"Error deserializing DOM tree: %@", error);
- }
-
- return dictionary;
-}
-
-Gfx::IntRect ns_rect_to_gfx_rect(NSRect rect)
-{
- return {
- static_cast<int>(rect.origin.x),
- static_cast<int>(rect.origin.y),
- static_cast<int>(rect.size.width),
- static_cast<int>(rect.size.height),
- };
-}
-
-NSRect gfx_rect_to_ns_rect(Gfx::IntRect rect)
-{
- return NSMakeRect(
- static_cast<CGFloat>(rect.x()),
- static_cast<CGFloat>(rect.y()),
- static_cast<CGFloat>(rect.width()),
- static_cast<CGFloat>(rect.height()));
-}
-
-Gfx::IntSize ns_size_to_gfx_size(NSSize size)
-{
- return {
- static_cast<int>(size.width),
- static_cast<int>(size.height),
- };
-}
-
-NSSize gfx_size_to_ns_size(Gfx::IntSize size)
-{
- return NSMakeSize(
- static_cast<CGFloat>(size.width()),
- static_cast<CGFloat>(size.height()));
-}
-
-Gfx::IntPoint ns_point_to_gfx_point(NSPoint point)
-{
- return {
- static_cast<int>(point.x),
- static_cast<int>(point.y),
- };
-}
-
-NSPoint gfx_point_to_ns_point(Gfx::IntPoint point)
-{
- return NSMakePoint(
- static_cast<CGFloat>(point.x()),
- static_cast<CGFloat>(point.y()));
-}
-
Gfx::Color ns_color_to_gfx_color(NSColor* color)
{
auto rgb_color = [color colorUsingColorSpace:NSColorSpace.genericRGBColorSpace];
@@ -144,37 +40,6 @@ Gfx::Color ns_color_to_gfx_color(NSColor* color)
return {};
}
-NSColor* gfx_color_to_ns_color(Gfx::Color color)
-{
- return [NSColor colorWithRed:(color.red() / 255.f)
- green:(color.green() / 255.f)
- blue:(color.blue() / 255.f)
- alpha:(color.alpha() / 255.f)];
-}
-
-Gfx::IntPoint compute_origin_relative_to_window(NSWindow* window, Gfx::IntPoint position)
-{
- // The origin of the NSWindow is its bottom-left corner, relative to the bottom-left of the screen. We must convert
- // window positions sent to/from WebContent between this origin and the window's and screen's top-left corners.
- auto screen_frame = Ladybird::ns_rect_to_gfx_rect([[window screen] frame]);
- auto window_frame = Ladybird::ns_rect_to_gfx_rect([window frame]);
-
- position.set_y(screen_frame.height() - window_frame.height() - position.y());
- return position;
-}
-
-NSImage* gfx_bitmap_to_ns_image(Gfx::Bitmap const& bitmap)
-{
- auto png = Gfx::PNGWriter::encode(bitmap);
- if (png.is_error())
- return nullptr;
-
- auto* data = [NSData dataWithBytes:png.value().data()
- length:png.value().size()];
-
- return [[NSImage alloc] initWithData:data];
-}
-
NSURL* url_to_ns_url(URL::URL const& url)
{
auto serialized_url = url.serialize();
diff --git a/UI/Qt/MacWindow.h b/UI/Qt/MacWindow.h
index 25f6a5c210f..93d8e199441 100644
--- a/UI/Qt/MacWindow.h
+++ b/UI/Qt/MacWindow.h
@@ -36,8 +36,6 @@ void make_appkit_window_first_responder(QWidget&);
bool start_appkit_window_drag(QWidget&);
Qt::DropAction execute_appkit_tab_drag(QWidget&, QDrag&);
void show_appkit_dictionary_lookup(QWidget&, WebView::DictionaryLookup const&, Gfx::IntPoint);
-Gfx::Color appkit_web_inactive_selection_color();
-Gfx::Color appkit_web_inactive_selection_text_color();
#endif
}
diff --git a/UI/Qt/MacWindow.mm b/UI/Qt/MacWindow.mm
index ff69e1a30df..a625d4953c9 100644
--- a/UI/Qt/MacWindow.mm
+++ b/UI/Qt/MacWindow.mm
@@ -139,19 +139,6 @@ namespace Ladybird {
static NSEvent* s_latest_window_drag_event;
static NSInteger s_last_pressure_stage;
-static Gfx::Color ns_color_to_gfx_color(NSColor* color)
-{
- auto* rgb_color = [color colorUsingColorSpace:NSColorSpace.genericRGBColorSpace];
- if (rgb_color != nil)
- return {
- static_cast<u8>([rgb_color redComponent] * 255),
- static_cast<u8>([rgb_color greenComponent] * 255),
- static_cast<u8>([rgb_color blueComponent] * 255),
- static_cast<u8>([rgb_color alphaComponent] * 255)
- };
- return {};
-}
-
static bool is_window_drag_on_gesture_enabled()
{
return [[NSUserDefaults standardUserDefaults] boolForKey:@"NSWindowShouldDragOnGesture"];
@@ -532,14 +519,4 @@ void show_appkit_dictionary_lookup(QWidget& widget, WebView::DictionaryLookup co
show_dictionary_lookup(view, lookup, widget_position_to_ns_point(widget, position));
}
-Gfx::Color appkit_web_inactive_selection_color()
-{
- return ns_color_to_gfx_color([NSColor unemphasizedSelectedTextBackgroundColor]);
-}
-
-Gfx::Color appkit_web_inactive_selection_text_color()
-{
- return ns_color_to_gfx_color([NSColor unemphasizedSelectedTextColor]);
-}
-
}
diff --git a/UI/Qt/StringUtils.cpp b/UI/Qt/StringUtils.cpp
index 34b23c485b6..65553ca36a6 100644
--- a/UI/Qt/StringUtils.cpp
+++ b/UI/Qt/StringUtils.cpp
@@ -55,12 +55,6 @@ QByteArray qbytearray_from_ak_string(StringView ak_string)
return { ak_string.characters_without_null_termination(), static_cast<qsizetype>(ak_string.length()) };
}
-Optional<URL::URL> ak_url_from_qstring(QString const& qstring)
-{
- auto utf8_data = qstring.toUtf8();
- return URL::Parser::basic_parse(StringView(utf8_data.data(), utf8_data.size()));
-}
-
URL::URL ak_url_from_qurl(QUrl const& qurl)
{
auto encoded_url = qurl.toEncoded();
diff --git a/UI/Qt/StringUtils.h b/UI/Qt/StringUtils.h
index 5db1a2ab0ad..88f7a31232a 100644
--- a/UI/Qt/StringUtils.h
+++ b/UI/Qt/StringUtils.h
@@ -40,7 +40,6 @@ QString qformatted(CheckedFormatString<Parameters...>&& format, Parameters const
QByteArray qbytearray_from_ak_string(StringView);
-Optional<URL::URL> ak_url_from_qstring(QString const&);
URL::URL ak_url_from_qurl(QUrl const&);
namespace AK {
diff --git a/UI/Qt/TabBar.cpp b/UI/Qt/TabBar.cpp
index 52f340a1747..41d511bce18 100644
--- a/UI/Qt/TabBar.cpp
+++ b/UI/Qt/TabBar.cpp
@@ -2408,13 +2408,6 @@ void TabWidget::accept_tab_drop(QDropEvent* event, int index)
event->accept();
}
-QRect TabWidget::tab_strip_global_rect() const
-{
- if (auto* widget = tab_drag_area_widget())
- return { widget->mapToGlobal(QPoint(0, 0)), widget->size() };
- return {};
-}
-
TabLayout TabWidget::current_tab_layout() const
{
if (!m_vertical_tabs_enabled)
diff --git a/UI/Qt/TabBar.h b/UI/Qt/TabBar.h
index f78ab68bafd..a617c9b52f8 100644
--- a/UI/Qt/TabBar.h
+++ b/UI/Qt/TabBar.h
@@ -183,7 +183,6 @@ public:
TabBar* tab_bar() const { return m_tab_bar; }
QWidget* tab_bar_row() const { return m_tab_bar_row; }
- QRect tab_strip_global_rect() const;
void add_tab(Tab* widget, QString const& label);
void insert_tab(int index, Tab* widget, QString const& label);