1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:45:09 +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:
Linus Groh 2023-01-28 22:23:16 +00:00
parent 8414734a2d
commit 8556d47240
61 changed files with 179 additions and 180 deletions

View file

@ -5,8 +5,8 @@
*/
#include <AK/Assertions.h>
#include <LibWeb/ARIA/Roles.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/ARIARoles.h>
#include <LibWeb/HTML/HTMLQuoteElement.h>
namespace Web::HTML {
@ -26,14 +26,14 @@ JS::ThrowCompletionOr<void> HTMLQuoteElement::initialize(JS::Realm& realm)
return {};
}
Optional<DOM::ARIARoles::Role> HTMLQuoteElement::default_role() const
Optional<ARIA::Role> HTMLQuoteElement::default_role() const
{
// https://www.w3.org/TR/html-aria/#el-blockquote
if (local_name() == TagNames::blockquote)
return DOM::ARIARoles::Role::blockquote;
return ARIA::Role::blockquote;
// https://www.w3.org/TR/html-aria/#el-q
if (local_name() == TagNames::q)
return DOM::ARIARoles::Role::generic;
return ARIA::Role::generic;
VERIFY_NOT_REACHED();
}