1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Add context to new CSS parser, and deprecate the old one

The new one is the same as the old one, just in the new Parser's
source files. This isn't the most elegant solution but it seemed
like the best option. And it's all temporary, after all.
This commit is contained in:
Sam Atkins 2021-07-02 20:25:13 +01:00 committed by Andreas Kling
parent 390cc30a97
commit 004ae453d1
10 changed files with 83 additions and 41 deletions

View file

@ -11,11 +11,11 @@
#include <LibWeb/CSS/CSSStyleSheet.h>
namespace Web::CSS {
class ParsingContext {
class DeprecatedParsingContext {
public:
ParsingContext();
explicit ParsingContext(const DOM::Document&);
explicit ParsingContext(const DOM::ParentNode&);
DeprecatedParsingContext();
explicit DeprecatedParsingContext(const DOM::Document&);
explicit DeprecatedParsingContext(const DOM::ParentNode&);
bool in_quirks_mode() const;
@ -28,14 +28,14 @@ private:
namespace Web {
RefPtr<CSS::CSSStyleSheet> parse_css(const CSS::ParsingContext&, const StringView&);
RefPtr<CSS::CSSStyleDeclaration> parse_css_declaration(const CSS::ParsingContext&, const StringView&);
RefPtr<CSS::StyleValue> parse_css_value(const CSS::ParsingContext&, const StringView&, CSS::PropertyID property_id = CSS::PropertyID::Invalid);
Optional<CSS::Selector> parse_selector(const CSS::ParsingContext&, const StringView&);
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);
Optional<CSS::Selector> parse_selector(const CSS::DeprecatedParsingContext&, const StringView&);
RefPtr<CSS::LengthStyleValue> parse_line_width(const CSS::ParsingContext&, const StringView&);
RefPtr<CSS::ColorStyleValue> parse_color(const CSS::ParsingContext&, const StringView&);
RefPtr<CSS::IdentifierStyleValue> parse_line_style(const CSS::ParsingContext&, const StringView&);
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&);
RefPtr<CSS::StyleValue> parse_html_length(const DOM::Document&, const StringView&);