mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +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:
parent
0a244b9c1f
commit
e63d9d4925
57 changed files with 976 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/ARIARoleNames.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -18,6 +19,14 @@ public:
|
|||
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-h1-h6
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::heading; }
|
||||
virtual DeprecatedString aria_level() const override
|
||||
{
|
||||
// TODO: aria-level = the number in the element's tag name
|
||||
return get_attribute("aria-level");
|
||||
}
|
||||
|
||||
private:
|
||||
HTMLHeadingElement(DOM::Document&, DOM::QualifiedName);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue