mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +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:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/DOM/ARIARoleNames.h>
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/HTMLOptGroupElement.h>
|
||||
@@ -140,4 +141,11 @@ bool HTMLOptionElement::disabled() const
|
||||
|| (parent() && is<HTMLOptGroupElement>(parent()) && static_cast<HTMLOptGroupElement const&>(*parent()).has_attribute(AttributeNames::disabled));
|
||||
}
|
||||
|
||||
FlyString HTMLOptionElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-option
|
||||
// TODO: Only an option element that is in a list of options or that represents a suggestion in a datalist should return option
|
||||
return DOM::ARIARoleNames::option;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user