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/CSSPropertyRule.h"
8 #include "mozilla/dom/CSSPropertyRuleBinding.h"
9 #include "mozilla/ServoBindings.h"
11 namespace mozilla::dom
{
13 bool CSSPropertyRule::IsCCLeaf() const { return Rule::IsCCLeaf(); }
15 void CSSPropertyRule::SetRawAfterClone(RefPtr
<StylePropertyRule
> aRaw
) {
16 mRawRule
= std::move(aRaw
);
20 JSObject
* CSSPropertyRule::WrapObject(JSContext
* aCx
,
21 JS::Handle
<JSObject
*> aGivenProto
) {
22 return CSSPropertyRule_Binding::Wrap(aCx
, this, aGivenProto
);
26 void CSSPropertyRule::List(FILE* out
, int32_t aIndent
) const {
28 for (int32_t i
= 0; i
< aIndent
; i
++) {
29 str
.AppendLiteral(" ");
31 Servo_PropertyRule_Debug(mRawRule
, &str
);
32 fprintf_stderr(out
, "%s\n", str
.get());
36 size_t CSSPropertyRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const {
37 // TODO Implement this!
38 return aMallocSizeOf(this);
41 StyleCssRuleType
CSSPropertyRule::Type() const {
42 return StyleCssRuleType::Property
;
45 /* CSSRule implementation */
47 void CSSPropertyRule::GetCssText(nsACString
& aCssText
) const {
48 Servo_PropertyRule_GetCssText(mRawRule
, &aCssText
);
51 /* CSSPropertyRule implementation */
53 void CSSPropertyRule::GetName(nsACString
& aNameStr
) const {
54 Servo_PropertyRule_GetName(mRawRule
, &aNameStr
);
57 void CSSPropertyRule::GetSyntax(nsACString
& aSyntaxStr
) const {
58 Servo_PropertyRule_GetSyntax(mRawRule
, &aSyntaxStr
);
61 bool CSSPropertyRule::Inherits() const {
62 return Servo_PropertyRule_GetInherits(mRawRule
);
65 void CSSPropertyRule::GetInitialValue(nsACString
& aInitialValueStr
) const {
66 bool found
= Servo_PropertyRule_GetInitialValue(mRawRule
, &aInitialValueStr
);
68 aInitialValueStr
.SetIsVoid(true);
72 } // namespace mozilla::dom