Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: Source/core/css/StylePropertyShorthand.cpp

Issue 16161005: Reduce CSSProperty's StylePropertyMetadata memory footprint by half when used inside a ImmutableSty… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 5 *
5 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
9 * 10 *
10 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 14 * Library General Public License for more details.
14 * 15 *
15 * You should have received a copy of the GNU Library General Public License 16 * 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 17 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
19 */ 20 */
20 21
21 #include "config.h" 22 #include "config.h"
22 #include "core/css/StylePropertyShorthand.h" 23 #include "core/css/StylePropertyShorthand.h"
23 24
24 #include <wtf/StdLibExtras.h> 25 #include "wtf/HashMap.h"
26 #include "wtf/StdLibExtras.h"
25 27
26 namespace WebCore { 28 namespace WebCore {
27 29
28 const StylePropertyShorthand& backgroundShorthand() 30 const StylePropertyShorthand& backgroundShorthand()
29 { 31 {
30 static const CSSPropertyID backgroundProperties[] = { 32 static const CSSPropertyID backgroundProperties[] = {
31 CSSPropertyBackgroundImage, 33 CSSPropertyBackgroundImage,
32 CSSPropertyBackgroundPositionX, 34 CSSPropertyBackgroundPositionX,
33 CSSPropertyBackgroundPositionY, 35 CSSPropertyBackgroundPositionY,
34 CSSPropertyBackgroundSize, 36 CSSPropertyBackgroundSize,
35 CSSPropertyBackgroundRepeatX, 37 CSSPropertyBackgroundRepeatX,
36 CSSPropertyBackgroundRepeatY, 38 CSSPropertyBackgroundRepeatY,
37 CSSPropertyBackgroundAttachment, 39 CSSPropertyBackgroundAttachment,
38 CSSPropertyBackgroundOrigin, 40 CSSPropertyBackgroundOrigin,
39 CSSPropertyBackgroundClip, 41 CSSPropertyBackgroundClip,
40 CSSPropertyBackgroundColor 42 CSSPropertyBackgroundColor
41 }; 43 };
42 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (background Properties, WTF_ARRAY_LENGTH(backgroundProperties))); 44 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (CSSPropert yBackground, backgroundProperties, WTF_ARRAY_LENGTH(backgroundProperties)));
43 return backgroundShorthand; 45 return backgroundShorthand;
44 } 46 }
45 47
46 const StylePropertyShorthand& backgroundPositionShorthand() 48 const StylePropertyShorthand& backgroundPositionShorthand()
47 { 49 {
48 static const CSSPropertyID backgroundPositionProperties[] = { CSSPropertyBac kgroundPositionX, CSSPropertyBackgroundPositionY }; 50 static const CSSPropertyID backgroundPositionProperties[] = { CSSPropertyBac kgroundPositionX, CSSPropertyBackgroundPositionY };
49 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundPositionLonghands, (ba ckgroundPositionProperties, WTF_ARRAY_LENGTH(backgroundPositionProperties))); 51 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundPositionLonghands, (CS SPropertyBackgroundPosition, backgroundPositionProperties, WTF_ARRAY_LENGTH(back groundPositionProperties)));
50 return backgroundPositionLonghands; 52 return backgroundPositionLonghands;
51 } 53 }
52 54
53 const StylePropertyShorthand& backgroundRepeatShorthand() 55 const StylePropertyShorthand& backgroundRepeatShorthand()
54 { 56 {
55 static const CSSPropertyID backgroundRepeatProperties[] = { CSSPropertyBackg roundRepeatX, CSSPropertyBackgroundRepeatY }; 57 static const CSSPropertyID backgroundRepeatProperties[] = { CSSPropertyBackg roundRepeatX, CSSPropertyBackgroundRepeatY };
56 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundRepeatLonghands, (back groundRepeatProperties, WTF_ARRAY_LENGTH(backgroundRepeatProperties))); 58 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundRepeatLonghands, (CSSP ropertyBackgroundRepeat, backgroundRepeatProperties, WTF_ARRAY_LENGTH(background RepeatProperties)));
57 return backgroundRepeatLonghands; 59 return backgroundRepeatLonghands;
58 } 60 }
59 61
60 const StylePropertyShorthand& borderShorthand() 62 const StylePropertyShorthand& borderShorthand()
61 { 63 {
62 // Do not change the order of the following four shorthands, and keep them t ogether. 64 // Do not change the order of the following four shorthands, and keep them t ogether.
63 static const CSSPropertyID borderProperties[4][3] = { 65 static const CSSPropertyID borderProperties[4][3] = {
64 { CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorde rTopWidth }, 66 { CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorde rTopWidth },
65 { CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyB orderRightWidth }, 67 { CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyB orderRightWidth },
66 { CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropert yBorderBottomWidth }, 68 { CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropert yBorderBottomWidth },
67 { CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBor derLeftWidth } 69 { CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBor derLeftWidth }
68 }; 70 };
69 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderLonghands, (borderProperti es[0], sizeof(borderProperties) / sizeof(borderProperties[0][0]))); 71 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderLonghands, (CSSPropertyBor der, borderProperties[0], sizeof(borderProperties) / sizeof(borderProperties[0][ 0])));
70 return borderLonghands; 72 return borderLonghands;
71 } 73 }
72 74
73 const StylePropertyShorthand& borderAbridgedShorthand() 75 const StylePropertyShorthand& borderAbridgedShorthand()
74 { 76 {
75 static const CSSPropertyID borderAbridgedProperties[] = { CSSPropertyBorderW idth, CSSPropertyBorderStyle, CSSPropertyBorderColor }; 77 static const CSSPropertyID borderAbridgedProperties[] = { CSSPropertyBorderW idth, CSSPropertyBorderStyle, CSSPropertyBorderColor };
76 static const StylePropertyShorthand* propertiesForInitialization[] = { 78 static const StylePropertyShorthand* propertiesForInitialization[] = {
77 &borderWidthShorthand(), 79 &borderWidthShorthand(),
78 &borderStyleShorthand(), 80 &borderStyleShorthand(),
79 &borderColorShorthand(), 81 &borderColorShorthand(),
80 }; 82 };
81 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderAbridgedLonghands, 83 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderAbridgedLonghands,
82 (borderAbridgedProperties, propertiesForInitialization, WTF_ARRAY_LENGTH (borderAbridgedProperties))); 84 (CSSPropertyBorder, borderAbridgedProperties, propertiesForInitializatio n, WTF_ARRAY_LENGTH(borderAbridgedProperties)));
83 return borderAbridgedLonghands; 85 return borderAbridgedLonghands;
84 } 86 }
85 87
86 const StylePropertyShorthand& borderBottomShorthand() 88 const StylePropertyShorthand& borderBottomShorthand()
87 { 89 {
88 static const CSSPropertyID borderBottomProperties[] = { CSSPropertyBorderBot tomWidth, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomColor }; 90 static const CSSPropertyID borderBottomProperties[] = { CSSPropertyBorderBot tomWidth, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomColor };
89 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderBottomLonghands, (borderBo ttomProperties, WTF_ARRAY_LENGTH(borderBottomProperties))); 91 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderBottomLonghands, (CSSPrope rtyBorderBottom, borderBottomProperties, WTF_ARRAY_LENGTH(borderBottomProperties )));
90 return borderBottomLonghands; 92 return borderBottomLonghands;
91 } 93 }
92 94
93 const StylePropertyShorthand& borderColorShorthand() 95 const StylePropertyShorthand& borderColorShorthand()
94 { 96 {
95 static const CSSPropertyID borderColorProperties[] = { 97 static const CSSPropertyID borderColorProperties[] = {
96 CSSPropertyBorderTopColor, 98 CSSPropertyBorderTopColor,
97 CSSPropertyBorderRightColor, 99 CSSPropertyBorderRightColor,
98 CSSPropertyBorderBottomColor, 100 CSSPropertyBorderBottomColor,
99 CSSPropertyBorderLeftColor 101 CSSPropertyBorderLeftColor
100 }; 102 };
101 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderColorLonghands, (borderCol orProperties, WTF_ARRAY_LENGTH(borderColorProperties))); 103 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderColorLonghands, (CSSProper tyBorderColor, borderColorProperties, WTF_ARRAY_LENGTH(borderColorProperties)));
102 return borderColorLonghands; 104 return borderColorLonghands;
103 } 105 }
104 106
105 const StylePropertyShorthand& borderImageShorthand() 107 const StylePropertyShorthand& borderImageShorthand()
106 { 108 {
107 static const CSSPropertyID borderImageProperties[] = { 109 static const CSSPropertyID borderImageProperties[] = {
108 CSSPropertyBorderImageSource, 110 CSSPropertyBorderImageSource,
109 CSSPropertyBorderImageSlice, 111 CSSPropertyBorderImageSlice,
110 CSSPropertyBorderImageWidth, 112 CSSPropertyBorderImageWidth,
111 CSSPropertyBorderImageOutset, 113 CSSPropertyBorderImageOutset,
112 CSSPropertyBorderImageRepeat 114 CSSPropertyBorderImageRepeat
113 }; 115 };
114 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderImageLonghands, (borderIma geProperties, WTF_ARRAY_LENGTH(borderImageProperties))); 116 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderImageLonghands, (CSSProper tyBorderImage, borderImageProperties, WTF_ARRAY_LENGTH(borderImageProperties)));
115 return borderImageLonghands; 117 return borderImageLonghands;
116 } 118 }
117 119
118 const StylePropertyShorthand& borderLeftShorthand() 120 const StylePropertyShorthand& borderLeftShorthand()
119 { 121 {
120 static const CSSPropertyID borderLeftProperties[] = { CSSPropertyBorderLeftW idth, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftColor }; 122 static const CSSPropertyID borderLeftProperties[] = { CSSPropertyBorderLeftW idth, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftColor };
121 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderLeftLonghands, (borderLeft Properties, WTF_ARRAY_LENGTH(borderLeftProperties))); 123 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderLeftLonghands, (CSSPropert yBorderLeft, borderLeftProperties, WTF_ARRAY_LENGTH(borderLeftProperties)));
122 return borderLeftLonghands; 124 return borderLeftLonghands;
123 } 125 }
124 126
125 const StylePropertyShorthand& borderRadiusShorthand() 127 const StylePropertyShorthand& borderRadiusShorthand()
126 { 128 {
127 static const CSSPropertyID borderRadiusProperties[] = { 129 static const CSSPropertyID borderRadiusProperties[] = {
128 CSSPropertyBorderTopLeftRadius, 130 CSSPropertyBorderTopLeftRadius,
129 CSSPropertyBorderTopRightRadius, 131 CSSPropertyBorderTopRightRadius,
130 CSSPropertyBorderBottomRightRadius, 132 CSSPropertyBorderBottomRightRadius,
131 CSSPropertyBorderBottomLeftRadius 133 CSSPropertyBorderBottomLeftRadius
132 }; 134 };
133 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRadiusLonghands, (borderRa diusProperties, WTF_ARRAY_LENGTH(borderRadiusProperties))); 135 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRadiusLonghands, (CSSPrope rtyBorderRadius, borderRadiusProperties, WTF_ARRAY_LENGTH(borderRadiusProperties )));
136 return borderRadiusLonghands;
137 }
138
139 const StylePropertyShorthand& webkitBorderRadiusShorthand()
140 {
141 static const CSSPropertyID borderRadiusProperties[] = {
142 CSSPropertyBorderTopLeftRadius,
143 CSSPropertyBorderTopRightRadius,
144 CSSPropertyBorderBottomRightRadius,
145 CSSPropertyBorderBottomLeftRadius
146 };
147 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRadiusLonghands, (CSSPrope rtyWebkitBorderRadius, borderRadiusProperties, WTF_ARRAY_LENGTH(borderRadiusProp erties)));
134 return borderRadiusLonghands; 148 return borderRadiusLonghands;
135 } 149 }
136 150
137 const StylePropertyShorthand& borderRightShorthand() 151 const StylePropertyShorthand& borderRightShorthand()
138 { 152 {
139 static const CSSPropertyID borderRightProperties[] = { CSSPropertyBorderRigh tWidth, CSSPropertyBorderRightStyle, CSSPropertyBorderRightColor }; 153 static const CSSPropertyID borderRightProperties[] = { CSSPropertyBorderRigh tWidth, CSSPropertyBorderRightStyle, CSSPropertyBorderRightColor };
140 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRightLonghands, (borderRig htProperties, WTF_ARRAY_LENGTH(borderRightProperties))); 154 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRightLonghands, (CSSProper tyBorderRight, borderRightProperties, WTF_ARRAY_LENGTH(borderRightProperties)));
141 return borderRightLonghands; 155 return borderRightLonghands;
142 } 156 }
143 157
144 const StylePropertyShorthand& borderSpacingShorthand() 158 const StylePropertyShorthand& borderSpacingShorthand()
145 { 159 {
146 static const CSSPropertyID borderSpacingProperties[] = { CSSPropertyWebkitBo rderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing }; 160 static const CSSPropertyID borderSpacingProperties[] = { CSSPropertyWebkitBo rderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing };
147 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderSpacingLonghands, (borderS pacingProperties, WTF_ARRAY_LENGTH(borderSpacingProperties))); 161 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderSpacingLonghands, (CSSProp ertyBorderSpacing, borderSpacingProperties, WTF_ARRAY_LENGTH(borderSpacingProper ties)));
148 return borderSpacingLonghands; 162 return borderSpacingLonghands;
149 } 163 }
150 164
151 const StylePropertyShorthand& borderStyleShorthand() 165 const StylePropertyShorthand& borderStyleShorthand()
152 { 166 {
153 static const CSSPropertyID borderStyleProperties[] = { 167 static const CSSPropertyID borderStyleProperties[] = {
154 CSSPropertyBorderTopStyle, 168 CSSPropertyBorderTopStyle,
155 CSSPropertyBorderRightStyle, 169 CSSPropertyBorderRightStyle,
156 CSSPropertyBorderBottomStyle, 170 CSSPropertyBorderBottomStyle,
157 CSSPropertyBorderLeftStyle 171 CSSPropertyBorderLeftStyle
158 }; 172 };
159 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderStyleLonghands, (borderSty leProperties, WTF_ARRAY_LENGTH(borderStyleProperties))); 173 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderStyleLonghands, (CSSProper tyBorderStyle, borderStyleProperties, WTF_ARRAY_LENGTH(borderStyleProperties)));
160 return borderStyleLonghands; 174 return borderStyleLonghands;
161 } 175 }
162 176
163 const StylePropertyShorthand& borderTopShorthand() 177 const StylePropertyShorthand& borderTopShorthand()
164 { 178 {
165 static const CSSPropertyID borderTopProperties[] = { CSSPropertyBorderTopWid th, CSSPropertyBorderTopStyle, CSSPropertyBorderTopColor }; 179 static const CSSPropertyID borderTopProperties[] = { CSSPropertyBorderTopWid th, CSSPropertyBorderTopStyle, CSSPropertyBorderTopColor };
166 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderTopLonghands, (borderTopPr operties, WTF_ARRAY_LENGTH(borderTopProperties))); 180 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderTopLonghands, (CSSProperty BorderTop, borderTopProperties, WTF_ARRAY_LENGTH(borderTopProperties)));
167 return borderTopLonghands; 181 return borderTopLonghands;
168 } 182 }
169 183
170 const StylePropertyShorthand& borderWidthShorthand() 184 const StylePropertyShorthand& borderWidthShorthand()
171 { 185 {
172 static const CSSPropertyID borderWidthProperties[] = { 186 static const CSSPropertyID borderWidthProperties[] = {
173 CSSPropertyBorderTopWidth, 187 CSSPropertyBorderTopWidth,
174 CSSPropertyBorderRightWidth, 188 CSSPropertyBorderRightWidth,
175 CSSPropertyBorderBottomWidth, 189 CSSPropertyBorderBottomWidth,
176 CSSPropertyBorderLeftWidth 190 CSSPropertyBorderLeftWidth
177 }; 191 };
178 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderWidthLonghands, (borderWid thProperties, WTF_ARRAY_LENGTH(borderWidthProperties))); 192 DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderWidthLonghands, (CSSProper tyBorderWidth, borderWidthProperties, WTF_ARRAY_LENGTH(borderWidthProperties)));
179 return borderWidthLonghands; 193 return borderWidthLonghands;
180 } 194 }
181 195
182 const StylePropertyShorthand& listStyleShorthand() 196 const StylePropertyShorthand& listStyleShorthand()
183 { 197 {
184 static const CSSPropertyID listStyleProperties[] = { 198 static const CSSPropertyID listStyleProperties[] = {
185 CSSPropertyListStyleType, 199 CSSPropertyListStyleType,
186 CSSPropertyListStylePosition, 200 CSSPropertyListStylePosition,
187 CSSPropertyListStyleImage 201 CSSPropertyListStyleImage
188 }; 202 };
189 DEFINE_STATIC_LOCAL(StylePropertyShorthand, listStyleLonghands, (listStylePr operties, WTF_ARRAY_LENGTH(listStyleProperties))); 203 DEFINE_STATIC_LOCAL(StylePropertyShorthand, listStyleLonghands, (CSSProperty ListStyle, listStyleProperties, WTF_ARRAY_LENGTH(listStyleProperties)));
190 return listStyleLonghands; 204 return listStyleLonghands;
191 } 205 }
192 206
193 const StylePropertyShorthand& fontShorthand() 207 const StylePropertyShorthand& fontShorthand()
194 { 208 {
195 static const CSSPropertyID fontProperties[] = { 209 static const CSSPropertyID fontProperties[] = {
196 CSSPropertyFontFamily, 210 CSSPropertyFontFamily,
197 CSSPropertyFontSize, 211 CSSPropertyFontSize,
198 CSSPropertyFontStyle, 212 CSSPropertyFontStyle,
199 CSSPropertyFontVariant, 213 CSSPropertyFontVariant,
200 CSSPropertyFontWeight, 214 CSSPropertyFontWeight,
201 CSSPropertyLineHeight 215 CSSPropertyLineHeight
202 }; 216 };
203 DEFINE_STATIC_LOCAL(StylePropertyShorthand, fontLonghands, (fontProperties, WTF_ARRAY_LENGTH(fontProperties))); 217 DEFINE_STATIC_LOCAL(StylePropertyShorthand, fontLonghands, (CSSPropertyFont, fontProperties, WTF_ARRAY_LENGTH(fontProperties)));
204 return fontLonghands; 218 return fontLonghands;
205 } 219 }
206 220
207 const StylePropertyShorthand& marginShorthand() 221 const StylePropertyShorthand& marginShorthand()
208 { 222 {
209 static const CSSPropertyID marginProperties[] = { 223 static const CSSPropertyID marginProperties[] = {
210 CSSPropertyMarginTop, 224 CSSPropertyMarginTop,
211 CSSPropertyMarginRight, 225 CSSPropertyMarginRight,
212 CSSPropertyMarginBottom, 226 CSSPropertyMarginBottom,
213 CSSPropertyMarginLeft 227 CSSPropertyMarginLeft
214 }; 228 };
215 DEFINE_STATIC_LOCAL(StylePropertyShorthand, marginLonghands, (marginProperti es, WTF_ARRAY_LENGTH(marginProperties))); 229 DEFINE_STATIC_LOCAL(StylePropertyShorthand, marginLonghands, (CSSPropertyMar gin, marginProperties, WTF_ARRAY_LENGTH(marginProperties)));
216 return marginLonghands; 230 return marginLonghands;
217 } 231 }
218 232
233 const StylePropertyShorthand& markerShorthand()
234 {
235 static const CSSPropertyID markerProperties[] = {
236 CSSPropertyMarkerStart,
237 CSSPropertyMarkerMid,
238 CSSPropertyMarkerEnd
239 };
240 DEFINE_STATIC_LOCAL(StylePropertyShorthand, markerLonghands, (CSSPropertyMar ker, markerProperties, WTF_ARRAY_LENGTH(markerProperties)));
241 return markerLonghands;
242 }
243
219 const StylePropertyShorthand& outlineShorthand() 244 const StylePropertyShorthand& outlineShorthand()
220 { 245 {
221 static const CSSPropertyID outlineProperties[] = { 246 static const CSSPropertyID outlineProperties[] = {
222 CSSPropertyOutlineColor, 247 CSSPropertyOutlineColor,
223 CSSPropertyOutlineStyle, 248 CSSPropertyOutlineStyle,
224 CSSPropertyOutlineWidth 249 CSSPropertyOutlineWidth
225 }; 250 };
226 DEFINE_STATIC_LOCAL(StylePropertyShorthand, outlineLonghands, (outlineProper ties, WTF_ARRAY_LENGTH(outlineProperties))); 251 DEFINE_STATIC_LOCAL(StylePropertyShorthand, outlineLonghands, (CSSPropertyOu tline, outlineProperties, WTF_ARRAY_LENGTH(outlineProperties)));
227 return outlineLonghands; 252 return outlineLonghands;
228 } 253 }
229 254
230 const StylePropertyShorthand& overflowShorthand() 255 const StylePropertyShorthand& overflowShorthand()
231 { 256 {
232 static const CSSPropertyID overflowProperties[] = { CSSPropertyOverflowX, CS SPropertyOverflowY }; 257 static const CSSPropertyID overflowProperties[] = { CSSPropertyOverflowX, CS SPropertyOverflowY };
233 DEFINE_STATIC_LOCAL(StylePropertyShorthand, overflowLonghands, (overflowProp erties, WTF_ARRAY_LENGTH(overflowProperties))); 258 DEFINE_STATIC_LOCAL(StylePropertyShorthand, overflowLonghands, (CSSPropertyO verflow, overflowProperties, WTF_ARRAY_LENGTH(overflowProperties)));
234 return overflowLonghands; 259 return overflowLonghands;
235 } 260 }
236 261
237 const StylePropertyShorthand& paddingShorthand() 262 const StylePropertyShorthand& paddingShorthand()
238 { 263 {
239 static const CSSPropertyID paddingProperties[] = { 264 static const CSSPropertyID paddingProperties[] = {
240 CSSPropertyPaddingTop, 265 CSSPropertyPaddingTop,
241 CSSPropertyPaddingRight, 266 CSSPropertyPaddingRight,
242 CSSPropertyPaddingBottom, 267 CSSPropertyPaddingBottom,
243 CSSPropertyPaddingLeft 268 CSSPropertyPaddingLeft
244 }; 269 };
245 DEFINE_STATIC_LOCAL(StylePropertyShorthand, paddingLonghands, (paddingProper ties, WTF_ARRAY_LENGTH(paddingProperties))); 270 DEFINE_STATIC_LOCAL(StylePropertyShorthand, paddingLonghands, (CSSPropertyPa dding, paddingProperties, WTF_ARRAY_LENGTH(paddingProperties)));
246 return paddingLonghands; 271 return paddingLonghands;
247 } 272 }
248 273
249 const StylePropertyShorthand& transitionShorthand() 274 const StylePropertyShorthand& transitionShorthand()
250 { 275 {
251 static const CSSPropertyID transitionProperties[] = { 276 static const CSSPropertyID transitionProperties[] = {
252 CSSPropertyTransitionProperty, 277 CSSPropertyTransitionProperty,
253 CSSPropertyTransitionDuration, 278 CSSPropertyTransitionDuration,
254 CSSPropertyTransitionTimingFunction, 279 CSSPropertyTransitionTimingFunction,
255 CSSPropertyTransitionDelay 280 CSSPropertyTransitionDelay
256 }; 281 };
257 DEFINE_STATIC_LOCAL(StylePropertyShorthand, transitionLonghands, (transition Properties, WTF_ARRAY_LENGTH(transitionProperties))); 282 DEFINE_STATIC_LOCAL(StylePropertyShorthand, transitionLonghands, (CSSPropert yTransition, transitionProperties, WTF_ARRAY_LENGTH(transitionProperties)));
258 return transitionLonghands; 283 return transitionLonghands;
259 } 284 }
260 285
261 const StylePropertyShorthand& webkitAnimationShorthand() 286 const StylePropertyShorthand& webkitAnimationShorthand()
262 { 287 {
263 static const CSSPropertyID animationProperties[] = { 288 static const CSSPropertyID animationProperties[] = {
264 CSSPropertyWebkitAnimationName, 289 CSSPropertyWebkitAnimationName,
265 CSSPropertyWebkitAnimationDuration, 290 CSSPropertyWebkitAnimationDuration,
266 CSSPropertyWebkitAnimationTimingFunction, 291 CSSPropertyWebkitAnimationTimingFunction,
267 CSSPropertyWebkitAnimationDelay, 292 CSSPropertyWebkitAnimationDelay,
268 CSSPropertyWebkitAnimationIterationCount, 293 CSSPropertyWebkitAnimationIterationCount,
269 CSSPropertyWebkitAnimationDirection, 294 CSSPropertyWebkitAnimationDirection,
270 CSSPropertyWebkitAnimationFillMode 295 CSSPropertyWebkitAnimationFillMode
271 }; 296 };
272 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghands, (anima tionProperties, WTF_ARRAY_LENGTH(animationProperties))); 297 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghands, (CSSPr opertyWebkitAnimation, animationProperties, WTF_ARRAY_LENGTH(animationProperties )));
273 return webkitAnimationLonghands; 298 return webkitAnimationLonghands;
274 } 299 }
275 300
276 const StylePropertyShorthand& webkitAnimationShorthandForParsing() 301 const StylePropertyShorthand& webkitAnimationShorthandForParsing()
277 { 302 {
278 // When we parse the animation shorthand we need to look for animation-name 303 // When we parse the animation shorthand we need to look for animation-name
279 // last because otherwise it might match against the keywords for fill mode, 304 // last because otherwise it might match against the keywords for fill mode,
280 // timing functions and infinite iteration. This means that animation names 305 // timing functions and infinite iteration. This means that animation names
281 // that are the same as keywords (e.g. 'forwards') won't always match in the 306 // that are the same as keywords (e.g. 'forwards') won't always match in the
282 // shorthand. In that case the authors should be using longhands (or 307 // shorthand. In that case the authors should be using longhands (or
283 // reconsidering their approach). This is covered by the animations spec 308 // reconsidering their approach). This is covered by the animations spec
284 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790 309 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790
285 // And in the spec (editor's draft) at: 310 // And in the spec (editor's draft) at:
286 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property 311 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property
287 static const CSSPropertyID animationPropertiesForParsing[] = { 312 static const CSSPropertyID animationPropertiesForParsing[] = {
288 CSSPropertyWebkitAnimationDuration, 313 CSSPropertyWebkitAnimationDuration,
289 CSSPropertyWebkitAnimationTimingFunction, 314 CSSPropertyWebkitAnimationTimingFunction,
290 CSSPropertyWebkitAnimationDelay, 315 CSSPropertyWebkitAnimationDelay,
291 CSSPropertyWebkitAnimationIterationCount, 316 CSSPropertyWebkitAnimationIterationCount,
292 CSSPropertyWebkitAnimationDirection, 317 CSSPropertyWebkitAnimationDirection,
293 CSSPropertyWebkitAnimationFillMode, 318 CSSPropertyWebkitAnimationFillMode,
294 CSSPropertyWebkitAnimationName 319 CSSPropertyWebkitAnimationName
295 }; 320 };
296 321
297 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi ng, (animationPropertiesForParsing, WTF_ARRAY_LENGTH(animationPropertiesForParsi ng))); 322 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi ng, (CSSPropertyWebkitAnimation, animationPropertiesForParsing, WTF_ARRAY_LENGTH (animationPropertiesForParsing)));
298 return webkitAnimationLonghandsForParsing; 323 return webkitAnimationLonghandsForParsing;
299 } 324 }
300 325
301 const StylePropertyShorthand& webkitBorderAfterShorthand() 326 const StylePropertyShorthand& webkitBorderAfterShorthand()
302 { 327 {
303 static const CSSPropertyID borderAfterProperties[] = { CSSPropertyWebkitBord erAfterWidth, CSSPropertyWebkitBorderAfterStyle, CSSPropertyWebkitBorderAfterCol or }; 328 static const CSSPropertyID borderAfterProperties[] = { CSSPropertyWebkitBord erAfterWidth, CSSPropertyWebkitBorderAfterStyle, CSSPropertyWebkitBorderAfterCol or };
304 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderAfterLonghands, (bor derAfterProperties, WTF_ARRAY_LENGTH(borderAfterProperties))); 329 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderAfterLonghands, (CSS PropertyWebkitBorderAfter, borderAfterProperties, WTF_ARRAY_LENGTH(borderAfterPr operties)));
305 return webkitBorderAfterLonghands; 330 return webkitBorderAfterLonghands;
306 } 331 }
307 332
308 const StylePropertyShorthand& webkitBorderBeforeShorthand() 333 const StylePropertyShorthand& webkitBorderBeforeShorthand()
309 { 334 {
310 static const CSSPropertyID borderBeforeProperties[] = { CSSPropertyWebkitBor derBeforeWidth, CSSPropertyWebkitBorderBeforeStyle, CSSPropertyWebkitBorderBefor eColor }; 335 static const CSSPropertyID borderBeforeProperties[] = { CSSPropertyWebkitBor derBeforeWidth, CSSPropertyWebkitBorderBeforeStyle, CSSPropertyWebkitBorderBefor eColor };
311 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderBeforeLonghands, (bo rderBeforeProperties, WTF_ARRAY_LENGTH(borderBeforeProperties))); 336 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderBeforeLonghands, (CS SPropertyWebkitBorderBefore, borderBeforeProperties, WTF_ARRAY_LENGTH(borderBefo reProperties)));
312 return webkitBorderBeforeLonghands; 337 return webkitBorderBeforeLonghands;
313 } 338 }
314 339
315 const StylePropertyShorthand& webkitBorderEndShorthand() 340 const StylePropertyShorthand& webkitBorderEndShorthand()
316 { 341 {
317 static const CSSPropertyID borderEndProperties[] = { CSSPropertyWebkitBorder EndWidth, CSSPropertyWebkitBorderEndStyle, CSSPropertyWebkitBorderEndColor }; 342 static const CSSPropertyID borderEndProperties[] = { CSSPropertyWebkitBorder EndWidth, CSSPropertyWebkitBorderEndStyle, CSSPropertyWebkitBorderEndColor };
318 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderEndLonghands, (borde rEndProperties, WTF_ARRAY_LENGTH(borderEndProperties))); 343 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderEndLonghands, (CSSPr opertyWebkitBorderEnd, borderEndProperties, WTF_ARRAY_LENGTH(borderEndProperties )));
319 return webkitBorderEndLonghands; 344 return webkitBorderEndLonghands;
320 } 345 }
321 346
322 const StylePropertyShorthand& webkitBorderStartShorthand() 347 const StylePropertyShorthand& webkitBorderStartShorthand()
323 { 348 {
324 static const CSSPropertyID borderStartProperties[] = { CSSPropertyWebkitBord erStartWidth, CSSPropertyWebkitBorderStartStyle, CSSPropertyWebkitBorderStartCol or }; 349 static const CSSPropertyID borderStartProperties[] = { CSSPropertyWebkitBord erStartWidth, CSSPropertyWebkitBorderStartStyle, CSSPropertyWebkitBorderStartCol or };
325 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderStartLonghands, (bor derStartProperties, WTF_ARRAY_LENGTH(borderStartProperties))); 350 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitBorderStartLonghands, (CSS PropertyWebkitBorderStart, borderStartProperties, WTF_ARRAY_LENGTH(borderStartPr operties)));
326 return webkitBorderStartLonghands; 351 return webkitBorderStartLonghands;
327 } 352 }
328 353
329 const StylePropertyShorthand& webkitColumnsShorthand() 354 const StylePropertyShorthand& webkitColumnsShorthand()
330 { 355 {
331 static const CSSPropertyID columnsProperties[] = { CSSPropertyWebkitColumnWi dth, CSSPropertyWebkitColumnCount }; 356 static const CSSPropertyID columnsProperties[] = { CSSPropertyWebkitColumnWi dth, CSSPropertyWebkitColumnCount };
332 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitColumnsLonghands, (columns Properties, WTF_ARRAY_LENGTH(columnsProperties))); 357 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitColumnsLonghands, (CSSProp ertyWebkitColumns, columnsProperties, WTF_ARRAY_LENGTH(columnsProperties)));
333 return webkitColumnsLonghands; 358 return webkitColumnsLonghands;
334 } 359 }
335 360
336 const StylePropertyShorthand& webkitColumnRuleShorthand() 361 const StylePropertyShorthand& webkitColumnRuleShorthand()
337 { 362 {
338 static const CSSPropertyID columnRuleProperties[] = { 363 static const CSSPropertyID columnRuleProperties[] = {
339 CSSPropertyWebkitColumnRuleWidth, 364 CSSPropertyWebkitColumnRuleWidth,
340 CSSPropertyWebkitColumnRuleStyle, 365 CSSPropertyWebkitColumnRuleStyle,
341 CSSPropertyWebkitColumnRuleColor, 366 CSSPropertyWebkitColumnRuleColor,
342 }; 367 };
343 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitColumnRuleLonghands, (colu mnRuleProperties, WTF_ARRAY_LENGTH(columnRuleProperties))); 368 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitColumnRuleLonghands, (CSSP ropertyWebkitColumnRule, columnRuleProperties, WTF_ARRAY_LENGTH(columnRuleProper ties)));
344 return webkitColumnRuleLonghands; 369 return webkitColumnRuleLonghands;
345 } 370 }
346 371
347 const StylePropertyShorthand& webkitFlexFlowShorthand() 372 const StylePropertyShorthand& webkitFlexFlowShorthand()
348 { 373 {
349 static const CSSPropertyID flexFlowProperties[] = { CSSPropertyWebkitFlexDir ection, CSSPropertyWebkitFlexWrap }; 374 static const CSSPropertyID flexFlowProperties[] = { CSSPropertyWebkitFlexDir ection, CSSPropertyWebkitFlexWrap };
350 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitFlexFlowLonghands, (flexFl owProperties, WTF_ARRAY_LENGTH(flexFlowProperties))); 375 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitFlexFlowLonghands, (CSSPro pertyWebkitFlexFlow, flexFlowProperties, WTF_ARRAY_LENGTH(flexFlowProperties)));
351 return webkitFlexFlowLonghands; 376 return webkitFlexFlowLonghands;
352 } 377 }
353 378
354 const StylePropertyShorthand& webkitFlexShorthand() 379 const StylePropertyShorthand& webkitFlexShorthand()
355 { 380 {
356 static const CSSPropertyID flexProperties[] = { CSSPropertyWebkitFlexGrow, C SSPropertyWebkitFlexShrink, CSSPropertyWebkitFlexBasis }; 381 static const CSSPropertyID flexProperties[] = { CSSPropertyWebkitFlexGrow, C SSPropertyWebkitFlexShrink, CSSPropertyWebkitFlexBasis };
357 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitFlexLonghands, (flexProper ties, WTF_ARRAY_LENGTH(flexProperties))); 382 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitFlexLonghands, (CSSPropert yWebkitFlex, flexProperties, WTF_ARRAY_LENGTH(flexProperties)));
358 return webkitFlexLonghands; 383 return webkitFlexLonghands;
359 } 384 }
360 385
361 const StylePropertyShorthand& webkitMarginCollapseShorthand() 386 const StylePropertyShorthand& webkitMarginCollapseShorthand()
362 { 387 {
363 static const CSSPropertyID marginCollapseProperties[] = { CSSPropertyWebkitM arginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse }; 388 static const CSSPropertyID marginCollapseProperties[] = { CSSPropertyWebkitM arginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse };
364 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMarginCollapseLonghands, ( marginCollapseProperties, WTF_ARRAY_LENGTH(marginCollapseProperties))); 389 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMarginCollapseLonghands, ( CSSPropertyWebkitMarginCollapse, marginCollapseProperties, WTF_ARRAY_LENGTH(marg inCollapseProperties)));
365 return webkitMarginCollapseLonghands; 390 return webkitMarginCollapseLonghands;
366 } 391 }
367 392
368 const StylePropertyShorthand& gridColumnShorthand() 393 const StylePropertyShorthand& gridColumnShorthand()
369 { 394 {
370 static const CSSPropertyID gridColumnProperties[] = { 395 static const CSSPropertyID gridColumnProperties[] = {
371 CSSPropertyGridStart, 396 CSSPropertyGridStart,
372 CSSPropertyGridEnd 397 CSSPropertyGridEnd
373 }; 398 };
374 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridColumnLonghands, (gridColumn Properties, WTF_ARRAY_LENGTH(gridColumnProperties))); 399 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridColumnLonghands, (CSSPropert yGridColumn, gridColumnProperties, WTF_ARRAY_LENGTH(gridColumnProperties)));
375 return gridColumnLonghands; 400 return gridColumnLonghands;
376 } 401 }
377 402
378 const StylePropertyShorthand& gridRowShorthand() 403 const StylePropertyShorthand& gridRowShorthand()
379 { 404 {
380 static const CSSPropertyID gridRowProperties[] = { 405 static const CSSPropertyID gridRowProperties[] = {
381 CSSPropertyGridBefore, 406 CSSPropertyGridBefore,
382 CSSPropertyGridAfter 407 CSSPropertyGridAfter
383 }; 408 };
384 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridRowLonghands, (gridRowProper ties, WTF_ARRAY_LENGTH(gridRowProperties))); 409 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridRowLonghands, (CSSPropertyGr idRow, gridRowProperties, WTF_ARRAY_LENGTH(gridRowProperties)));
385 return gridRowLonghands; 410 return gridRowLonghands;
386 } 411 }
387 412
388 const StylePropertyShorthand& gridAreaShorthand() 413 const StylePropertyShorthand& gridAreaShorthand()
389 { 414 {
390 static const CSSPropertyID gridAreaProperties[] = { 415 static const CSSPropertyID gridAreaProperties[] = {
391 CSSPropertyGridStart, 416 CSSPropertyGridStart,
392 CSSPropertyGridBefore, 417 CSSPropertyGridBefore,
393 CSSPropertyGridEnd, 418 CSSPropertyGridEnd,
394 CSSPropertyGridAfter 419 CSSPropertyGridAfter
395 }; 420 };
396 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridAreaLonghands, (gridAreaProp erties, WTF_ARRAY_LENGTH(gridAreaProperties))); 421 DEFINE_STATIC_LOCAL(StylePropertyShorthand, gridAreaLonghands, (CSSPropertyG ridArea, gridAreaProperties, WTF_ARRAY_LENGTH(gridAreaProperties)));
397 return gridAreaLonghands; 422 return gridAreaLonghands;
398 } 423 }
399 424
400 const StylePropertyShorthand& webkitMarqueeShorthand() 425 const StylePropertyShorthand& webkitMarqueeShorthand()
401 { 426 {
402 static const CSSPropertyID marqueeProperties[] = { 427 static const CSSPropertyID marqueeProperties[] = {
403 CSSPropertyWebkitMarqueeDirection, 428 CSSPropertyWebkitMarqueeDirection,
404 CSSPropertyWebkitMarqueeIncrement, 429 CSSPropertyWebkitMarqueeIncrement,
405 CSSPropertyWebkitMarqueeRepetition, 430 CSSPropertyWebkitMarqueeRepetition,
406 CSSPropertyWebkitMarqueeStyle, 431 CSSPropertyWebkitMarqueeStyle,
407 CSSPropertyWebkitMarqueeSpeed 432 CSSPropertyWebkitMarqueeSpeed
408 }; 433 };
409 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMarqueeLonghands, (marquee Properties, WTF_ARRAY_LENGTH(marqueeProperties))); 434 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMarqueeLonghands, (CSSProp ertyWebkitMarquee, marqueeProperties, WTF_ARRAY_LENGTH(marqueeProperties)));
410 return webkitMarqueeLonghands; 435 return webkitMarqueeLonghands;
411 } 436 }
412 437
413 const StylePropertyShorthand& webkitMaskShorthand() 438 const StylePropertyShorthand& webkitMaskShorthand()
414 { 439 {
415 static const CSSPropertyID maskProperties[] = { 440 static const CSSPropertyID maskProperties[] = {
416 CSSPropertyWebkitMaskImage, 441 CSSPropertyWebkitMaskImage,
417 CSSPropertyWebkitMaskPositionX, 442 CSSPropertyWebkitMaskPositionX,
418 CSSPropertyWebkitMaskPositionY, 443 CSSPropertyWebkitMaskPositionY,
419 CSSPropertyWebkitMaskSize, 444 CSSPropertyWebkitMaskSize,
420 CSSPropertyWebkitMaskRepeatX, 445 CSSPropertyWebkitMaskRepeatX,
421 CSSPropertyWebkitMaskRepeatY, 446 CSSPropertyWebkitMaskRepeatY,
422 CSSPropertyWebkitMaskOrigin, 447 CSSPropertyWebkitMaskOrigin,
423 CSSPropertyWebkitMaskClip 448 CSSPropertyWebkitMaskClip
424 }; 449 };
425 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskLonghands, (maskProper ties, WTF_ARRAY_LENGTH(maskProperties))); 450 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskLonghands, (CSSPropert yWebkitMask, maskProperties, WTF_ARRAY_LENGTH(maskProperties)));
426 return webkitMaskLonghands; 451 return webkitMaskLonghands;
427 } 452 }
428 453
429 const StylePropertyShorthand& webkitMaskPositionShorthand() 454 const StylePropertyShorthand& webkitMaskPositionShorthand()
430 { 455 {
431 static const CSSPropertyID maskPositionProperties[] = { CSSPropertyWebkitMas kPositionX, CSSPropertyWebkitMaskPositionY }; 456 static const CSSPropertyID maskPositionProperties[] = { CSSPropertyWebkitMas kPositionX, CSSPropertyWebkitMaskPositionY };
432 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskPositionLonghands, (ma skPositionProperties, WTF_ARRAY_LENGTH(maskPositionProperties))); 457 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskPositionLonghands, (CS SPropertyWebkitMaskPosition, maskPositionProperties, WTF_ARRAY_LENGTH(maskPositi onProperties)));
433 return webkitMaskPositionLonghands; 458 return webkitMaskPositionLonghands;
434 } 459 }
435 460
436 const StylePropertyShorthand& webkitMaskRepeatShorthand() 461 const StylePropertyShorthand& webkitMaskRepeatShorthand()
437 { 462 {
438 static const CSSPropertyID maskRepeatProperties[] = { CSSPropertyWebkitMaskR epeatX, CSSPropertyWebkitMaskRepeatY }; 463 static const CSSPropertyID maskRepeatProperties[] = { CSSPropertyWebkitMaskR epeatX, CSSPropertyWebkitMaskRepeatY };
439 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskRepeatLonghands, (mask RepeatProperties, WTF_ARRAY_LENGTH(maskRepeatProperties))); 464 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskRepeatLonghands, (CSSP ropertyWebkitMaskRepeat, maskRepeatProperties, WTF_ARRAY_LENGTH(maskRepeatProper ties)));
440 return webkitMaskRepeatLonghands; 465 return webkitMaskRepeatLonghands;
441 } 466 }
442 467
443 const StylePropertyShorthand& webkitTextEmphasisShorthand() 468 const StylePropertyShorthand& webkitTextEmphasisShorthand()
444 { 469 {
445 static const CSSPropertyID textEmphasisProperties[] = { 470 static const CSSPropertyID textEmphasisProperties[] = {
446 CSSPropertyWebkitTextEmphasisStyle, 471 CSSPropertyWebkitTextEmphasisStyle,
447 CSSPropertyWebkitTextEmphasisColor 472 CSSPropertyWebkitTextEmphasisColor
448 }; 473 };
449 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextEmphasisLonghands, (te xtEmphasisProperties, WTF_ARRAY_LENGTH(textEmphasisProperties))); 474 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextEmphasisLonghands, (CS SPropertyWebkitTextEmphasis, textEmphasisProperties, WTF_ARRAY_LENGTH(textEmphas isProperties)));
450 return webkitTextEmphasisLonghands; 475 return webkitTextEmphasisLonghands;
451 } 476 }
452 477
453 const StylePropertyShorthand& webkitTextStrokeShorthand() 478 const StylePropertyShorthand& webkitTextStrokeShorthand()
454 { 479 {
455 static const CSSPropertyID textStrokeProperties[] = { CSSPropertyWebkitTextS trokeWidth, CSSPropertyWebkitTextStrokeColor }; 480 static const CSSPropertyID textStrokeProperties[] = { CSSPropertyWebkitTextS trokeWidth, CSSPropertyWebkitTextStrokeColor };
456 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextStrokeLonghands, (text StrokeProperties, WTF_ARRAY_LENGTH(textStrokeProperties))); 481 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextStrokeLonghands, (CSSP ropertyWebkitTextStroke, textStrokeProperties, WTF_ARRAY_LENGTH(textStrokeProper ties)));
457 return webkitTextStrokeLonghands; 482 return webkitTextStrokeLonghands;
458 } 483 }
459 484
460 const StylePropertyShorthand& webkitTransitionShorthand() 485 const StylePropertyShorthand& webkitTransitionShorthand()
461 { 486 {
462 static const CSSPropertyID transitionProperties[] = { 487 static const CSSPropertyID transitionProperties[] = {
463 CSSPropertyWebkitTransitionProperty, 488 CSSPropertyWebkitTransitionProperty,
464 CSSPropertyWebkitTransitionDuration, 489 CSSPropertyWebkitTransitionDuration,
465 CSSPropertyWebkitTransitionTimingFunction, 490 CSSPropertyWebkitTransitionTimingFunction,
466 CSSPropertyWebkitTransitionDelay 491 CSSPropertyWebkitTransitionDelay
467 }; 492 };
468 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTransitionLonghands, (tran sitionProperties, WTF_ARRAY_LENGTH(transitionProperties))); 493 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTransitionLonghands, (CSSP ropertyWebkitTransition, transitionProperties, WTF_ARRAY_LENGTH(transitionProper ties)));
469 return webkitTransitionLonghands; 494 return webkitTransitionLonghands;
470 } 495 }
471 496
472 const StylePropertyShorthand& webkitTransformOriginShorthand() 497 const StylePropertyShorthand& webkitTransformOriginShorthand()
473 { 498 {
474 static const CSSPropertyID transformOriginProperties[] = { 499 static const CSSPropertyID transformOriginProperties[] = {
475 CSSPropertyWebkitTransformOriginX, 500 CSSPropertyWebkitTransformOriginX,
476 CSSPropertyWebkitTransformOriginY, 501 CSSPropertyWebkitTransformOriginY,
477 CSSPropertyWebkitTransformOriginZ 502 CSSPropertyWebkitTransformOriginZ
478 }; 503 };
479 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTransformOriginLonghands, (transformOriginProperties, WTF_ARRAY_LENGTH(transformOriginProperties))); 504 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTransformOriginLonghands, (CSSPropertyWebkitTransformOrigin, transformOriginProperties, WTF_ARRAY_LENGTH(t ransformOriginProperties)));
480 return webkitTransformOriginLonghands; 505 return webkitTransformOriginLonghands;
481 } 506 }
482 507
483 // Returns an empty list if the property is not a shorthand 508 // Returns an empty list if the property is not a shorthand
484 const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID) 509 const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID)
485 { 510 {
486 switch (propertyID) { 511 switch (propertyID) {
487 case CSSPropertyBackground: 512 case CSSPropertyBackground:
488 return backgroundShorthand(); 513 return backgroundShorthand();
489 case CSSPropertyBackgroundPosition: 514 case CSSPropertyBackgroundPosition:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // The system fonts bypass the normal style resolution by using RenderTheme, 607 // The system fonts bypass the normal style resolution by using RenderTheme,
583 // thus we need to special case it here. FIXME: This is a violation of CSS 3 Fonts 608 // thus we need to special case it here. FIXME: This is a violation of CSS 3 Fonts
584 // as we should still be able to change the longhands. 609 // as we should still be able to change the longhands.
585 // DON'T ADD ANY SHORTHAND HERE UNLESS IT ISN'T ALWAYS EXPANDED AT PARSE TIM E (which is wrong). 610 // DON'T ADD ANY SHORTHAND HERE UNLESS IT ISN'T ALWAYS EXPANDED AT PARSE TIM E (which is wrong).
586 if (id == CSSPropertyFont) 611 if (id == CSSPropertyFont)
587 return false; 612 return false;
588 613
589 return shorthandForProperty(id).length(); 614 return shorthandForProperty(id).length();
590 } 615 }
591 616
617 typedef HashMap<CSSPropertyID, Vector<StylePropertyShorthand> > longhandsMap;
618 const Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID propertyID)
619 {
620 DEFINE_STATIC_LOCAL(longhandsMap, map, ());
Julien - ping for review 2013/06/10 23:29:57 We discussed this and there should be a FIXME abou
621 if (map.isEmpty()) {
622 Vector<StylePropertyShorthand, 1> background;
623 background.uncheckedAppend(backgroundShorthand());
624 map.set(CSSPropertyBackgroundImage, background);
625 map.set(CSSPropertyBackgroundSize, background);
626 map.set(CSSPropertyBackgroundAttachment, background);
627 map.set(CSSPropertyBackgroundOrigin, background);
628 map.set(CSSPropertyBackgroundClip, background);
629 map.set(CSSPropertyBackgroundColor, background);
630
631 Vector<StylePropertyShorthand, 2> positionShorthands;
632 positionShorthands.uncheckedAppend(backgroundShorthand());
633 positionShorthands.uncheckedAppend(backgroundPositionShorthand());
634 map.set(CSSPropertyBackgroundPositionX, positionShorthands);
635 map.set(CSSPropertyBackgroundPositionY, positionShorthands);
636
637 Vector<StylePropertyShorthand, 2> repeatShorthands;
638 repeatShorthands.uncheckedAppend(backgroundShorthand());
639 repeatShorthands.uncheckedAppend(backgroundRepeatShorthand());
640 map.set(CSSPropertyBackgroundRepeatX, repeatShorthands);
641 map.set(CSSPropertyBackgroundRepeatY, repeatShorthands);
642
643 Vector<StylePropertyShorthand, 3> bottomWidthShorthands;
644 bottomWidthShorthands.uncheckedAppend(borderShorthand());
645 bottomWidthShorthands.uncheckedAppend(borderBottomShorthand());
646 bottomWidthShorthands.uncheckedAppend(borderWidthShorthand());
647 map.set(CSSPropertyBorderBottomWidth, bottomWidthShorthands);
648
649 Vector<StylePropertyShorthand, 3> topColorShorthands;
650 topColorShorthands.uncheckedAppend(borderShorthand());
651 topColorShorthands.uncheckedAppend(borderTopShorthand());
652 topColorShorthands.uncheckedAppend(borderColorShorthand());
653 map.set(CSSPropertyBorderTopColor, topColorShorthands);
654
655 Vector<StylePropertyShorthand, 3> rightColorShorthands;
656 rightColorShorthands.uncheckedAppend(borderShorthand());
657 rightColorShorthands.uncheckedAppend(borderRightShorthand());
658 rightColorShorthands.uncheckedAppend(borderColorShorthand());
659 map.set(CSSPropertyBorderRightColor, rightColorShorthands);
660
661 Vector<StylePropertyShorthand, 3> leftColorShorthands;
662 leftColorShorthands.uncheckedAppend(borderShorthand());
663 leftColorShorthands.uncheckedAppend(borderLeftShorthand());
664 leftColorShorthands.uncheckedAppend(borderColorShorthand());
665 map.set(CSSPropertyBorderLeftColor, leftColorShorthands);
666
667 Vector<StylePropertyShorthand, 3> bottomColorShorthands;
668 bottomColorShorthands.uncheckedAppend(borderShorthand());
669 bottomColorShorthands.uncheckedAppend(borderBottomShorthand());
670 bottomColorShorthands.uncheckedAppend(borderColorShorthand());
671 map.set(CSSPropertyBorderBottomColor, bottomColorShorthands);
672
673 Vector<StylePropertyShorthand, 1> borderImage;
674 borderImage.uncheckedAppend(borderImageShorthand());
675 map.set(CSSPropertyBorderImageSource, borderImage);
676 map.set(CSSPropertyBorderImageSlice, borderImage);
677 map.set(CSSPropertyBorderImageWidth, borderImage);
678 map.set(CSSPropertyBorderImageOutset, borderImage);
679 map.set(CSSPropertyBorderImageRepeat, borderImage);
680
681 Vector<StylePropertyShorthand, 3> leftWidthShorthands;
682 leftWidthShorthands.uncheckedAppend(borderShorthand());
683 leftWidthShorthands.uncheckedAppend(borderLeftShorthand());
684 leftWidthShorthands.uncheckedAppend(borderWidthShorthand());
685 map.set(CSSPropertyBorderLeftWidth, leftWidthShorthands);
686
687 Vector<StylePropertyShorthand, 2> radiusShorthands;
688 radiusShorthands.uncheckedAppend(borderRadiusShorthand());
689 radiusShorthands.uncheckedAppend(webkitBorderRadiusShorthand());
690 map.set(CSSPropertyBorderTopLeftRadius, radiusShorthands);
691 map.set(CSSPropertyBorderTopRightRadius, radiusShorthands);
692 map.set(CSSPropertyBorderBottomRightRadius, radiusShorthands);
693 map.set(CSSPropertyBorderBottomLeftRadius, radiusShorthands);
694
695 Vector<StylePropertyShorthand, 3> rightWidthShorthands;
696 rightWidthShorthands.uncheckedAppend(borderShorthand());
697 rightWidthShorthands.uncheckedAppend(borderRightShorthand());
698 rightWidthShorthands.uncheckedAppend(borderWidthShorthand());
699 map.set(CSSPropertyBorderRightWidth, rightWidthShorthands);
700
701 Vector<StylePropertyShorthand, 1> spacingShorthand;
702 spacingShorthand.uncheckedAppend(borderSpacingShorthand());
703 map.set(CSSPropertyWebkitBorderHorizontalSpacing, spacingShorthand);
704 map.set(CSSPropertyWebkitBorderVerticalSpacing, spacingShorthand);
705
706 Vector<StylePropertyShorthand, 3> topStyleShorthands;
707 topStyleShorthands.uncheckedAppend(borderShorthand());
708 topStyleShorthands.uncheckedAppend(borderTopShorthand());
709 topStyleShorthands.uncheckedAppend(borderStyleShorthand());
710 map.set(CSSPropertyBorderTopStyle, topStyleShorthands);
711
712 Vector<StylePropertyShorthand, 3> bottomStyleShorthands;
713 bottomStyleShorthands.uncheckedAppend(borderShorthand());
714 bottomStyleShorthands.uncheckedAppend(borderBottomShorthand());
715 bottomStyleShorthands.uncheckedAppend(borderStyleShorthand());
716 map.set(CSSPropertyBorderBottomStyle, bottomStyleShorthands);
717
718 Vector<StylePropertyShorthand, 3> leftStyleShorthands;
719 leftStyleShorthands.uncheckedAppend(borderShorthand());
720 leftStyleShorthands.uncheckedAppend(borderLeftShorthand());
721 leftStyleShorthands.uncheckedAppend(borderStyleShorthand());
722 map.set(CSSPropertyBorderLeftStyle, leftStyleShorthands);
723
724 Vector<StylePropertyShorthand, 3> rightStyleShorthands;
725 rightStyleShorthands.uncheckedAppend(borderShorthand());
726 rightStyleShorthands.uncheckedAppend(borderRightShorthand());
727 rightStyleShorthands.uncheckedAppend(borderStyleShorthand());
728 map.set(CSSPropertyBorderRightStyle, rightStyleShorthands);
729
730 Vector<StylePropertyShorthand, 3> topWidthShorthands;
731 topWidthShorthands.uncheckedAppend(borderShorthand());
732 topWidthShorthands.uncheckedAppend(borderTopShorthand());
733 topWidthShorthands.uncheckedAppend(borderWidthShorthand());
734 map.set(CSSPropertyBorderTopWidth, topWidthShorthands);
735
736 Vector<StylePropertyShorthand, 1> listStyle;
737 listStyle.uncheckedAppend(listStyleShorthand());
738 map.set(CSSPropertyListStyleType, listStyle);
739 map.set(CSSPropertyListStylePosition, listStyle);
740 map.set(CSSPropertyListStyleImage, listStyle);
741
742 Vector<StylePropertyShorthand, 1> font;
743 font.uncheckedAppend(fontShorthand());
744 map.set(CSSPropertyFontFamily, font);
745 map.set(CSSPropertyFontSize, font);
746 map.set(CSSPropertyFontStyle, font);
747 map.set(CSSPropertyFontVariant, font);
748 map.set(CSSPropertyFontWeight, font);
749 map.set(CSSPropertyLineHeight, font);
750
751 Vector<StylePropertyShorthand, 1> margin;
752 margin.uncheckedAppend(marginShorthand());
753 map.set(CSSPropertyMarginTop, margin);
754 map.set(CSSPropertyMarginRight, margin);
755 map.set(CSSPropertyMarginBottom, margin);
756 map.set(CSSPropertyMarginLeft, margin);
757
758 Vector<StylePropertyShorthand, 1> marker;
759 marker.uncheckedAppend(markerShorthand());
760 map.set(CSSPropertyMarkerStart, marker);
761 map.set(CSSPropertyMarkerMid, marker);
762 map.set(CSSPropertyMarkerEnd, marker);
763
764 Vector<StylePropertyShorthand, 1> outline;
765 outline.uncheckedAppend(outlineShorthand());
766 map.set(CSSPropertyOutlineColor, outline);
767 map.set(CSSPropertyOutlineStyle, outline);
768 map.set(CSSPropertyOutlineWidth, outline);
769
770 Vector<StylePropertyShorthand, 1> padding;
771 padding.uncheckedAppend(paddingShorthand());
772 map.set(CSSPropertyPaddingTop, padding);
773 map.set(CSSPropertyPaddingRight, padding);
774 map.set(CSSPropertyPaddingBottom, padding);
775 map.set(CSSPropertyPaddingLeft, padding);
776
777 Vector<StylePropertyShorthand, 1> overflow;
778 overflow.uncheckedAppend(overflowShorthand());
779 map.set(CSSPropertyOverflowX, overflow);
780 map.set(CSSPropertyOverflowY, overflow);
781
782 Vector<StylePropertyShorthand, 1> transition;
783 transition.uncheckedAppend(transitionShorthand());
784 map.set(CSSPropertyTransitionProperty, transition);
785 map.set(CSSPropertyTransitionDuration, transition);
786 map.set(CSSPropertyTransitionTimingFunction, transition);
787 map.set(CSSPropertyTransitionDelay, transition);
788
789 Vector<StylePropertyShorthand, 1> animation;
790 animation.uncheckedAppend(webkitAnimationShorthand());
791 map.set(CSSPropertyWebkitAnimationName, animation);
792 map.set(CSSPropertyWebkitAnimationDuration, animation);
793 map.set(CSSPropertyWebkitAnimationTimingFunction, animation);
794 map.set(CSSPropertyWebkitAnimationDelay, animation);
795 map.set(CSSPropertyWebkitAnimationIterationCount, animation);
796 map.set(CSSPropertyWebkitAnimationDirection, animation);
797 map.set(CSSPropertyWebkitAnimationFillMode, animation);
798
799 Vector<StylePropertyShorthand, 1> borderAfter;
800 borderAfter.uncheckedAppend(webkitBorderAfterShorthand());
801 map.set(CSSPropertyWebkitBorderAfterWidth, borderAfter);
802 map.set(CSSPropertyWebkitBorderAfterStyle, borderAfter);
803 map.set(CSSPropertyWebkitBorderAfterColor, borderAfter);
804
805 Vector<StylePropertyShorthand, 1> borderBefore;
806 borderBefore.uncheckedAppend(webkitBorderBeforeShorthand());
807 map.set(CSSPropertyWebkitBorderBeforeWidth, borderBefore);
808 map.set(CSSPropertyWebkitBorderBeforeStyle, borderBefore);
809 map.set(CSSPropertyWebkitBorderBeforeColor, borderBefore);
810
811 Vector<StylePropertyShorthand, 1> borderEnd;
812 borderEnd.uncheckedAppend(webkitBorderEndShorthand());
813 map.set(CSSPropertyWebkitBorderEndWidth, borderEnd);
814 map.set(CSSPropertyWebkitBorderEndStyle, borderEnd);
815 map.set(CSSPropertyWebkitBorderEndColor, borderEnd);
816
817 Vector<StylePropertyShorthand, 1> borderStart;
818 borderStart.uncheckedAppend(webkitBorderStartShorthand());
819 map.set(CSSPropertyWebkitBorderStartWidth, borderStart);
820 map.set(CSSPropertyWebkitBorderStartStyle, borderStart);
821 map.set(CSSPropertyWebkitBorderStartColor, borderStart);
822
823 Vector<StylePropertyShorthand, 1> columns;
824 columns.uncheckedAppend(webkitColumnsShorthand());
825 map.set(CSSPropertyWebkitColumnWidth, columns);
826 map.set(CSSPropertyWebkitColumnCount, columns);
827
828 Vector<StylePropertyShorthand, 1> columnRule;
829 columnRule.uncheckedAppend(webkitColumnRuleShorthand());
830 map.set(CSSPropertyWebkitColumnRuleWidth, columnRule);
831 map.set(CSSPropertyWebkitColumnRuleStyle, columnRule);
832 map.set(CSSPropertyWebkitColumnRuleColor, columnRule);
833
834 Vector<StylePropertyShorthand, 1> flex;
835 flex.uncheckedAppend(webkitFlexShorthand());
836 map.set(CSSPropertyWebkitFlexGrow, flex);
837 map.set(CSSPropertyWebkitFlexShrink, flex);
838 map.set(CSSPropertyWebkitFlexBasis, flex);
839
840 Vector<StylePropertyShorthand, 1> flexFlow;
841 flexFlow.uncheckedAppend(webkitFlexFlowShorthand());
842 map.set(CSSPropertyWebkitFlexDirection, flexFlow);
843 map.set(CSSPropertyWebkitFlexWrap, flexFlow);
844
845 Vector<StylePropertyShorthand, 2> grid;
846 grid.uncheckedAppend(gridAreaShorthand());
847 grid.uncheckedAppend(gridColumnShorthand());
848 map.set(CSSPropertyGridStart, grid);
849 map.set(CSSPropertyGridEnd, grid);
850
851 Vector<StylePropertyShorthand, 2> gridAfter;
852 gridAfter.uncheckedAppend(gridAreaShorthand());
853 gridAfter.uncheckedAppend(gridRowShorthand());
854 map.set(CSSPropertyGridBefore, gridAfter);
855 map.set(CSSPropertyGridAfter, gridAfter);
856
857 Vector<StylePropertyShorthand, 1> marginCollapse;
858 marginCollapse.uncheckedAppend(webkitMarginCollapseShorthand());
859 map.set(CSSPropertyWebkitMarginBeforeCollapse, marginCollapse);
860 map.set(CSSPropertyWebkitMarginAfterCollapse, marginCollapse);
861
862 Vector<StylePropertyShorthand, 1> marquee;
863 marquee.uncheckedAppend(webkitMarqueeShorthand());
864 map.set(CSSPropertyWebkitMarqueeDirection, marquee);
865 map.set(CSSPropertyWebkitMarqueeIncrement, marquee);
866 map.set(CSSPropertyWebkitMarqueeRepetition, marquee);
867 map.set(CSSPropertyWebkitMarqueeStyle, marquee);
868 map.set(CSSPropertyWebkitMarqueeSpeed, marquee);
869
870 Vector<StylePropertyShorthand, 1> mask;
871 mask.uncheckedAppend(webkitMaskShorthand());
872 map.set(CSSPropertyWebkitMaskImage, mask);
873 map.set(CSSPropertyWebkitMaskSize, mask);
874 map.set(CSSPropertyWebkitMaskOrigin, mask);
875 map.set(CSSPropertyWebkitMaskClip, mask);
876
877 Vector<StylePropertyShorthand, 1> maskPosition;
878 maskPosition.uncheckedAppend(webkitMaskPositionShorthand());
879 map.set(CSSPropertyWebkitMaskPositionX, maskPosition);
880 map.set(CSSPropertyWebkitMaskPositionY, maskPosition);
881
882 Vector<StylePropertyShorthand, 1> maskRepeat;
883 maskRepeat.uncheckedAppend(webkitMaskRepeatShorthand());
884 map.set(CSSPropertyWebkitMaskRepeatX, maskRepeat);
885 map.set(CSSPropertyWebkitMaskRepeatY, maskRepeat);
886
887 Vector<StylePropertyShorthand, 1> textEmphasis;
888 textEmphasis.uncheckedAppend(webkitTextEmphasisShorthand());
889 map.set(CSSPropertyWebkitTextEmphasisStyle, textEmphasis);
890 map.set(CSSPropertyWebkitTextEmphasisColor, textEmphasis);
891
892 Vector<StylePropertyShorthand, 1> textStroke;
893 textStroke.uncheckedAppend(webkitTextStrokeShorthand());
894 map.set(CSSPropertyWebkitTextStrokeWidth, textStroke);
895 map.set(CSSPropertyWebkitTextStrokeColor, textStroke);
896
897 Vector<StylePropertyShorthand, 1> webkitTransition;
898 webkitTransition.uncheckedAppend(webkitTransitionShorthand());
899 map.set(CSSPropertyWebkitTransitionProperty, webkitTransition);
900 map.set(CSSPropertyWebkitTransitionDuration, webkitTransition);
901 map.set(CSSPropertyWebkitTransitionTimingFunction, webkitTransition);
902 map.set(CSSPropertyWebkitTransitionDelay, webkitTransition);
903
904 Vector<StylePropertyShorthand, 1> transform;
905 transform.uncheckedAppend(webkitTransformOriginShorthand());
906 map.set(CSSPropertyWebkitTransformOriginX, transform);
907 map.set(CSSPropertyWebkitTransformOriginY, transform);
908 map.set(CSSPropertyWebkitTransformOriginZ, transform);
909 }
910 return map.get(propertyID);
911 }
912
913 unsigned indexOfShorthandForLonghand(CSSPropertyID shorthandID, const Vector<Sty lePropertyShorthand>& shorthands)
914 {
915 for (unsigned i = 0; i < shorthands.size(); ++i) {
916 if (shorthands.at(i).id() == shorthandID)
917 return i;
918 }
919 ASSERT_NOT_REACHED();
920 return 0;
921 }
922
592 } // namespace WebCore 923 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698