mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 07:24: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:
parent
0a244b9c1f
commit
e63d9d4925
57 changed files with 976 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/DOM/ARIARoleNames.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
|
@ -197,4 +198,14 @@ bool HTMLImageElement::complete() const
|
|||
return false;
|
||||
}
|
||||
|
||||
FlyString HTMLImageElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-img
|
||||
// https://www.w3.org/TR/html-aria/#el-img-no-alt
|
||||
if (alt().is_null() || !alt().is_empty())
|
||||
return DOM::ARIARoleNames::img;
|
||||
// https://www.w3.org/TR/html-aria/#el-img-empty-alt
|
||||
return DOM::ARIARoleNames::presentation;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue