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_CSSPropertyRule_h
8 #define mozilla_dom_CSSPropertyRule_h
10 #include "mozilla/css/Rule.h"
11 #include "mozilla/ServoBindingTypes.h"
13 #include "nsICSSDeclaration.h"
15 struct StylePropertyRule
;
17 namespace mozilla::dom
{
19 class CSSPropertyRule final
: public css::Rule
{
21 CSSPropertyRule(already_AddRefed
<StylePropertyRule
> aRawRule
,
22 StyleSheet
* aSheet
, css::Rule
* aParentRule
, uint32_t aLine
,
24 : css::Rule(aSheet
, aParentRule
, aLine
, aColumn
),
25 mRawRule(std::move(aRawRule
)) {}
27 bool IsCCLeaf() const final
;
29 StylePropertyRule
* Raw() const { return mRawRule
; }
30 void SetRawAfterClone(RefPtr
<StylePropertyRule
> aRaw
);
32 JSObject
* WrapObject(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) final
;
35 void List(FILE* out
= stdout
, int32_t aIndent
= 0) const final
;
38 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const final
;
41 StyleCssRuleType
Type() const final
;
43 void GetName(nsACString
& aName
) const;
45 void GetSyntax(nsACString
& aSyntax
) const;
47 bool Inherits() const;
49 void GetInitialValue(nsACString
& aInitialValueStr
) const;
51 void GetCssText(nsACString
& aCssText
) const final
;
54 ~CSSPropertyRule() = default;
56 RefPtr
<StylePropertyRule
> mRawRule
;
59 } // namespace mozilla::dom
61 #endif // mozilla_dom_CSSPropertyRule_h