2021-09-28 16:53:15 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
2022-08-07 15:46:44 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
2021-09-28 16:53:15 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/CSS/CSSConditionRule.h>
|
2022-08-28 13:42:07 +02:00
|
|
|
#include <LibWeb/HTML/Window.h>
|
2021-09-28 16:53:15 +01:00
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& rules)
|
2022-08-07 15:46:44 +02:00
|
|
|
: CSSGroupingRule(window_object, rules)
|
2021-09-28 16:53:15 +01:00
|
|
|
{
|
2022-09-03 18:43:24 +02:00
|
|
|
set_prototype(&window_object.cached_web_prototype("CSSConditionRule"));
|
2021-09-28 16:53:15 +01:00
|
|
|
}
|
|
|
|
|
2021-10-08 17:02:47 +01:00
|
|
|
void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
|
|
|
|
{
|
|
|
|
if (condition_matches())
|
|
|
|
CSSGroupingRule::for_each_effective_style_rule(callback);
|
|
|
|
}
|
|
|
|
|
2021-09-28 16:53:15 +01:00
|
|
|
}
|