mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:17:36 +00:00
LibWeb: Make StyleSheetList GC-allocated
This commit is contained in:
parent
5d60212076
commit
5366924f11
14 changed files with 68 additions and 37 deletions
|
@ -279,7 +279,7 @@ NonnullRefPtr<Document> Document::create(AK::URL const& url)
|
|||
Document::Document(const AK::URL& url)
|
||||
: ParentNode(*this, NodeType::DOCUMENT_NODE)
|
||||
, m_style_computer(make<CSS::StyleComputer>(*this))
|
||||
, m_style_sheets(CSS::StyleSheetList::create(*this))
|
||||
, m_style_sheets(JS::make_handle(CSS::StyleSheetList::create(*this)))
|
||||
, m_url(url)
|
||||
, m_window(HTML::Window::create_with_document(*this))
|
||||
, m_implementation(DOMImplementation::create({}, *this))
|
||||
|
@ -1610,7 +1610,7 @@ void Document::evaluate_media_rules()
|
|||
{
|
||||
bool any_media_queries_changed_match_state = false;
|
||||
for (auto& style_sheet : style_sheets().sheets()) {
|
||||
if (style_sheet->evaluate_media_queries(window()))
|
||||
if (style_sheet.evaluate_media_queries(window()))
|
||||
any_media_queries_changed_match_state = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
CSS::StyleSheetList& style_sheets() { return *m_style_sheets; }
|
||||
const CSS::StyleSheetList& style_sheets() const { return *m_style_sheets; }
|
||||
|
||||
NonnullRefPtr<CSS::StyleSheetList> style_sheets_for_bindings() { return *m_style_sheets; }
|
||||
CSS::StyleSheetList* style_sheets_for_bindings() { return m_style_sheets.cell(); }
|
||||
|
||||
virtual FlyString node_name() const override { return "#document"; }
|
||||
|
||||
|
@ -409,7 +409,7 @@ private:
|
|||
size_t m_next_layout_node_serial_id { 0 };
|
||||
|
||||
OwnPtr<CSS::StyleComputer> m_style_computer;
|
||||
RefPtr<CSS::StyleSheetList> m_style_sheets;
|
||||
JS::Handle<CSS::StyleSheetList> m_style_sheets;
|
||||
RefPtr<Node> m_hovered_node;
|
||||
RefPtr<Node> m_inspected_node;
|
||||
RefPtr<Node> m_active_favicon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue