mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:45:07 +00:00
LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/). This allows us to stay closer to the spec with function names and don't have to add the word "ARIA" to identifiers constantly - the namespace now provides that clarity.
This commit is contained in:
parent
8414734a2d
commit
8556d47240
61 changed files with 179 additions and 180 deletions
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibWeb/ARIA/Roles.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/DOM/ARIARoles.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
|
@ -204,14 +204,14 @@ bool HTMLImageElement::complete() const
|
|||
return false;
|
||||
}
|
||||
|
||||
Optional<DOM::ARIARoles::Role> HTMLImageElement::default_role() const
|
||||
Optional<ARIA::Role> 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::ARIARoles::Role::img;
|
||||
return ARIA::Role::img;
|
||||
// https://www.w3.org/TR/html-aria/#el-img-empty-alt
|
||||
return DOM::ARIARoles::Role::presentation;
|
||||
return ARIA::Role::presentation;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue