MathMLElement.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. MathMLElement::~MathMLElement() = default;
  11. MathMLElement::MathMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  12. : DOM::Element(document, move(qualified_name))
  13. {
  14. }
  15. void MathMLElement::initialize(JS::Realm& realm)
  16. {
  17. Base::initialize(realm);
  18. set_prototype(&Bindings::ensure_web_prototype<Bindings::MathMLElementPrototype>(realm, "MathMLElement"));
  19. m_dataset = HTML::DOMStringMap::create(*this);
  20. }
  21. Optional<ARIA::Role> MathMLElement::default_role() const
  22. {
  23. // https://www.w3.org/TR/html-aria/#el-math
  24. if (local_name() == TagNames::math)
  25. return ARIA::Role::math;
  26. return {};
  27. }
  28. void MathMLElement::focus()
  29. {
  30. dbgln("(STUBBED) MathMLElement::focus()");
  31. }
  32. void MathMLElement::blur()
  33. {
  34. dbgln("(STUBBED) MathMLElement::blur()");
  35. }
  36. }