summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/Parser/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser/Parser.h')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Parser.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h
index 0ab9421f37..6d3844f9b2 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h
@@ -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 };