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_dom_CSSKeyframeRule_h
8 #define mozilla_dom_CSSKeyframeRule_h
10 #include "mozilla/css/Rule.h"
11 #include "mozilla/ServoBindingTypes.h"
13 class nsICSSDeclaration
;
15 namespace mozilla::dom
{
17 class CSSKeyframeDeclaration
;
19 class CSSKeyframeRule final
: public css::Rule
{
21 CSSKeyframeRule(already_AddRefed
<StyleLockedKeyframe
> aRaw
,
22 StyleSheet
* aSheet
, css::Rule
* aParentRule
, uint32_t aLine
,
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CSSKeyframeRule
, css::Rule
)
27 bool IsCCLeaf() const final
;
30 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
33 StyleLockedKeyframe
* Raw() const { return mRaw
; }
34 void SetRawAfterClone(RefPtr
<StyleLockedKeyframe
>);
37 StyleCssRuleType
Type() const final
;
38 void GetCssText(nsACString
& aCssText
) const final
;
39 void GetKeyText(nsACString
& aKey
);
40 void SetKeyText(const nsACString
& aKey
);
41 nsICSSDeclaration
* Style();
43 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const final
;
45 JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) final
;
48 virtual ~CSSKeyframeRule();
50 friend class CSSKeyframeDeclaration
;
52 template <typename Func
>
53 void UpdateRule(Func aCallback
);
55 RefPtr
<StyleLockedKeyframe
> mRaw
;
56 // lazily created when needed
57 RefPtr
<CSSKeyframeDeclaration
> mDeclaration
;
60 } // namespace mozilla::dom
62 #endif // mozilla_dom_CSSKeyframeRule_h