diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 88db05910f8..02528ac3d75 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -2472,62 +2472,6 @@ Optional Node::first_valid_id(StringView value, Document const& docu return {}; } -// https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te -ErrorOr Node::append_without_space(StringBuilder x, StringView const& result) -{ - // - If X is empty, copy the result to X. - // - If X is non-empty, copy the result to the end of X. - TRY(x.try_append(result)); - return {}; -} - -// https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te -ErrorOr Node::append_with_space(StringBuilder x, StringView const& result) -{ - // - If X is empty, copy the result to X. - if (x.is_empty()) { - TRY(x.try_append(result)); - } else { - // - If X is non-empty, add a space to the end of X and then copy the result to X after the space. - TRY(x.try_append(" "sv)); - TRY(x.try_append(result)); - } - return {}; -} - -// https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te -ErrorOr Node::prepend_without_space(StringBuilder x, StringView const& result) -{ - // - If X is empty, copy the result to X. - if (x.is_empty()) { - x.append(result); - } else { - // - If X is non-empty, copy the result to the start of X. - auto temp = TRY(x.to_string()); - x.clear(); - TRY(x.try_append(result)); - TRY(x.try_append(temp)); - } - return {}; -} - -// https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te -ErrorOr Node::prepend_with_space(StringBuilder x, StringView const& result) -{ - // - If X is empty, copy the result to X. - if (x.is_empty()) { - TRY(x.try_append(result)); - } else { - // - If X is non-empty, copy the result to the start of X, and add a space after the copy. - auto temp = TRY(x.to_string()); - x.clear(); - TRY(x.try_append(result)); - TRY(x.try_append(" "sv)); - TRY(x.try_append(temp)); - } - return {}; -} - void Node::add_registered_observer(RegisteredObserver& registered_observer) { if (!m_registered_observer_list) diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index da2dc15cb40..7859b9d6d49 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -795,10 +795,6 @@ private: void remove_child_impl(JS::NonnullGCPtr); static Optional first_valid_id(StringView, Document const&); - static ErrorOr append_without_space(StringBuilder, StringView const&); - static ErrorOr append_with_space(StringBuilder, StringView const&); - static ErrorOr prepend_without_space(StringBuilder, StringView const&); - static ErrorOr prepend_with_space(StringBuilder, StringView const&); JS::GCPtr m_parent; JS::GCPtr m_first_child;