diff --git a/Libraries/LibWeb/CSS/Parser/ParsingContext.cpp b/Libraries/LibWeb/CSS/Parser/ParsingContext.cpp index 112f88bb5a3..97f8d454cf8 100644 --- a/Libraries/LibWeb/CSS/Parser/ParsingContext.cpp +++ b/Libraries/LibWeb/CSS/Parser/ParsingContext.cpp @@ -13,6 +13,11 @@ namespace Web::CSS::Parser { +ParsingContext::ParsingContext(Mode mode) + : m_mode(mode) +{ +} + ParsingContext::ParsingContext(JS::Realm& realm, Mode mode) : m_realm(realm) , m_mode(mode) diff --git a/Libraries/LibWeb/CSS/Parser/ParsingContext.h b/Libraries/LibWeb/CSS/Parser/ParsingContext.h index ea8aeaa2954..6783db1247d 100644 --- a/Libraries/LibWeb/CSS/Parser/ParsingContext.h +++ b/Libraries/LibWeb/CSS/Parser/ParsingContext.h @@ -19,6 +19,7 @@ public: SVGPresentationAttribute, // See https://svgwg.org/svg2-draft/types.html#presentation-attribute-css-value }; + explicit ParsingContext(Mode = Mode::Normal); explicit ParsingContext(JS::Realm&, Mode = Mode::Normal); explicit ParsingContext(JS::Realm&, URL::URL, Mode = Mode::Normal); explicit ParsingContext(DOM::Document const&, Mode = Mode::Normal); @@ -36,10 +37,14 @@ public: 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; } + JS::Realm& realm() const + { + VERIFY(m_realm); + return *m_realm; + } private: - GC::Ref m_realm; + GC::Ptr m_realm; GC::Ptr m_document; PropertyID m_current_property_id { PropertyID::Invalid }; URL::URL m_url;