2021-09-28 12:53:15 -03:00
|
|
|
/*
|
2024-09-03 07:43:20 -03:00
|
|
|
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2021-09-28 12:53:15 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2026-04-18 05:54:06 -03:00
|
|
|
#include <LibWeb/Bindings/CSSConditionRule.h>
|
2022-09-24 19:34:04 -03:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2021-09-28 12:53:15 -03:00
|
|
|
#include <LibWeb/CSS/CSSConditionRule.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
2024-10-28 16:16:28 -03:00
|
|
|
CSSConditionRule::CSSConditionRule(JS::Realm& realm, CSSRuleList& rules, Type type)
|
|
|
|
|
: CSSGroupingRule(realm, rules, type)
|
2021-09-28 12:53:15 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-03 07:43:20 -03:00
|
|
|
void CSSConditionRule::for_each_effective_rule(TraversalOrder order, Function<void(Web::CSS::CSSRule const&)> const& callback) const
|
2021-10-08 13:02:47 -03:00
|
|
|
{
|
|
|
|
|
if (condition_matches())
|
2024-09-03 07:43:20 -03:00
|
|
|
CSSGroupingRule::for_each_effective_rule(order, callback);
|
2023-05-26 17:00:54 -03:00
|
|
|
}
|
|
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
void CSSConditionRule::initialize(JS::Realm& realm)
|
2023-01-10 08:28:20 -03:00
|
|
|
{
|
2024-03-16 09:13:08 -03:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSConditionRule);
|
2025-04-20 11:22:57 -03:00
|
|
|
Base::initialize(realm);
|
2023-01-10 08:28:20 -03:00
|
|
|
}
|
|
|
|
|
|
2021-09-28 12:53:15 -03:00
|
|
|
}
|