LibWeb: Space-separate parts of multi-label accessible names

This change ensures that when an accessible name is computed from
multiple labels, the parts computed from each label are separated by
spaces. Otherwise, without this change, the parts are run together in
the accessible name, with no space in between.
This commit is contained in:
sideshowbarker 2024-12-26 13:47:41 +09:00 committed by Tim Ledbetter
commit 062e33438e
Notes: github-actions[bot] 2024-12-26 20:45:13 +00:00
3 changed files with 11 additions and 3 deletions

View file

@ -2425,6 +2425,8 @@ ErrorOr<String> Node::name_or_description(NameOrDescription target, Document con
if (labels != nullptr && labels->length() > 0) {
StringBuilder builder;
for (u32 i = 0; i < labels->length(); i++) {
if (!builder.is_empty())
builder.append(" "sv);
auto nodes = labels->item(i)->children_as_vector();
for (auto const& node : nodes) {
// AD-HOC: https://wpt.fyi/results/accname/name/comp_host_language_label.html has “encapsulation”