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

LibWeb: Remove unecessary dependence on Window from CSS classes

These classes only needed Window to get at its realm. Pass a realm
directly to construct CSS classes.
This commit is contained in:
Andrew Kaster 2022-09-24 16:34:04 -06:00 committed by Linus Groh
parent 8de7e49a56
commit a2ccb00e1d
37 changed files with 159 additions and 146 deletions

View file

@ -36,7 +36,7 @@ namespace Web::CSS::Parser {
class ParsingContext {
public:
ParsingContext();
explicit ParsingContext(HTML::Window&);
explicit ParsingContext(JS::Realm&);
explicit ParsingContext(DOM::Document const&);
explicit ParsingContext(DOM::Document const&, AK::URL);
explicit ParsingContext(DOM::ParentNode&);
@ -48,10 +48,10 @@ 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; }
HTML::Window& window_object() const { return m_window_object; }
JS::Realm& realm() const { return m_realm; }
private:
HTML::Window& m_window_object;
JS::Realm& m_realm;
DOM::Document const* m_document { nullptr };
PropertyID m_current_property_id { PropertyID::Invalid };
AK::URL m_url;