Line data Source code
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/. */
6 :
7 : #ifndef mozilla_DeclarationBlockInlines_h
8 : #define mozilla_DeclarationBlockInlines_h
9 :
10 : #include "mozilla/css/Declaration.h"
11 : #include "mozilla/ServoDeclarationBlock.h"
12 :
13 : namespace mozilla {
14 :
15 495 : MOZ_DEFINE_STYLO_METHODS(DeclarationBlock, css::Declaration, ServoDeclarationBlock)
16 :
17 : MozExternalRefCountType
18 96 : DeclarationBlock::AddRef()
19 : {
20 96 : MOZ_STYLO_FORWARD(AddRef, ())
21 : }
22 :
23 : MozExternalRefCountType
24 23 : DeclarationBlock::Release()
25 : {
26 23 : MOZ_STYLO_FORWARD(Release, ())
27 : }
28 :
29 : already_AddRefed<DeclarationBlock>
30 15 : DeclarationBlock::Clone() const
31 : {
32 30 : RefPtr<DeclarationBlock> result;
33 15 : if (IsGecko()) {
34 30 : result = new css::Declaration(*AsGecko());
35 : } else {
36 0 : result = new ServoDeclarationBlock(*AsServo());
37 : }
38 30 : return result.forget();
39 : }
40 :
41 : already_AddRefed<DeclarationBlock>
42 9 : DeclarationBlock::EnsureMutable()
43 : {
44 : #ifdef DEBUG
45 9 : if (IsGecko()) {
46 9 : AsGecko()->AssertNotExpanded();
47 : }
48 : #endif
49 9 : if (!IsMutable()) {
50 5 : return Clone();
51 : }
52 4 : return do_AddRef(this);
53 : }
54 :
55 : void
56 0 : DeclarationBlock::ToString(nsAString& aString) const
57 : {
58 0 : MOZ_STYLO_FORWARD(ToString, (aString))
59 : }
60 :
61 : uint32_t
62 0 : DeclarationBlock::Count() const
63 : {
64 0 : MOZ_STYLO_FORWARD(Count, ())
65 : }
66 :
67 : bool
68 0 : DeclarationBlock::GetNthProperty(uint32_t aIndex, nsAString& aReturn) const
69 : {
70 0 : MOZ_STYLO_FORWARD(GetNthProperty, (aIndex, aReturn))
71 : }
72 :
73 : void
74 0 : DeclarationBlock::GetPropertyValue(const nsAString& aProperty,
75 : nsAString& aValue) const
76 : {
77 0 : MOZ_STYLO_FORWARD(GetPropertyValue, (aProperty, aValue))
78 : }
79 :
80 : void
81 0 : DeclarationBlock::GetPropertyValueByID(nsCSSPropertyID aPropID,
82 : nsAString& aValue) const
83 : {
84 0 : MOZ_STYLO_FORWARD(GetPropertyValueByID, (aPropID, aValue))
85 : }
86 :
87 : void
88 0 : DeclarationBlock::GetAuthoredPropertyValue(const nsAString& aProperty,
89 : nsAString& aValue) const
90 : {
91 0 : MOZ_STYLO_FORWARD(GetAuthoredPropertyValue, (aProperty, aValue))
92 : }
93 :
94 : bool
95 0 : DeclarationBlock::GetPropertyIsImportant(const nsAString& aProperty) const
96 : {
97 0 : MOZ_STYLO_FORWARD(GetPropertyIsImportant, (aProperty))
98 : }
99 :
100 : void
101 0 : DeclarationBlock::RemoveProperty(const nsAString& aProperty)
102 : {
103 0 : MOZ_STYLO_FORWARD(RemoveProperty, (aProperty))
104 : }
105 :
106 : void
107 1 : DeclarationBlock::RemovePropertyByID(nsCSSPropertyID aProperty)
108 : {
109 1 : MOZ_STYLO_FORWARD(RemovePropertyByID, (aProperty))
110 : }
111 :
112 : } // namespace mozilla
113 :
114 : #endif // mozilla_DeclarationBlockInlines_h
|