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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSProperty_h | 21 #ifndef CSSProperty_h |
22 #define CSSProperty_h | 22 #define CSSProperty_h |
23 | 23 |
24 #include "CSSPropertyNames.h" | 24 #include "CSSPropertyNames.h" |
25 #include "RuntimeEnabledFeatures.h" | |
25 #include "core/css/CSSValue.h" | 26 #include "core/css/CSSValue.h" |
26 #include "core/platform/text/TextDirection.h" | 27 #include "core/platform/text/TextDirection.h" |
27 #include "core/platform/text/WritingMode.h" | 28 #include "core/platform/text/WritingMode.h" |
28 #include "wtf/PassRefPtr.h" | 29 #include "wtf/PassRefPtr.h" |
29 #include "wtf/RefPtr.h" | 30 #include "wtf/RefPtr.h" |
30 | 31 |
31 namespace WebCore { | 32 namespace WebCore { |
32 | 33 |
33 struct StylePropertyMetadata { | 34 struct StylePropertyMetadata { |
34 StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited) | 35 StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 | 83 |
83 const StylePropertyMetadata& metadata() const { return m_metadata; } | 84 const StylePropertyMetadata& metadata() const { return m_metadata; } |
84 | 85 |
85 private: | 86 private: |
86 StylePropertyMetadata m_metadata; | 87 StylePropertyMetadata m_metadata; |
87 RefPtr<CSSValue> m_value; | 88 RefPtr<CSSValue> m_value; |
88 }; | 89 }; |
89 | 90 |
90 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) | 91 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) |
91 { | 92 { |
93 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= C SSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction)) | |
94 return propId; | |
95 | |
92 CSSPropertyID propertyId = CSSPropertyInvalid; | 96 CSSPropertyID propertyId = CSSPropertyInvalid; |
93 switch (propId) { | 97 switch (propId) { |
98 case CSSPropertyAnimation: | |
99 propertyId = CSSPropertyWebkitAnimation; | |
100 break; | |
101 case CSSPropertyAnimationDelay: | |
102 propertyId = CSSPropertyWebkitAnimationDelay; | |
103 break; | |
104 case CSSPropertyAnimationDirection: | |
105 propertyId = CSSPropertyWebkitAnimationDirection; | |
106 break; | |
107 case CSSPropertyAnimationDuration: | |
108 propertyId = CSSPropertyWebkitAnimationDuration; | |
109 break; | |
110 case CSSPropertyAnimationFillMode: | |
111 propertyId = CSSPropertyWebkitAnimationFillMode; | |
112 break; | |
113 case CSSPropertyAnimationIterationCount: | |
eseidel
2013/08/13 17:49:15
Bleh. This should just be one big static array ma
darktears
2013/08/13 18:08:54
Yes, let's fix that in a following patch.
| |
114 propertyId = CSSPropertyWebkitAnimationIterationCount; | |
115 break; | |
116 case CSSPropertyAnimationName: | |
117 propertyId = CSSPropertyWebkitAnimationName; | |
118 break; | |
119 case CSSPropertyAnimationPlayState: | |
120 propertyId = CSSPropertyWebkitAnimationPlayState; | |
121 break; | |
122 case CSSPropertyAnimationTimingFunction: | |
123 propertyId = CSSPropertyWebkitAnimationTimingFunction; | |
124 break; | |
94 case CSSPropertyTransitionDelay: | 125 case CSSPropertyTransitionDelay: |
95 propertyId = CSSPropertyWebkitTransitionDelay; | 126 propertyId = CSSPropertyWebkitTransitionDelay; |
96 break; | 127 break; |
97 case CSSPropertyTransitionDuration: | 128 case CSSPropertyTransitionDuration: |
98 propertyId = CSSPropertyWebkitTransitionDuration; | 129 propertyId = CSSPropertyWebkitTransitionDuration; |
99 break; | 130 break; |
100 case CSSPropertyTransitionProperty: | 131 case CSSPropertyTransitionProperty: |
101 propertyId = CSSPropertyWebkitTransitionProperty; | 132 propertyId = CSSPropertyWebkitTransitionProperty; |
102 break; | 133 break; |
103 case CSSPropertyTransitionTimingFunction: | 134 case CSSPropertyTransitionTimingFunction: |
104 propertyId = CSSPropertyWebkitTransitionTimingFunction; | 135 propertyId = CSSPropertyWebkitTransitionTimingFunction; |
105 break; | 136 break; |
106 case CSSPropertyTransition: | 137 case CSSPropertyTransition: |
107 propertyId = CSSPropertyWebkitTransition; | 138 propertyId = CSSPropertyWebkitTransition; |
108 break; | 139 break; |
140 case CSSPropertyWebkitAnimation: | |
141 propertyId = CSSPropertyAnimation; | |
142 break; | |
143 case CSSPropertyWebkitAnimationDelay: | |
144 propertyId = CSSPropertyAnimationDelay; | |
145 break; | |
146 case CSSPropertyWebkitAnimationDirection: | |
147 propertyId = CSSPropertyAnimationDirection; | |
148 break; | |
149 case CSSPropertyWebkitAnimationDuration: | |
150 propertyId = CSSPropertyAnimationDuration; | |
151 break; | |
152 case CSSPropertyWebkitAnimationFillMode: | |
153 propertyId = CSSPropertyAnimationFillMode; | |
154 break; | |
155 case CSSPropertyWebkitAnimationIterationCount: | |
156 propertyId = CSSPropertyAnimationIterationCount; | |
157 break; | |
158 case CSSPropertyWebkitAnimationName: | |
159 propertyId = CSSPropertyAnimationName; | |
160 break; | |
161 case CSSPropertyWebkitAnimationPlayState: | |
162 propertyId = CSSPropertyAnimationPlayState; | |
163 break; | |
164 case CSSPropertyWebkitAnimationTimingFunction: | |
165 propertyId = CSSPropertyAnimationTimingFunction; | |
166 break; | |
109 case CSSPropertyWebkitTransitionDelay: | 167 case CSSPropertyWebkitTransitionDelay: |
110 propertyId = CSSPropertyTransitionDelay; | 168 propertyId = CSSPropertyTransitionDelay; |
111 break; | 169 break; |
112 case CSSPropertyWebkitTransitionDuration: | 170 case CSSPropertyWebkitTransitionDuration: |
113 propertyId = CSSPropertyTransitionDuration; | 171 propertyId = CSSPropertyTransitionDuration; |
114 break; | 172 break; |
115 case CSSPropertyWebkitTransitionProperty: | 173 case CSSPropertyWebkitTransitionProperty: |
116 propertyId = CSSPropertyTransitionProperty; | 174 propertyId = CSSPropertyTransitionProperty; |
117 break; | 175 break; |
118 case CSSPropertyWebkitTransitionTimingFunction: | 176 case CSSPropertyWebkitTransitionTimingFunction: |
(...skipping 13 matching lines...) Expand all Loading... | |
132 } // namespace WebCore | 190 } // namespace WebCore |
133 | 191 |
134 namespace WTF { | 192 namespace WTF { |
135 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<false, WebCore::CSSProperty> { | 193 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<false, WebCore::CSSProperty> { |
136 static const bool canInitializeWithMemset = true; | 194 static const bool canInitializeWithMemset = true; |
137 static const bool canMoveWithMemcpy = true; | 195 static const bool canMoveWithMemcpy = true; |
138 }; | 196 }; |
139 } | 197 } |
140 | 198 |
141 #endif // CSSProperty_h | 199 #endif // CSSProperty_h |
OLD | NEW |