mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andreas Kling
parent
390cc30a97
commit
004ae453d1
@@ -26,9 +26,23 @@ class CSSRule;
|
||||
class CSSStyleRule;
|
||||
struct StyleProperty;
|
||||
|
||||
class ParsingContext {
|
||||
public:
|
||||
ParsingContext();
|
||||
explicit ParsingContext(DOM::Document const&);
|
||||
explicit ParsingContext(DOM::ParentNode const&);
|
||||
|
||||
bool in_quirks_mode() const;
|
||||
|
||||
URL complete_url(String const&) const;
|
||||
|
||||
private:
|
||||
const DOM::Document* m_document { nullptr };
|
||||
};
|
||||
|
||||
class Parser {
|
||||
public:
|
||||
Parser(const StringView& input, const String& encoding = "utf-8");
|
||||
Parser(ParsingContext const&, StringView const& input, String const& encoding = "utf-8");
|
||||
~Parser();
|
||||
|
||||
// The normal parser entry point, for parsing stylesheets.
|
||||
@@ -87,6 +101,8 @@ private:
|
||||
|
||||
RefPtr<CSSRule> convert_rule(NonnullRefPtr<QualifiedStyleRule>);
|
||||
|
||||
ParsingContext m_context;
|
||||
|
||||
Tokenizer m_tokenizer;
|
||||
Vector<Token> m_tokens;
|
||||
int m_iterator_offset { -1 };
|
||||
|
||||
Reference in New Issue
Block a user