ladybird/Userland/Libraries/LibWeb/CSS/CSSRule.cpp
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

49 lines
1.1 KiB
C++

/*
* Copyright (c) 2021, the SerenityOS developers.
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/CSSRule.h>
#include <LibWeb/CSS/CSSStyleSheet.h>
namespace Web::CSS {
CSSRule::CSSRule(JS::Realm& realm)
: PlatformObject(realm)
{
}
void CSSRule::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_parent_style_sheet.ptr());
visitor.visit(m_parent_rule.ptr());
}
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
DeprecatedString CSSRule::css_text() const
{
// The cssText attribute must return a serialization of the CSS rule.
return serialized();
}
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext
void CSSRule::set_css_text(StringView)
{
// On setting the cssText attribute must do nothing.
}
void CSSRule::set_parent_rule(CSSRule* parent_rule)
{
m_parent_rule = parent_rule;
}
void CSSRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
{
m_parent_style_sheet = parent_style_sheet;
}
}