HTMLModElement.cpp 991 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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/HTMLModElementPrototype.h>
  8. #include <LibWeb/Bindings/Intrinsics.h>
  9. #include <LibWeb/HTML/HTMLModElement.h>
  10. namespace Web::HTML {
  11. GC_DEFINE_ALLOCATOR(HTMLModElement);
  12. HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  13. : HTMLElement(document, move(qualified_name))
  14. {
  15. }
  16. HTMLModElement::~HTMLModElement() = default;
  17. void HTMLModElement::initialize(JS::Realm& realm)
  18. {
  19. Base::initialize(realm);
  20. WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLModElement);
  21. }
  22. Optional<ARIA::Role> HTMLModElement::default_role() const
  23. {
  24. // https://www.w3.org/TR/html-aria/#el-del
  25. if (local_name() == TagNames::del)
  26. return ARIA::Role::deletion;
  27. // https://www.w3.org/TR/html-aria/#el-ins
  28. if (local_name() == TagNames::ins)
  29. return ARIA::Role::insertion;
  30. VERIFY_NOT_REACHED();
  31. }
  32. }