DeprecatedCSSParser.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/NonnullRefPtr.h>
  8. #include <AK/String.h>
  9. #include <LibWeb/CSS/CSSStyleSheet.h>
  10. namespace Web::CSS {
  11. class DeprecatedParsingContext {
  12. public:
  13. DeprecatedParsingContext();
  14. explicit DeprecatedParsingContext(const DOM::Document&);
  15. explicit DeprecatedParsingContext(const DOM::ParentNode&);
  16. bool in_quirks_mode() const;
  17. URL complete_url(const String&) const;
  18. private:
  19. const DOM::Document* m_document { nullptr };
  20. };
  21. }
  22. namespace Web {
  23. RefPtr<CSS::CSSStyleSheet> parse_css(const CSS::DeprecatedParsingContext&, const StringView&);
  24. RefPtr<CSS::CSSStyleDeclaration> parse_css_declaration(const CSS::DeprecatedParsingContext&, const StringView&);
  25. RefPtr<CSS::StyleValue> parse_css_value(const CSS::DeprecatedParsingContext&, const StringView&, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
  26. RefPtr<CSS::Selector> parse_selector(const CSS::DeprecatedParsingContext&, const StringView&);
  27. RefPtr<CSS::LengthStyleValue> parse_line_width(const CSS::DeprecatedParsingContext&, const StringView&);
  28. RefPtr<CSS::ColorStyleValue> parse_color(const CSS::DeprecatedParsingContext&, const StringView&);
  29. RefPtr<CSS::IdentifierStyleValue> parse_line_style(const CSS::DeprecatedParsingContext&, const StringView&);
  30. RefPtr<CSS::StyleValue> parse_html_length(const DOM::Document&, const StringView&);
  31. }