mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Derive implicit aria-level for h1–h6 from tag name
This commit is contained in:
parent
d7f830cdd1
commit
c6b289c3dc
Notes:
github-actions[bot]
2025-10-10 16:19:11 +00:00
Author: https://github.com/Dowsley 🔰
Commit: c6b289c3dc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6256
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 40 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
|
||||
String get_computed_role(DOM::Element& element);
|
||||
String get_computed_label(DOM::Element& element);
|
||||
String get_computed_aria_level(DOM::Element& element);
|
||||
|
||||
static u16 get_echo_server_port();
|
||||
static void set_echo_server_port(u16 port);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ interface Internals {
|
|||
|
||||
DOMString getComputedRole(Element element);
|
||||
DOMString getComputedLabel(Element element);
|
||||
DOMString getComputedAriaLevel(Element element);
|
||||
unsigned short getEchoServerPort();
|
||||
|
||||
undefined setBrowserZoom(double factor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue