mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-21 15:14:13 +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/HTMLAreaElement.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
@@ -42,4 +43,13 @@ i32 HTMLAreaElement::default_tab_index_value() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
FlyString HTMLAreaElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-area-no-href
|
||||
if (!href().is_null())
|
||||
return DOM::ARIARoleNames::link;
|
||||
// https://www.w3.org/TR/html-aria/#el-area
|
||||
return DOM::ARIARoleNames::generic;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user