1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibWeb: Make CSSRule and all its subclasses GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 15:46:44 +02:00
parent 5d6cb9cbdb
commit 12042f0757
39 changed files with 338 additions and 236 deletions

View file

@ -4,15 +4,23 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/CSSSupportsRulePrototype.h>
#include <LibWeb/Bindings/WindowObject.h>
#include <LibWeb/CSS/CSSSupportsRule.h>
#include <LibWeb/CSS/Parser/Parser.h>
namespace Web::CSS {
CSSSupportsRule::CSSSupportsRule(NonnullRefPtr<Supports>&& supports, NonnullRefPtrVector<CSSRule>&& rules)
: CSSConditionRule(move(rules))
CSSSupportsRule* CSSSupportsRule::create(Bindings::WindowObject& window_object, NonnullRefPtr<Supports>&& supports, CSSRuleList& rules)
{
return window_object.heap().allocate<CSSSupportsRule>(window_object.realm(), window_object, move(supports), rules);
}
CSSSupportsRule::CSSSupportsRule(Bindings::WindowObject& window_object, NonnullRefPtr<Supports>&& supports, CSSRuleList& rules)
: CSSConditionRule(window_object, rules)
, m_supports(move(supports))
{
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSSupportsRulePrototype>("CSSSupportsRule"));
}
String CSSSupportsRule::condition_text() const