diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 753945589ba..7c19fe41738 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -2383,6 +2383,13 @@ ErrorOr Node::name_or_description(NameOrDescription target, Document con if (is(*element)) { auto& input = (const_cast(static_cast(*element))); // https://w3c.github.io/html-aam/#input-type-image-accessible-name-computation + // Otherwise use the value attribute. + if (input.type_state() == HTML::HTMLInputElement::TypeAttributeState::Button + || input.type_state() == HTML::HTMLInputElement::TypeAttributeState::SubmitButton + || input.type_state() == HTML::HTMLInputElement::TypeAttributeState::ResetButton) + if (auto value = input.get_attribute(HTML::AttributeNames::value); value.has_value()) + return value.value(); + // https://w3c.github.io/html-aam/#input-type-image-accessible-name-computation // Otherwise use alt attribute if present and its value is not the empty string. if (input.type_state() == HTML::HTMLInputElement::TypeAttributeState::ImageButton) if (auto alt = element->get_attribute(HTML::AttributeNames::alt); alt.has_value())