LibWeb/CSS: Support media queries in import at-rules

This commit is contained in:
Tim Ledbetter 2025-04-01 14:32:11 +01:00 committed by Sam Atkins
parent c1fe912bf9
commit ac19b0cda8
Notes: github-actions[bot] 2025-04-02 13:56:49 +00:00
7 changed files with 51 additions and 15 deletions

View file

@ -21,7 +21,7 @@ class CSSImportRule final
GC_DECLARE_ALLOCATOR(CSSImportRule);
public:
[[nodiscard]] static GC::Ref<CSSImportRule> create(URL::URL, DOM::Document&, RefPtr<Supports>);
[[nodiscard]] static GC::Ref<CSSImportRule> create(URL::URL, DOM::Document&, RefPtr<Supports>, Vector<NonnullRefPtr<MediaQuery>>);
virtual ~CSSImportRule() = default;
@ -36,7 +36,7 @@ public:
Optional<String> supports_text() const;
private:
CSSImportRule(URL::URL, DOM::Document&, RefPtr<Supports>);
CSSImportRule(URL::URL, DOM::Document&, RefPtr<Supports>, Vector<NonnullRefPtr<MediaQuery>>);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
@ -51,6 +51,7 @@ private:
URL::URL m_url;
GC::Ptr<DOM::Document> m_document;
RefPtr<Supports> m_supports;
Vector<NonnullRefPtr<MediaQuery>> m_media_query_list;
GC::Ptr<CSSStyleSheet> m_style_sheet;
Optional<DOM::DocumentLoadEventDelayer> m_document_load_event_delayer;
};