mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +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:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/DocumentFragment.h>
|
||||
|
@ -14,7 +14,7 @@
|
|||
namespace Web::DOM {
|
||||
|
||||
// https://dom.spec.whatwg.org/#converting-nodes-into-a-node
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<Variant<JS::Handle<Node>, String>> const& nodes, DOM::Document& document)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes, DOM::Document& document)
|
||||
{
|
||||
// 1. Let node be null.
|
||||
// 2. Replace each string in nodes with a new Text node whose data is the string and node document is document.
|
||||
|
@ -22,11 +22,11 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<
|
|||
// 4. Otherwise, set node to a new DocumentFragment node whose node document is document, and then append each node in nodes, if any, to it.
|
||||
// 5. Return node.
|
||||
|
||||
auto potentially_convert_string_to_text_node = [&document](Variant<JS::Handle<Node>, String> const& node) -> JS::NonnullGCPtr<Node> {
|
||||
auto potentially_convert_string_to_text_node = [&document](Variant<JS::Handle<Node>, DeprecatedString> const& node) -> JS::NonnullGCPtr<Node> {
|
||||
if (node.has<JS::Handle<Node>>())
|
||||
return *node.get<JS::Handle<Node>>();
|
||||
|
||||
return *document.heap().allocate<DOM::Text>(document.realm(), document, node.get<String>());
|
||||
return *document.heap().allocate<DOM::Text>(document.realm(), document, node.get<DeprecatedString>());
|
||||
};
|
||||
|
||||
if (nodes.size() == 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue