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 #ifndef mozilla_CSSCounterStyleRule_h
8 #define mozilla_CSSCounterStyleRule_h
10 #include "mozilla/css/Rule.h"
11 #include "mozilla/ServoBindingTypes.h"
13 struct RawServoCounterStyleRule
;
18 class CSSCounterStyleRule final
: public css::Rule
{
20 CSSCounterStyleRule(already_AddRefed
<RawServoCounterStyleRule
> aRawRule
,
21 StyleSheet
* aSheet
, css::Rule
* aParentRule
,
22 uint32_t aLine
, uint32_t aColumn
)
23 : css::Rule(aSheet
, aParentRule
, aLine
, aColumn
),
24 mRawRule(std::move(aRawRule
)) {}
27 CSSCounterStyleRule(const CSSCounterStyleRule
& aCopy
) = delete;
28 ~CSSCounterStyleRule() = default;
31 bool IsCCLeaf() const final
;
33 const RawServoCounterStyleRule
* Raw() const { return mRawRule
.get(); }
36 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
40 uint16_t Type() const override
;
41 void GetCssText(nsACString
& aCssText
) const override
;
42 void GetName(nsAString
& aName
);
43 void SetName(const nsAString
& aName
);
44 #define CSS_COUNTER_DESC(name_, method_) \
45 void Get##method_(nsACString& aValue); \
46 void Set##method_(const nsACString& aValue);
47 #include "nsCSSCounterDescList.h"
48 #undef CSS_COUNTER_DESC
50 size_t SizeOfIncludingThis(MallocSizeOf
) const final
;
52 JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) final
;
55 RefPtr
<RawServoCounterStyleRule
> mRawRule
;
59 } // namespace mozilla
61 #endif // mozilla_CSSCounterStyleRule_h