2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-06-21 20:54:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
2021-02-21 18:36:34 +02:00
|
|
|
#include <AK/String.h>
|
2021-03-07 16:14:04 +01:00
|
|
|
#include <LibWeb/CSS/CSSStyleSheet.h>
|
2019-06-21 20:54:13 +02:00
|
|
|
|
2020-07-21 16:23:08 +02:00
|
|
|
namespace Web::CSS {
|
2021-07-02 20:25:13 +01:00
|
|
|
class DeprecatedParsingContext {
|
2020-06-28 12:43:22 +02:00
|
|
|
public:
|
2021-07-02 20:25:13 +01:00
|
|
|
DeprecatedParsingContext();
|
|
|
|
|
explicit DeprecatedParsingContext(const DOM::Document&);
|
|
|
|
|
explicit DeprecatedParsingContext(const DOM::ParentNode&);
|
2020-06-28 12:43:22 +02:00
|
|
|
|
|
|
|
|
bool in_quirks_mode() const;
|
|
|
|
|
|
2021-02-21 18:36:34 +02:00
|
|
|
URL complete_url(const String&) const;
|
|
|
|
|
|
2020-06-28 12:43:22 +02:00
|
|
|
private:
|
2020-07-26 19:37:56 +02:00
|
|
|
const DOM::Document* m_document { nullptr };
|
2020-06-28 12:43:22 +02:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-21 16:23:08 +02:00
|
|
|
namespace Web {
|
|
|
|
|
|
2021-07-02 20:25:13 +01:00
|
|
|
RefPtr<CSS::CSSStyleSheet> parse_css(const CSS::DeprecatedParsingContext&, const StringView&);
|
|
|
|
|
RefPtr<CSS::CSSStyleDeclaration> parse_css_declaration(const CSS::DeprecatedParsingContext&, const StringView&);
|
|
|
|
|
RefPtr<CSS::StyleValue> parse_css_value(const CSS::DeprecatedParsingContext&, const StringView&, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
|
2021-07-12 17:30:40 +01:00
|
|
|
RefPtr<CSS::Selector> parse_selector(const CSS::DeprecatedParsingContext&, const StringView&);
|
2020-06-28 12:43:22 +02:00
|
|
|
|
2021-07-02 20:25:13 +01:00
|
|
|
RefPtr<CSS::LengthStyleValue> parse_line_width(const CSS::DeprecatedParsingContext&, const StringView&);
|
|
|
|
|
RefPtr<CSS::ColorStyleValue> parse_color(const CSS::DeprecatedParsingContext&, const StringView&);
|
|
|
|
|
RefPtr<CSS::IdentifierStyleValue> parse_line_style(const CSS::DeprecatedParsingContext&, const StringView&);
|
2020-03-20 20:29:39 +01:00
|
|
|
|
2020-07-26 20:01:35 +02:00
|
|
|
RefPtr<CSS::StyleValue> parse_html_length(const DOM::Document&, const StringView&);
|
2020-07-22 01:13:18 +02:00
|
|
|
|
2020-03-07 10:27:02 +01:00
|
|
|
}
|