2021-02-21 13:45:26 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2022-04-22 19:56:22 +01:00
|
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
2022-08-07 15:46:44 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
2021-02-21 13:45:26 +02:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-02-21 13:45:26 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/CSS/CSSRule.h>
|
2022-04-22 19:56:22 +01:00
|
|
|
#include <LibWeb/CSS/CSSStyleSheet.h>
|
2021-02-21 13:45:26 +02:00
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
2022-09-24 16:34:04 -06:00
|
|
|
CSSRule::CSSRule(JS::Realm& realm)
|
|
|
|
: PlatformObject(realm)
|
2022-08-07 15:46:44 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSSRule::visit_edges(Cell::Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
|
|
|
visitor.visit(m_parent_style_sheet.ptr());
|
|
|
|
visitor.visit(m_parent_rule.ptr());
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:38:39 +01:00
|
|
|
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString CSSRule::css_text() const
|
2021-10-01 19:57:45 +02:00
|
|
|
{
|
|
|
|
// The cssText attribute must return a serialization of the CSS rule.
|
|
|
|
return serialized();
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:38:39 +01:00
|
|
|
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
|
2021-10-01 19:57:45 +02:00
|
|
|
void CSSRule::set_css_text(StringView)
|
|
|
|
{
|
|
|
|
// On setting the cssText attribute must do nothing.
|
|
|
|
}
|
|
|
|
|
2022-04-22 19:56:22 +01:00
|
|
|
void CSSRule::set_parent_rule(CSSRule* parent_rule)
|
|
|
|
{
|
2022-07-04 00:42:44 +02:00
|
|
|
m_parent_rule = parent_rule;
|
2022-04-22 19:56:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSSRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
|
|
|
|
{
|
2022-07-04 00:42:44 +02:00
|
|
|
m_parent_style_sheet = parent_style_sheet;
|
2022-04-22 19:56:22 +01:00
|
|
|
}
|
|
|
|
|
2021-02-21 13:45:26 +02:00
|
|
|
}
|