MathMLElement.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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, Element);
  14. JS_DECLARE_ALLOCATOR(MathMLElement);
  15. public:
  16. virtual ~MathMLElement() override;
  17. HTML::DOMStringMap* dataset() { return m_dataset.ptr(); }
  18. HTML::DOMStringMap const* dataset() const { return m_dataset.ptr(); }
  19. virtual Optional<ARIA::Role> default_role() const override;
  20. void focus();
  21. void blur();
  22. protected:
  23. virtual JS::GCPtr<DOM::EventTarget> global_event_handlers_to_event_target(FlyString const&) override { return *this; }
  24. private:
  25. MathMLElement(DOM::Document&, DOM::QualifiedName);
  26. virtual void initialize(JS::Realm&) override;
  27. JS::GCPtr<HTML::DOMStringMap> m_dataset;
  28. };
  29. }