LibWeb: Remove unused append_with_space etc functions from DOM::Node
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This change removes the append_without_space, append_with_space,
prepend_without_space, and prepend_with_space functions from DOM::Node.

All those methods were added with the initial “Implement Accessible Name
and Description Calculation” commit in da5c918 and were only used in the
code related to accessible-name computation. But subsequent changes to
that code have removed all the calls to those functions — so now they’re
all completely unused.
This commit is contained in:
sideshowbarker 2024-11-06 18:02:10 +09:00 committed by Andrew Kaster
parent eed20ad951
commit 55b19c3177
Notes: github-actions[bot] 2024-11-11 21:57:43 +00:00
2 changed files with 0 additions and 60 deletions

View file

@ -2472,62 +2472,6 @@ Optional<StringView> Node::first_valid_id(StringView value, Document const& docu
return {};
}
// https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te
ErrorOr<void> 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<void> 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<void> 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<void> 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)

View file

@ -795,10 +795,6 @@ private:
void remove_child_impl(JS::NonnullGCPtr<Node>);
static Optional<StringView> first_valid_id(StringView, Document const&);
static ErrorOr<void> append_without_space(StringBuilder, StringView const&);
static ErrorOr<void> append_with_space(StringBuilder, StringView const&);
static ErrorOr<void> prepend_without_space(StringBuilder, StringView const&);
static ErrorOr<void> prepend_with_space(StringBuilder, StringView const&);
JS::GCPtr<Node> m_parent;
JS::GCPtr<Node> m_first_child;