LibWeb/CSS: Implement import at-rule supports conditions

This indicates the features the browser must support for the given
stylesheet to be fetched.
This commit is contained in:
Tim Ledbetter 2025-03-19 11:23:33 +00:00 committed by Jelle Raaijmakers
commit c37a47f76f
Notes: github-actions[bot] 2025-03-19 15:43:58 +00:00
7 changed files with 95 additions and 9 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&);
[[nodiscard]] static GC::Ref<CSSImportRule> create(URL::URL, DOM::Document&, RefPtr<Supports>);
virtual ~CSSImportRule() = default;
@ -34,7 +34,7 @@ public:
CSSStyleSheet* style_sheet_for_bindings() { return m_style_sheet; }
private:
CSSImportRule(URL::URL, DOM::Document&);
CSSImportRule(URL::URL, DOM::Document&, RefPtr<Supports>);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
@ -48,6 +48,7 @@ private:
URL::URL m_url;
GC::Ptr<DOM::Document> m_document;
RefPtr<Supports> m_supports;
GC::Ptr<CSSStyleSheet> m_style_sheet;
Optional<DOM::DocumentLoadEventDelayer> m_document_load_event_delayer;
};