diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index 615a7743b4..a3ee6c2b2d 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -36,30 +37,6 @@ namespace Web::CSS::Parser { -class ParsingContext { -public: - explicit ParsingContext(JS::Realm&); - explicit ParsingContext(DOM::Document const&); - explicit ParsingContext(DOM::Document const&, AK::URL); - explicit ParsingContext(DOM::ParentNode&); - - bool in_quirks_mode() const; - DOM::Document const* document() const { return m_document; } - HTML::Window const* window() const; - AK::URL complete_url(StringView) const; - - PropertyID current_property_id() const { return m_current_property_id; } - void set_current_property_id(PropertyID property_id) { m_current_property_id = property_id; } - - JS::Realm& realm() const { return m_realm; } - -private: - JS::NonnullGCPtr m_realm; - JS::GCPtr m_document; - PropertyID m_current_property_id { PropertyID::Invalid }; - AK::URL m_url; -}; - class Parser { public: static ErrorOr create(ParsingContext const&, StringView input, StringView encoding = "utf-8"sv); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/ParsingContext.h b/Userland/Libraries/LibWeb/CSS/Parser/ParsingContext.h new file mode 100644 index 0000000000..506cee4f92 --- /dev/null +++ b/Userland/Libraries/LibWeb/CSS/Parser/ParsingContext.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020-2021, the SerenityOS developers. + * Copyright (c) 2021-2023, Sam Atkins + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include + +namespace Web::CSS::Parser { + +class ParsingContext { +public: + explicit ParsingContext(JS::Realm&); + explicit ParsingContext(DOM::Document const&); + explicit ParsingContext(DOM::Document const&, AK::URL); + explicit ParsingContext(DOM::ParentNode&); + + bool in_quirks_mode() const; + DOM::Document const* document() const { return m_document; } + HTML::Window const* window() const; + AK::URL complete_url(StringView) const; + + PropertyID current_property_id() const { return m_current_property_id; } + void set_current_property_id(PropertyID property_id) { m_current_property_id = property_id; } + + JS::Realm& realm() const { return m_realm; } + +private: + JS::NonnullGCPtr m_realm; + JS::GCPtr m_document; + PropertyID m_current_property_id { PropertyID::Invalid }; + AK::URL m_url; +}; + +}