OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 uint16_t m_propertyID : 10; | 47 uint16_t m_propertyID : 10; |
48 uint16_t m_isSetFromShorthand : 1; | 48 uint16_t m_isSetFromShorthand : 1; |
49 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. | 49 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part
of an ambiguous shorthand, gives the index in the shorthands vector. |
50 uint16_t m_important : 1; | 50 uint16_t m_important : 1; |
51 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. | 51 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a
s the result of a shorthand. |
52 uint16_t m_inherited : 1; | 52 uint16_t m_inherited : 1; |
53 }; | 53 }; |
54 | 54 |
55 class CSSProperty { | 55 class CSSProperty { |
| 56 ALLOW_ONLY_INLINE_ALLOCATION(); |
56 public: | 57 public: |
57 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value
, bool important = false, bool isSetFromShorthand = false, int indexInShorthands
Vector = 0, bool implicit = false) | 58 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value
, bool important = false, bool isSetFromShorthand = false, int indexInShorthands
Vector = 0, bool implicit = false) |
58 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, isInheritedProperty(propertyID)) | 59 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im
portant, implicit, isInheritedProperty(propertyID)) |
59 , m_value(value) | 60 , m_value(value) |
60 { | 61 { |
61 } | 62 } |
62 | 63 |
63 // FIXME: Remove this. | 64 // FIXME: Remove this. |
64 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) | 65 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) |
65 : m_metadata(metadata) | 66 : m_metadata(metadata) |
66 , m_value(value) | 67 , m_value(value) |
67 { | 68 { |
68 } | 69 } |
69 | 70 |
70 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } | 71 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr
opertyID); } |
71 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }; | 72 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }; |
72 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }; | 73 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }; |
73 bool isImportant() const { return m_metadata.m_important; } | 74 bool isImportant() const { return m_metadata.m_important; } |
74 | 75 |
75 CSSValue* value() const { return m_value.get(); } | 76 CSSValue* value() const { return m_value.get(); } |
76 | 77 |
77 void wrapValueInCommaSeparatedList(); | 78 void wrapValueInCommaSeparatedList(); |
78 | 79 |
79 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); | 80 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect
ion, WritingMode); |
80 static bool isInheritedProperty(CSSPropertyID); | 81 static bool isInheritedProperty(CSSPropertyID); |
81 | 82 |
82 const StylePropertyMetadata& metadata() const { return m_metadata; } | 83 const StylePropertyMetadata& metadata() const { return m_metadata; } |
83 | 84 |
| 85 void trace(Visitor* visitor) { visitor->trace(m_value); } |
| 86 |
84 private: | 87 private: |
85 StylePropertyMetadata m_metadata; | 88 StylePropertyMetadata m_metadata; |
86 RefPtr<CSSValue> m_value; | 89 RefPtrWillBeMember<CSSValue> m_value; |
87 }; | 90 }; |
88 | 91 |
89 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) | 92 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) |
90 { | 93 { |
91 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= C
SSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction)) | 94 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= C
SSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction)) |
92 return propId; | 95 return propId; |
93 | 96 |
94 CSSPropertyID propertyId = CSSPropertyInvalid; | 97 CSSPropertyID propertyId = CSSPropertyInvalid; |
95 switch (propId) { | 98 switch (propId) { |
96 case CSSPropertyAnimation: | 99 case CSSPropertyAnimation: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } // namespace WebCore | 191 } // namespace WebCore |
189 | 192 |
190 namespace WTF { | 193 namespace WTF { |
191 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<WebCore
::CSSProperty> { | 194 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<WebCore
::CSSProperty> { |
192 static const bool canInitializeWithMemset = true; | 195 static const bool canInitializeWithMemset = true; |
193 static const bool canMoveWithMemcpy = true; | 196 static const bool canMoveWithMemcpy = true; |
194 }; | 197 }; |
195 } | 198 } |
196 | 199 |
197 #endif // CSSProperty_h | 200 #endif // CSSProperty_h |
OLD | NEW |