
This is a monster patch that turns all EventTargets into GC-allocated PlatformObjects. Their C++ wrapper classes are removed, and the LibJS garbage collector is now responsible for their lifetimes. There's a fair amount of hacks and band-aids in this patch, and we'll have a lot of cleanup to do after this.
26 lines
783 B
C++
26 lines
783 B
C++
/*
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/CSSConditionRulePrototype.h>
|
|
#include <LibWeb/CSS/CSSConditionRule.h>
|
|
#include <LibWeb/HTML/Window.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& rules)
|
|
: CSSGroupingRule(window_object, rules)
|
|
{
|
|
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSConditionRulePrototype>("CSSConditionRule"));
|
|
}
|
|
|
|
void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
|
|
{
|
|
if (condition_matches())
|
|
CSSGroupingRule::for_each_effective_style_rule(callback);
|
|
}
|
|
|
|
}
|