CSSRule.cpp 813 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, the SerenityOS developers.
  3. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibWeb/CSS/CSSRule.h>
  8. #include <LibWeb/CSS/CSSStyleSheet.h>
  9. namespace Web::CSS {
  10. // https://www.w3.org/TR/cssom/#dom-cssrule-csstext
  11. String CSSRule::css_text() const
  12. {
  13. // The cssText attribute must return a serialization of the CSS rule.
  14. return serialized();
  15. }
  16. // https://www.w3.org/TR/cssom/#dom-cssrule-csstext
  17. void CSSRule::set_css_text(StringView)
  18. {
  19. // On setting the cssText attribute must do nothing.
  20. }
  21. void CSSRule::set_parent_rule(CSSRule* parent_rule)
  22. {
  23. m_parent_rule = parent_rule;
  24. }
  25. void CSSRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
  26. {
  27. m_parent_style_sheet = parent_style_sheet;
  28. }
  29. }