1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -13,12 +13,12 @@
namespace Web::DOM {
JS::NonnullGCPtr<Attr> Attr::create(Document& document, FlyString local_name, String value, Element const* owner_element)
JS::NonnullGCPtr<Attr> Attr::create(Document& document, FlyString local_name, DeprecatedString value, Element const* owner_element)
{
return *document.heap().allocate<Attr>(document.realm(), document, move(local_name), move(value), owner_element);
}
Attr::Attr(Document& document, FlyString local_name, String value, Element const* owner_element)
Attr::Attr(Document& document, FlyString local_name, DeprecatedString value, Element const* owner_element)
: Node(document, NodeType::ATTRIBUTE_NODE)
, m_qualified_name(move(local_name), {}, {})
, m_value(move(value))
@ -49,7 +49,7 @@ void Attr::set_owner_element(Element const* owner_element)
}
// https://dom.spec.whatwg.org/#set-an-existing-attribute-value
void Attr::set_value(String value)
void Attr::set_value(DeprecatedString value)
{
// 1. If attributes element is null, then set attributes value to value.
if (!owner_element()) {
@ -67,7 +67,7 @@ void Attr::set_value(String value)
}
// https://dom.spec.whatwg.org/#handle-attribute-changes
void Attr::handle_attribute_changes(Element& element, String const& old_value, [[maybe_unused]] String const& new_value)
void Attr::handle_attribute_changes(Element& element, DeprecatedString const& old_value, [[maybe_unused]] DeprecatedString const& new_value)
{
// 1. Queue a mutation record of "attributes" for element with attributes local name, attributes namespace, oldValue, « », « », null, and null.
element.queue_mutation_record(MutationType::attributes, local_name(), namespace_uri(), old_value, StaticNodeList::create(realm(), {}), StaticNodeList::create(realm(), {}), nullptr, nullptr);