CSSConditionRule.cpp 691 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibWeb/CSS/CSSConditionRule.h>
  8. #include <LibWeb/HTML/Window.h>
  9. namespace Web::CSS {
  10. CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& rules)
  11. : CSSGroupingRule(window_object, rules)
  12. {
  13. set_prototype(&window_object.cached_web_prototype("CSSConditionRule"));
  14. }
  15. void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
  16. {
  17. if (condition_matches())
  18. CSSGroupingRule::for_each_effective_style_rule(callback);
  19. }
  20. }