MathMLElement.h 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2023, Jonah Shafran <jonahshafran@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/Element.h>
  8. #include <LibWeb/HTML/DOMStringMap.h>
  9. #include <LibWeb/HTML/GlobalEventHandlers.h>
  10. namespace Web::MathML {
  11. class MathMLElement : public DOM::Element
  12. , public HTML::GlobalEventHandlers {
  13. WEB_PLATFORM_OBJECT(MathMLElement, DOM::Element);
  14. JS_DECLARE_ALLOCATOR(MathMLElement);
  15. public:
  16. virtual ~MathMLElement() override;
  17. [[nodiscard]] JS::NonnullGCPtr<HTML::DOMStringMap> dataset();
  18. virtual Optional<ARIA::Role> default_role() const override;
  19. void focus();
  20. void blur();
  21. protected:
  22. virtual JS::GCPtr<DOM::EventTarget> global_event_handlers_to_event_target(FlyString const&) override { return *this; }
  23. private:
  24. MathMLElement(DOM::Document&, DOM::QualifiedName);
  25. virtual void visit_edges(Visitor&) override;
  26. virtual void initialize(JS::Realm&) override;
  27. JS::GCPtr<HTML::DOMStringMap> m_dataset;
  28. };
  29. }