MathMLElement.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2023, Jonah Shafran <jonahshafran@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/ExceptionOrUtils.h>
  7. #include <LibWeb/MathML/MathMLElement.h>
  8. #include <LibWeb/MathML/TagNames.h>
  9. namespace Web::MathML {
  10. JS_DEFINE_ALLOCATOR(MathMLElement);
  11. MathMLElement::~MathMLElement() = default;
  12. MathMLElement::MathMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  13. : DOM::Element(document, move(qualified_name))
  14. {
  15. }
  16. void MathMLElement::initialize(JS::Realm& realm)
  17. {
  18. Base::initialize(realm);
  19. WEB_SET_PROTOTYPE_FOR_INTERFACE(MathMLElement);
  20. m_dataset = HTML::DOMStringMap::create(*this);
  21. }
  22. Optional<ARIA::Role> MathMLElement::default_role() const
  23. {
  24. // https://www.w3.org/TR/html-aria/#el-math
  25. if (local_name() == TagNames::math)
  26. return ARIA::Role::math;
  27. return {};
  28. }
  29. void MathMLElement::focus()
  30. {
  31. dbgln("(STUBBED) MathMLElement::focus()");
  32. }
  33. void MathMLElement::blur()
  34. {
  35. dbgln("(STUBBED) MathMLElement::blur()");
  36. }
  37. }