HTMLModElement.cpp 959 B

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