HTMLLinkElement.h 1023 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2018-2020, 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 <LibWeb/HTML/HTMLElement.h>
  9. #include <LibWeb/Loader/CSSLoader.h>
  10. namespace Web::HTML {
  11. class HTMLLinkElement final : public HTMLElement {
  12. public:
  13. using WrapperType = Bindings::HTMLLinkElementWrapper;
  14. HTMLLinkElement(DOM::Document&, QualifiedName);
  15. virtual ~HTMLLinkElement() override;
  16. virtual void inserted() override;
  17. String rel() const { return attribute(HTML::AttributeNames::rel); }
  18. String type() const { return attribute(HTML::AttributeNames::type); }
  19. String href() const { return attribute(HTML::AttributeNames::href); }
  20. private:
  21. void parse_attribute(const FlyString&, const String&) override;
  22. struct Relationship {
  23. enum {
  24. Alternate = 1 << 0,
  25. Stylesheet = 1 << 1,
  26. };
  27. };
  28. CSSLoader m_css_loader;
  29. unsigned m_relationship { 0 };
  30. };
  31. }