1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -226,7 +226,7 @@ WebIDL::ExceptionOr<BrowsingContext::BrowsingContextAndDocument> BrowsingContext
// 15. If creator is non-null, then:
if (creator) {
// 1. Set document's referrer to the serialization of creator's URL.
document->set_referrer(MUST(String::from_deprecated_string(creator->url().serialize())));
document->set_referrer(MUST(String::from_byte_string(creator->url().serialize())));
// FIXME: 2. Set document's policy container to a clone of creator's policy container.
@ -412,7 +412,7 @@ void BrowsingContext::set_cursor_position(JS::NonnullGCPtr<DOM::Position> positi
reset_cursor_blink_cycle();
}
static DeprecatedString visible_text_in_range(DOM::Range const& range)
static ByteString visible_text_in_range(DOM::Range const& range)
{
// NOTE: This is an adaption of Range stringification, but we skip over DOM nodes that don't have a corresponding layout node.
StringBuilder builder;
@ -420,7 +420,7 @@ static DeprecatedString visible_text_in_range(DOM::Range const& range)
if (range.start_container() == range.end_container() && is<DOM::Text>(*range.start_container())) {
if (!range.start_container()->layout_node())
return ""sv;
return MUST(static_cast<DOM::Text const&>(*range.start_container()).data().substring_from_byte_offset(range.start_offset(), range.end_offset() - range.start_offset())).to_deprecated_string();
return MUST(static_cast<DOM::Text const&>(*range.start_container()).data().substring_from_byte_offset(range.start_offset(), range.end_offset() - range.start_offset())).to_byte_string();
}
if (is<DOM::Text>(*range.start_container()) && range.start_container()->layout_node())
@ -434,10 +434,10 @@ static DeprecatedString visible_text_in_range(DOM::Range const& range)
if (is<DOM::Text>(*range.end_container()) && range.end_container()->layout_node())
builder.append(static_cast<DOM::Text const&>(*range.end_container()).data().bytes_as_string_view().substring_view(0, range.end_offset()));
return builder.to_deprecated_string();
return builder.to_byte_string();
}
DeprecatedString BrowsingContext::selected_text() const
ByteString BrowsingContext::selected_text() const
{
auto* document = active_document();
if (!document)