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/CSSFontFeatureValuesRule.h"
8 #include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
9 #include "mozilla/ServoBindings.h"
11 namespace mozilla::dom
{
13 size_t CSSFontFeatureValuesRule::SizeOfIncludingThis(
14 MallocSizeOf aMallocSizeOf
) const {
15 // TODO Implement this!
16 return aMallocSizeOf(this);
19 StyleCssRuleType
CSSFontFeatureValuesRule::Type() const {
20 return StyleCssRuleType::FontFeatureValues
;
24 void CSSFontFeatureValuesRule::List(FILE* out
, int32_t aIndent
) const {
26 for (int32_t i
= 0; i
< aIndent
; i
++) {
27 str
.AppendLiteral(" ");
29 Servo_FontFeatureValuesRule_Debug(mRawRule
, &str
);
30 fprintf_stderr(out
, "%s\n", str
.get());
34 void CSSFontFeatureValuesRule::SetRawAfterClone(
35 RefPtr
<StyleFontFeatureValuesRule
> aRaw
) {
36 mRawRule
= std::move(aRaw
);
39 /* CSSRule implementation */
41 void CSSFontFeatureValuesRule::GetCssText(nsACString
& aCssText
) const {
42 Servo_FontFeatureValuesRule_GetCssText(mRawRule
, &aCssText
);
45 /* CSSFontFeatureValuesRule implementation */
47 void CSSFontFeatureValuesRule::GetFontFamily(nsACString
& aFamilyListStr
) {
48 Servo_FontFeatureValuesRule_GetFontFamily(mRawRule
, &aFamilyListStr
);
51 void CSSFontFeatureValuesRule::GetValueText(nsACString
& aValueText
) {
52 Servo_FontFeatureValuesRule_GetValueText(mRawRule
, &aValueText
);
55 void CSSFontFeatureValuesRule::SetFontFamily(const nsACString
& aFontFamily
,
61 aRv
.Throw(NS_ERROR_NOT_IMPLEMENTED
);
64 void CSSFontFeatureValuesRule::SetValueText(const nsACString
& aValueText
,
70 aRv
.Throw(NS_ERROR_NOT_IMPLEMENTED
);
73 // If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
76 bool CSSFontFeatureValuesRule::IsCCLeaf() const { return Rule::IsCCLeaf(); }
79 JSObject
* CSSFontFeatureValuesRule::WrapObject(
80 JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) {
81 return CSSFontFeatureValuesRule_Binding::Wrap(aCx
, this, aGivenProto
);
84 } // namespace mozilla::dom