MathMLElement.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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/GlobalEventHandlers.h>
  9. #include <LibWeb/HTML/HTMLOrSVGElement.h>
  10. namespace Web::MathML {
  11. class MathMLElement : public DOM::Element
  12. , public HTML::GlobalEventHandlers
  13. , public HTML::HTMLOrSVGElement<MathMLElement> {
  14. WEB_PLATFORM_OBJECT(MathMLElement, DOM::Element);
  15. GC_DECLARE_ALLOCATOR(MathMLElement);
  16. public:
  17. virtual ~MathMLElement() override;
  18. virtual Optional<ARIA::Role> default_role() const override;
  19. protected:
  20. virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
  21. virtual WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) override;
  22. virtual void inserted() override;
  23. virtual GC::Ptr<DOM::EventTarget> global_event_handlers_to_event_target(FlyString const&) override { return *this; }
  24. private:
  25. MathMLElement(DOM::Document&, DOM::QualifiedName);
  26. virtual void visit_edges(Visitor&) override;
  27. virtual void initialize(JS::Realm&) override;
  28. };
  29. }