1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 23:15:08 +00:00

LibWeb: Make CSSRuleList GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 13:51:40 +02:00
parent 5366924f11
commit 5d6cb9cbdb
11 changed files with 50 additions and 29 deletions

View file

@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/CSS/CSSGroupingRule.h>
#include <LibWeb/CSS/CSSRuleList.h>
namespace Web::CSS {
CSSGroupingRule::CSSGroupingRule(NonnullRefPtrVector<CSSRule>&& rules)
: m_rules(CSSRuleList::create(move(rules)))
// FIXME: Use the same window object for the rule list.
: m_rules(JS::make_handle(CSSRuleList::create(Bindings::main_thread_internal_window_object(), move(rules))))
{
for (auto& rule : *m_rules)
rule.set_parent_rule(this);