StyleSheet.h 716 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/RefCounted.h>
  9. #include <LibWeb/Bindings/Wrappable.h>
  10. #include <LibWeb/Forward.h>
  11. namespace Web::CSS {
  12. class StyleSheet
  13. : public RefCounted<StyleSheet>
  14. , public Bindings::Wrappable {
  15. public:
  16. using WrapperType = Bindings::StyleSheetWrapper;
  17. virtual ~StyleSheet() = default;
  18. virtual String type() const = 0;
  19. DOM::Element* owner_node() { return m_owner_node; }
  20. void set_owner_node(DOM::Element*);
  21. protected:
  22. StyleSheet() = default;
  23. private:
  24. WeakPtr<DOM::Element> m_owner_node;
  25. };
  26. }