CSSConditionRule.cpp 503 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/CSS/CSSConditionRule.h>
  7. namespace Web::CSS {
  8. CSSConditionRule::CSSConditionRule(NonnullRefPtrVector<CSSRule>&& rules)
  9. : CSSGroupingRule(move(rules))
  10. {
  11. }
  12. void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
  13. {
  14. if (condition_matches())
  15. CSSGroupingRule::for_each_effective_style_rule(callback);
  16. }
  17. }