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 StyleLockedCounterStyleRule
;
15 namespace mozilla::dom
{
17 class CSSCounterStyleRule final
: public css::Rule
{
19 CSSCounterStyleRule(already_AddRefed
<StyleLockedCounterStyleRule
> aRawRule
,
20 StyleSheet
* aSheet
, css::Rule
* aParentRule
,
21 uint32_t aLine
, uint32_t aColumn
)
22 : css::Rule(aSheet
, aParentRule
, aLine
, aColumn
),
23 mRawRule(std::move(aRawRule
)) {}
26 CSSCounterStyleRule(const CSSCounterStyleRule
& aCopy
) = delete;
27 ~CSSCounterStyleRule() = default;
29 template <typename Func
>
30 void ModifyRule(Func
);
33 bool IsCCLeaf() const final
;
35 const StyleLockedCounterStyleRule
* Raw() const { return mRawRule
.get(); }
36 void SetRawAfterClone(RefPtr
<StyleLockedCounterStyleRule
>);
39 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
43 StyleCssRuleType
Type() const override
;
44 void GetCssText(nsACString
& aCssText
) const override
;
45 void GetName(nsAString
& aName
);
46 void SetName(const nsAString
& aName
);
47 #define CSS_COUNTER_DESC(name_, method_) \
48 void Get##method_(nsACString& aValue); \
49 void Set##method_(const nsACString& aValue);
50 #include "nsCSSCounterDescList.h"
51 #undef CSS_COUNTER_DESC
53 size_t SizeOfIncludingThis(MallocSizeOf
) const final
;
55 JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) final
;
58 RefPtr
<StyleLockedCounterStyleRule
> mRawRule
;
61 } // namespace mozilla::dom
63 #endif // mozilla_CSSCounterStyleRule_h