CSSFontPaletteValuesRule.h (1818B)
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/. */ 6 7 #ifndef mozilla_dom_CSSFontPaletteValuesRule_h 8 #define mozilla_dom_CSSFontPaletteValuesRule_h 9 10 #include "mozilla/ServoBindingTypes.h" 11 #include "mozilla/css/Rule.h" 12 #include "nsICSSDeclaration.h" 13 14 namespace mozilla::dom { 15 16 class CSSFontPaletteValuesRule final : public css::Rule { 17 public: 18 CSSFontPaletteValuesRule(RefPtr<StyleFontPaletteValuesRule> aRawRule, 19 StyleSheet* aSheet, css::Rule* aParentRule, 20 uint32_t aLine, uint32_t aColumn) 21 : css::Rule(aSheet, aParentRule, aLine, aColumn), 22 mRawRule(std::move(aRawRule)) {} 23 24 bool IsCCLeaf() const final; 25 26 StyleFontPaletteValuesRule* Raw() const { return mRawRule; } 27 void SetRawAfterClone(RefPtr<StyleFontPaletteValuesRule> aRaw); 28 29 // WebIDL interfaces 30 StyleCssRuleType Type() const final; 31 32 void GetCssText(nsACString& aCssText) const final; 33 34 void GetFontFamily(nsACString& aFamily) const; 35 36 void GetName(nsACString& aName) const; 37 38 void GetBasePalette(nsACString& aPalette) const; 39 40 void GetOverrideColors(nsACString& aColors) const; 41 42 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final; 43 44 #ifdef DEBUG 45 void List(FILE* out = stdout, int32_t aIndent = 0) const final; 46 #endif 47 48 JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final; 49 50 private: 51 ~CSSFontPaletteValuesRule() = default; 52 53 RefPtr<StyleFontPaletteValuesRule> mRawRule; 54 }; 55 56 } // namespace mozilla::dom 57 58 #endif // mozilla_dom_CSSFontPaletteValuesRule_h