LibWeb: Derive implicit aria-level for h1–h6 from tag name

This commit is contained in:
Dowsley 2025-10-10 08:25:49 -07:00 committed by Sam Atkins
parent d7f830cdd1
commit c6b289c3dc
Notes: github-actions[bot] 2025-10-10 16:19:11 +00:00
6 changed files with 40 additions and 2 deletions

View file

@ -9,6 +9,8 @@
#include <LibJS/Runtime/Date.h>
#include <LibJS/Runtime/VM.h>
#include <LibUnicode/TimeZone.h>
#include <LibWeb/ARIA/AriaData.h>
#include <LibWeb/ARIA/StateAndProperties.h>
#include <LibWeb/Bindings/InternalsPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Document.h>
@ -308,6 +310,12 @@ String Internals::get_computed_label(DOM::Element& element)
return MUST(element.accessible_name(active_document));
}
String Internals::get_computed_aria_level(DOM::Element& element)
{
auto aria_data = MUST(ARIA::AriaData::build_data(element));
return MUST(ARIA::state_or_property_to_string_value(ARIA::StateAndProperties::AriaLevel, *aria_data));
}
u16 Internals::get_echo_server_port()
{
return s_echo_server_port;