HTMLModElement.cpp 938 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/Assertions.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/HTML/HTMLModElement.h>
  9. namespace Web::HTML {
  10. JS_DEFINE_ALLOCATOR(HTMLModElement);
  11. HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  12. : HTMLElement(document, move(qualified_name))
  13. {
  14. }
  15. HTMLModElement::~HTMLModElement() = default;
  16. void HTMLModElement::initialize(JS::Realm& realm)
  17. {
  18. Base::initialize(realm);
  19. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLModElement);
  20. }
  21. Optional<ARIA::Role> HTMLModElement::default_role() const
  22. {
  23. // https://www.w3.org/TR/html-aria/#el-del
  24. if (local_name() == TagNames::del)
  25. return ARIA::Role::deletion;
  26. // https://www.w3.org/TR/html-aria/#el-ins
  27. if (local_name() == TagNames::ins)
  28. return ARIA::Role::insertion;
  29. VERIFY_NOT_REACHED();
  30. }
  31. }