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/CSSFontPaletteValuesRule.h"
8 #include "mozilla/dom/CSSFontPaletteValuesRuleBinding.h"
9 #include "mozilla/ServoBindings.h"
11 namespace mozilla::dom
{
13 size_t CSSFontPaletteValuesRule::SizeOfIncludingThis(
14 MallocSizeOf aMallocSizeOf
) const {
15 // TODO Implement this!
16 return aMallocSizeOf(this);
19 StyleCssRuleType
CSSFontPaletteValuesRule::Type() const {
20 return StyleCssRuleType::FontPaletteValues
;
24 void CSSFontPaletteValuesRule::List(FILE* out
, int32_t aIndent
) const {
26 for (int32_t i
= 0; i
< aIndent
; i
++) {
27 str
.AppendLiteral(" ");
29 Servo_FontPaletteValuesRule_Debug(mRawRule
, &str
);
30 fprintf_stderr(out
, "%s\n", str
.get());
34 void CSSFontPaletteValuesRule::SetRawAfterClone(
35 RefPtr
<StyleFontPaletteValuesRule
> aRaw
) {
36 mRawRule
= std::move(aRaw
);
39 /* CSSRule implementation */
41 void CSSFontPaletteValuesRule::GetCssText(nsACString
& aCssText
) const {
42 Servo_FontPaletteValuesRule_GetCssText(mRawRule
, &aCssText
);
45 /* CSSFontPaletteValuesRule implementation */
47 void CSSFontPaletteValuesRule::GetName(nsACString
& aNameStr
) const {
48 Servo_FontPaletteValuesRule_GetName(mRawRule
, &aNameStr
);
51 void CSSFontPaletteValuesRule::GetFontFamily(nsACString
& aFamilyListStr
) const {
52 Servo_FontPaletteValuesRule_GetFontFamily(mRawRule
, &aFamilyListStr
);
55 void CSSFontPaletteValuesRule::GetBasePalette(nsACString
& aPaletteStr
) const {
56 Servo_FontPaletteValuesRule_GetBasePalette(mRawRule
, &aPaletteStr
);
59 void CSSFontPaletteValuesRule::GetOverrideColors(nsACString
& aColorsStr
) const {
60 Servo_FontPaletteValuesRule_GetOverrideColors(mRawRule
, &aColorsStr
);
63 // If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
66 bool CSSFontPaletteValuesRule::IsCCLeaf() const { return Rule::IsCCLeaf(); }
69 JSObject
* CSSFontPaletteValuesRule::WrapObject(
70 JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) {
71 return CSSFontPaletteValuesRule_Binding::Wrap(aCx
, this, aGivenProto
);
74 } // namespace mozilla::dom