1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/CSSNamespaceRule.h"
9 #include "mozilla/ServoBindings.h"
11 namespace mozilla::dom
{
13 CSSNamespaceRule::~CSSNamespaceRule() = default;
16 void CSSNamespaceRule::List(FILE* out
, int32_t aIndent
) const {
18 for (int32_t i
= 0; i
< aIndent
; i
++) {
19 str
.AppendLiteral(" ");
21 Servo_NamespaceRule_Debug(mRawRule
, &str
);
22 fprintf_stderr(out
, "%s\n", str
.get());
26 StyleCssRuleType
CSSNamespaceRule::Type() const {
27 return StyleCssRuleType::Namespace
;
30 nsAtom
* CSSNamespaceRule::GetPrefix() const {
31 return Servo_NamespaceRule_GetPrefix(mRawRule
);
34 void CSSNamespaceRule::GetURLSpec(nsString
& aURLSpec
) const {
35 nsAtom
* atom
= Servo_NamespaceRule_GetURI(mRawRule
);
36 atom
->ToString(aURLSpec
);
39 void CSSNamespaceRule::GetCssText(nsACString
& aCssText
) const {
40 Servo_NamespaceRule_GetCssText(mRawRule
, &aCssText
);
43 void CSSNamespaceRule::SetRawAfterClone(RefPtr
<StyleNamespaceRule
> aRaw
) {
44 mRawRule
= std::move(aRaw
);
47 size_t CSSNamespaceRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const {
48 return aMallocSizeOf(this);
51 } // namespace mozilla::dom