mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibWeb: Add Support for the ARIA Element Properties
Element now supports getting and setting ARIA properties from JS and HTML.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/DOM/ARIARoleNames.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
@@ -84,4 +85,13 @@ i32 HTMLAnchorElement::default_tab_index_value() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
FlyString HTMLAnchorElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-a-no-href
|
||||
if (!href().is_null())
|
||||
return DOM::ARIARoleNames::link;
|
||||
// https://www.w3.org/TR/html-aria/#el-a
|
||||
return DOM::ARIARoleNames::generic;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user