SVGStyleElement.h 989 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2023, Preston Taylor <PrestonLeeTaylor@proton.me>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/StyleElementUtils.h>
  8. #include <LibWeb/SVG/SVGElement.h>
  9. namespace Web::SVG {
  10. class SVGStyleElement final : public SVGElement {
  11. WEB_PLATFORM_OBJECT(HTMLStyleElement, SVGElement);
  12. public:
  13. virtual ~SVGStyleElement() override;
  14. virtual void children_changed() override;
  15. virtual void inserted() override;
  16. virtual void removed_from(Node*) override;
  17. CSS::CSSStyleSheet* sheet();
  18. CSS::CSSStyleSheet const* sheet() const;
  19. private:
  20. SVGStyleElement(DOM::Document&, DOM::QualifiedName);
  21. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  22. virtual void visit_edges(Cell::Visitor&) override;
  23. // The semantics and processing of a ‘style’ and its attributes must be the same as is defined for the HTML ‘style’ element.
  24. DOM::StyleElementUtils m_style_element_utils;
  25. };
  26. }