| 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, 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 |
| 508 const StylePropertyShorthand& widthShorthand() |
| 509 { |
| 510 static const CSSPropertyID widthProperties[] = { |
| 511 CSSPropertyMinWidth, |
| 512 CSSPropertyMaxWidth |
| 513 }; |
| 514 DEFINE_STATIC_LOCAL(StylePropertyShorthand, widthLonghands, (CSSPropertyWidt
h, widthProperties, WTF_ARRAY_LENGTH(widthProperties))); |
| 515 return widthLonghands; |
| 516 } |
| 517 |
| 518 const StylePropertyShorthand& heightShorthand() |
| 519 { |
| 520 static const CSSPropertyID heightProperties[] = { |
| 521 CSSPropertyMinHeight, |
| 522 CSSPropertyMaxHeight |
| 523 }; |
| 524 DEFINE_STATIC_LOCAL(StylePropertyShorthand, heightLonghands, (CSSPropertyHei
ght, heightProperties, WTF_ARRAY_LENGTH(heightProperties))); |
| 525 return heightLonghands; |
| 526 } |
| 527 |
| 483 // Returns an empty list if the property is not a shorthand | 528 // Returns an empty list if the property is not a shorthand |
| 484 const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID) | 529 const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID) |
| 485 { | 530 { |
| 486 switch (propertyID) { | 531 switch (propertyID) { |
| 487 case CSSPropertyBackground: | 532 case CSSPropertyBackground: |
| 488 return backgroundShorthand(); | 533 return backgroundShorthand(); |
| 489 case CSSPropertyBackgroundPosition: | 534 case CSSPropertyBackgroundPosition: |
| 490 return backgroundPositionShorthand(); | 535 return backgroundPositionShorthand(); |
| 491 case CSSPropertyBackgroundRepeat: | 536 case CSSPropertyBackgroundRepeat: |
| 492 return backgroundRepeatShorthand(); | 537 return backgroundRepeatShorthand(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 // The system fonts bypass the normal style resolution by using RenderTheme, | 627 // 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 | 628 // 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. | 629 // 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). | 630 // DON'T ADD ANY SHORTHAND HERE UNLESS IT ISN'T ALWAYS EXPANDED AT PARSE TIM
E (which is wrong). |
| 586 if (id == CSSPropertyFont) | 631 if (id == CSSPropertyFont) |
| 587 return false; | 632 return false; |
| 588 | 633 |
| 589 return shorthandForProperty(id).length(); | 634 return shorthandForProperty(id).length(); |
| 590 } | 635 } |
| 591 | 636 |
| 637 // FIXME : We need to generate all of this. |
| 638 typedef HashMap<CSSPropertyID, Vector<StylePropertyShorthand> > longhandsMap; |
| 639 const Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID
propertyID) |
| 640 { |
| 641 DEFINE_STATIC_LOCAL(longhandsMap, map, ()); |
| 642 if (map.isEmpty()) { |
| 643 Vector<StylePropertyShorthand, 1> background; |
| 644 background.uncheckedAppend(backgroundShorthand()); |
| 645 map.set(CSSPropertyBackgroundImage, background); |
| 646 map.set(CSSPropertyBackgroundSize, background); |
| 647 map.set(CSSPropertyBackgroundAttachment, background); |
| 648 map.set(CSSPropertyBackgroundOrigin, background); |
| 649 map.set(CSSPropertyBackgroundClip, background); |
| 650 map.set(CSSPropertyBackgroundColor, background); |
| 651 |
| 652 Vector<StylePropertyShorthand, 2> positionShorthands; |
| 653 positionShorthands.uncheckedAppend(backgroundShorthand()); |
| 654 positionShorthands.uncheckedAppend(backgroundPositionShorthand()); |
| 655 map.set(CSSPropertyBackgroundPositionX, positionShorthands); |
| 656 map.set(CSSPropertyBackgroundPositionY, positionShorthands); |
| 657 |
| 658 Vector<StylePropertyShorthand, 2> repeatShorthands; |
| 659 repeatShorthands.uncheckedAppend(backgroundShorthand()); |
| 660 repeatShorthands.uncheckedAppend(backgroundRepeatShorthand()); |
| 661 map.set(CSSPropertyBackgroundRepeatX, repeatShorthands); |
| 662 map.set(CSSPropertyBackgroundRepeatY, repeatShorthands); |
| 663 |
| 664 Vector<StylePropertyShorthand, 3> bottomWidthShorthands; |
| 665 bottomWidthShorthands.uncheckedAppend(borderShorthand()); |
| 666 bottomWidthShorthands.uncheckedAppend(borderBottomShorthand()); |
| 667 bottomWidthShorthands.uncheckedAppend(borderWidthShorthand()); |
| 668 map.set(CSSPropertyBorderBottomWidth, bottomWidthShorthands); |
| 669 |
| 670 Vector<StylePropertyShorthand, 3> topColorShorthands; |
| 671 topColorShorthands.uncheckedAppend(borderShorthand()); |
| 672 topColorShorthands.uncheckedAppend(borderTopShorthand()); |
| 673 topColorShorthands.uncheckedAppend(borderColorShorthand()); |
| 674 map.set(CSSPropertyBorderTopColor, topColorShorthands); |
| 675 |
| 676 Vector<StylePropertyShorthand, 3> rightColorShorthands; |
| 677 rightColorShorthands.uncheckedAppend(borderShorthand()); |
| 678 rightColorShorthands.uncheckedAppend(borderRightShorthand()); |
| 679 rightColorShorthands.uncheckedAppend(borderColorShorthand()); |
| 680 map.set(CSSPropertyBorderRightColor, rightColorShorthands); |
| 681 |
| 682 Vector<StylePropertyShorthand, 3> leftColorShorthands; |
| 683 leftColorShorthands.uncheckedAppend(borderShorthand()); |
| 684 leftColorShorthands.uncheckedAppend(borderLeftShorthand()); |
| 685 leftColorShorthands.uncheckedAppend(borderColorShorthand()); |
| 686 map.set(CSSPropertyBorderLeftColor, leftColorShorthands); |
| 687 |
| 688 Vector<StylePropertyShorthand, 3> bottomColorShorthands; |
| 689 bottomColorShorthands.uncheckedAppend(borderShorthand()); |
| 690 bottomColorShorthands.uncheckedAppend(borderBottomShorthand()); |
| 691 bottomColorShorthands.uncheckedAppend(borderColorShorthand()); |
| 692 map.set(CSSPropertyBorderBottomColor, bottomColorShorthands); |
| 693 |
| 694 Vector<StylePropertyShorthand, 1> borderImage; |
| 695 borderImage.uncheckedAppend(borderImageShorthand()); |
| 696 map.set(CSSPropertyBorderImageSource, borderImage); |
| 697 map.set(CSSPropertyBorderImageSlice, borderImage); |
| 698 map.set(CSSPropertyBorderImageWidth, borderImage); |
| 699 map.set(CSSPropertyBorderImageOutset, borderImage); |
| 700 map.set(CSSPropertyBorderImageRepeat, borderImage); |
| 701 |
| 702 Vector<StylePropertyShorthand, 3> leftWidthShorthands; |
| 703 leftWidthShorthands.uncheckedAppend(borderShorthand()); |
| 704 leftWidthShorthands.uncheckedAppend(borderLeftShorthand()); |
| 705 leftWidthShorthands.uncheckedAppend(borderWidthShorthand()); |
| 706 map.set(CSSPropertyBorderLeftWidth, leftWidthShorthands); |
| 707 |
| 708 Vector<StylePropertyShorthand, 2> radiusShorthands; |
| 709 radiusShorthands.uncheckedAppend(borderRadiusShorthand()); |
| 710 radiusShorthands.uncheckedAppend(webkitBorderRadiusShorthand()); |
| 711 map.set(CSSPropertyBorderTopLeftRadius, radiusShorthands); |
| 712 map.set(CSSPropertyBorderTopRightRadius, radiusShorthands); |
| 713 map.set(CSSPropertyBorderBottomRightRadius, radiusShorthands); |
| 714 map.set(CSSPropertyBorderBottomLeftRadius, radiusShorthands); |
| 715 |
| 716 Vector<StylePropertyShorthand, 3> rightWidthShorthands; |
| 717 rightWidthShorthands.uncheckedAppend(borderShorthand()); |
| 718 rightWidthShorthands.uncheckedAppend(borderRightShorthand()); |
| 719 rightWidthShorthands.uncheckedAppend(borderWidthShorthand()); |
| 720 map.set(CSSPropertyBorderRightWidth, rightWidthShorthands); |
| 721 |
| 722 Vector<StylePropertyShorthand, 1> spacingShorthand; |
| 723 spacingShorthand.uncheckedAppend(borderSpacingShorthand()); |
| 724 map.set(CSSPropertyWebkitBorderHorizontalSpacing, spacingShorthand); |
| 725 map.set(CSSPropertyWebkitBorderVerticalSpacing, spacingShorthand); |
| 726 |
| 727 Vector<StylePropertyShorthand, 3> topStyleShorthands; |
| 728 topStyleShorthands.uncheckedAppend(borderShorthand()); |
| 729 topStyleShorthands.uncheckedAppend(borderTopShorthand()); |
| 730 topStyleShorthands.uncheckedAppend(borderStyleShorthand()); |
| 731 map.set(CSSPropertyBorderTopStyle, topStyleShorthands); |
| 732 |
| 733 Vector<StylePropertyShorthand, 3> bottomStyleShorthands; |
| 734 bottomStyleShorthands.uncheckedAppend(borderShorthand()); |
| 735 bottomStyleShorthands.uncheckedAppend(borderBottomShorthand()); |
| 736 bottomStyleShorthands.uncheckedAppend(borderStyleShorthand()); |
| 737 map.set(CSSPropertyBorderBottomStyle, bottomStyleShorthands); |
| 738 |
| 739 Vector<StylePropertyShorthand, 3> leftStyleShorthands; |
| 740 leftStyleShorthands.uncheckedAppend(borderShorthand()); |
| 741 leftStyleShorthands.uncheckedAppend(borderLeftShorthand()); |
| 742 leftStyleShorthands.uncheckedAppend(borderStyleShorthand()); |
| 743 map.set(CSSPropertyBorderLeftStyle, leftStyleShorthands); |
| 744 |
| 745 Vector<StylePropertyShorthand, 3> rightStyleShorthands; |
| 746 rightStyleShorthands.uncheckedAppend(borderShorthand()); |
| 747 rightStyleShorthands.uncheckedAppend(borderRightShorthand()); |
| 748 rightStyleShorthands.uncheckedAppend(borderStyleShorthand()); |
| 749 map.set(CSSPropertyBorderRightStyle, rightStyleShorthands); |
| 750 |
| 751 Vector<StylePropertyShorthand, 3> topWidthShorthands; |
| 752 topWidthShorthands.uncheckedAppend(borderShorthand()); |
| 753 topWidthShorthands.uncheckedAppend(borderTopShorthand()); |
| 754 topWidthShorthands.uncheckedAppend(borderWidthShorthand()); |
| 755 map.set(CSSPropertyBorderTopWidth, topWidthShorthands); |
| 756 |
| 757 Vector<StylePropertyShorthand, 1> listStyle; |
| 758 listStyle.uncheckedAppend(listStyleShorthand()); |
| 759 map.set(CSSPropertyListStyleType, listStyle); |
| 760 map.set(CSSPropertyListStylePosition, listStyle); |
| 761 map.set(CSSPropertyListStyleImage, listStyle); |
| 762 |
| 763 Vector<StylePropertyShorthand, 1> font; |
| 764 font.uncheckedAppend(fontShorthand()); |
| 765 map.set(CSSPropertyFontFamily, font); |
| 766 map.set(CSSPropertyFontSize, font); |
| 767 map.set(CSSPropertyFontStyle, font); |
| 768 map.set(CSSPropertyFontVariant, font); |
| 769 map.set(CSSPropertyFontWeight, font); |
| 770 map.set(CSSPropertyLineHeight, font); |
| 771 |
| 772 Vector<StylePropertyShorthand, 1> margin; |
| 773 margin.uncheckedAppend(marginShorthand()); |
| 774 map.set(CSSPropertyMarginTop, margin); |
| 775 map.set(CSSPropertyMarginRight, margin); |
| 776 map.set(CSSPropertyMarginBottom, margin); |
| 777 map.set(CSSPropertyMarginLeft, margin); |
| 778 |
| 779 Vector<StylePropertyShorthand, 1> marker; |
| 780 marker.uncheckedAppend(markerShorthand()); |
| 781 map.set(CSSPropertyMarkerStart, marker); |
| 782 map.set(CSSPropertyMarkerMid, marker); |
| 783 map.set(CSSPropertyMarkerEnd, marker); |
| 784 |
| 785 Vector<StylePropertyShorthand, 1> outline; |
| 786 outline.uncheckedAppend(outlineShorthand()); |
| 787 map.set(CSSPropertyOutlineColor, outline); |
| 788 map.set(CSSPropertyOutlineStyle, outline); |
| 789 map.set(CSSPropertyOutlineWidth, outline); |
| 790 |
| 791 Vector<StylePropertyShorthand, 1> padding; |
| 792 padding.uncheckedAppend(paddingShorthand()); |
| 793 map.set(CSSPropertyPaddingTop, padding); |
| 794 map.set(CSSPropertyPaddingRight, padding); |
| 795 map.set(CSSPropertyPaddingBottom, padding); |
| 796 map.set(CSSPropertyPaddingLeft, padding); |
| 797 |
| 798 Vector<StylePropertyShorthand, 1> overflow; |
| 799 overflow.uncheckedAppend(overflowShorthand()); |
| 800 map.set(CSSPropertyOverflowX, overflow); |
| 801 map.set(CSSPropertyOverflowY, overflow); |
| 802 |
| 803 Vector<StylePropertyShorthand, 1> transition; |
| 804 transition.uncheckedAppend(transitionShorthand()); |
| 805 map.set(CSSPropertyTransitionProperty, transition); |
| 806 map.set(CSSPropertyTransitionDuration, transition); |
| 807 map.set(CSSPropertyTransitionTimingFunction, transition); |
| 808 map.set(CSSPropertyTransitionDelay, transition); |
| 809 |
| 810 Vector<StylePropertyShorthand, 1> animation; |
| 811 animation.uncheckedAppend(webkitAnimationShorthand()); |
| 812 map.set(CSSPropertyWebkitAnimationName, animation); |
| 813 map.set(CSSPropertyWebkitAnimationDuration, animation); |
| 814 map.set(CSSPropertyWebkitAnimationTimingFunction, animation); |
| 815 map.set(CSSPropertyWebkitAnimationDelay, animation); |
| 816 map.set(CSSPropertyWebkitAnimationIterationCount, animation); |
| 817 map.set(CSSPropertyWebkitAnimationDirection, animation); |
| 818 map.set(CSSPropertyWebkitAnimationFillMode, animation); |
| 819 |
| 820 Vector<StylePropertyShorthand, 1> borderAfter; |
| 821 borderAfter.uncheckedAppend(webkitBorderAfterShorthand()); |
| 822 map.set(CSSPropertyWebkitBorderAfterWidth, borderAfter); |
| 823 map.set(CSSPropertyWebkitBorderAfterStyle, borderAfter); |
| 824 map.set(CSSPropertyWebkitBorderAfterColor, borderAfter); |
| 825 |
| 826 Vector<StylePropertyShorthand, 1> borderBefore; |
| 827 borderBefore.uncheckedAppend(webkitBorderBeforeShorthand()); |
| 828 map.set(CSSPropertyWebkitBorderBeforeWidth, borderBefore); |
| 829 map.set(CSSPropertyWebkitBorderBeforeStyle, borderBefore); |
| 830 map.set(CSSPropertyWebkitBorderBeforeColor, borderBefore); |
| 831 |
| 832 Vector<StylePropertyShorthand, 1> borderEnd; |
| 833 borderEnd.uncheckedAppend(webkitBorderEndShorthand()); |
| 834 map.set(CSSPropertyWebkitBorderEndWidth, borderEnd); |
| 835 map.set(CSSPropertyWebkitBorderEndStyle, borderEnd); |
| 836 map.set(CSSPropertyWebkitBorderEndColor, borderEnd); |
| 837 |
| 838 Vector<StylePropertyShorthand, 1> borderStart; |
| 839 borderStart.uncheckedAppend(webkitBorderStartShorthand()); |
| 840 map.set(CSSPropertyWebkitBorderStartWidth, borderStart); |
| 841 map.set(CSSPropertyWebkitBorderStartStyle, borderStart); |
| 842 map.set(CSSPropertyWebkitBorderStartColor, borderStart); |
| 843 |
| 844 Vector<StylePropertyShorthand, 1> columns; |
| 845 columns.uncheckedAppend(webkitColumnsShorthand()); |
| 846 map.set(CSSPropertyWebkitColumnWidth, columns); |
| 847 map.set(CSSPropertyWebkitColumnCount, columns); |
| 848 |
| 849 Vector<StylePropertyShorthand, 1> columnRule; |
| 850 columnRule.uncheckedAppend(webkitColumnRuleShorthand()); |
| 851 map.set(CSSPropertyWebkitColumnRuleWidth, columnRule); |
| 852 map.set(CSSPropertyWebkitColumnRuleStyle, columnRule); |
| 853 map.set(CSSPropertyWebkitColumnRuleColor, columnRule); |
| 854 |
| 855 Vector<StylePropertyShorthand, 1> flex; |
| 856 flex.uncheckedAppend(webkitFlexShorthand()); |
| 857 map.set(CSSPropertyWebkitFlexGrow, flex); |
| 858 map.set(CSSPropertyWebkitFlexShrink, flex); |
| 859 map.set(CSSPropertyWebkitFlexBasis, flex); |
| 860 |
| 861 Vector<StylePropertyShorthand, 1> flexFlow; |
| 862 flexFlow.uncheckedAppend(webkitFlexFlowShorthand()); |
| 863 map.set(CSSPropertyWebkitFlexDirection, flexFlow); |
| 864 map.set(CSSPropertyWebkitFlexWrap, flexFlow); |
| 865 |
| 866 Vector<StylePropertyShorthand, 2> grid; |
| 867 grid.uncheckedAppend(gridAreaShorthand()); |
| 868 grid.uncheckedAppend(gridColumnShorthand()); |
| 869 map.set(CSSPropertyGridStart, grid); |
| 870 map.set(CSSPropertyGridEnd, grid); |
| 871 |
| 872 Vector<StylePropertyShorthand, 2> gridAfter; |
| 873 gridAfter.uncheckedAppend(gridAreaShorthand()); |
| 874 gridAfter.uncheckedAppend(gridRowShorthand()); |
| 875 map.set(CSSPropertyGridBefore, gridAfter); |
| 876 map.set(CSSPropertyGridAfter, gridAfter); |
| 877 |
| 878 Vector<StylePropertyShorthand, 1> marginCollapse; |
| 879 marginCollapse.uncheckedAppend(webkitMarginCollapseShorthand()); |
| 880 map.set(CSSPropertyWebkitMarginBeforeCollapse, marginCollapse); |
| 881 map.set(CSSPropertyWebkitMarginAfterCollapse, marginCollapse); |
| 882 |
| 883 Vector<StylePropertyShorthand, 1> marquee; |
| 884 marquee.uncheckedAppend(webkitMarqueeShorthand()); |
| 885 map.set(CSSPropertyWebkitMarqueeDirection, marquee); |
| 886 map.set(CSSPropertyWebkitMarqueeIncrement, marquee); |
| 887 map.set(CSSPropertyWebkitMarqueeRepetition, marquee); |
| 888 map.set(CSSPropertyWebkitMarqueeStyle, marquee); |
| 889 map.set(CSSPropertyWebkitMarqueeSpeed, marquee); |
| 890 |
| 891 Vector<StylePropertyShorthand, 1> mask; |
| 892 mask.uncheckedAppend(webkitMaskShorthand()); |
| 893 map.set(CSSPropertyWebkitMaskImage, mask); |
| 894 map.set(CSSPropertyWebkitMaskSize, mask); |
| 895 map.set(CSSPropertyWebkitMaskOrigin, mask); |
| 896 map.set(CSSPropertyWebkitMaskClip, mask); |
| 897 |
| 898 Vector<StylePropertyShorthand, 1> maskPosition; |
| 899 maskPosition.uncheckedAppend(webkitMaskPositionShorthand()); |
| 900 map.set(CSSPropertyWebkitMaskPositionX, maskPosition); |
| 901 map.set(CSSPropertyWebkitMaskPositionY, maskPosition); |
| 902 |
| 903 Vector<StylePropertyShorthand, 1> maskRepeat; |
| 904 maskRepeat.uncheckedAppend(webkitMaskRepeatShorthand()); |
| 905 map.set(CSSPropertyWebkitMaskRepeatX, maskRepeat); |
| 906 map.set(CSSPropertyWebkitMaskRepeatY, maskRepeat); |
| 907 |
| 908 Vector<StylePropertyShorthand, 1> textEmphasis; |
| 909 textEmphasis.uncheckedAppend(webkitTextEmphasisShorthand()); |
| 910 map.set(CSSPropertyWebkitTextEmphasisStyle, textEmphasis); |
| 911 map.set(CSSPropertyWebkitTextEmphasisColor, textEmphasis); |
| 912 |
| 913 Vector<StylePropertyShorthand, 1> textStroke; |
| 914 textStroke.uncheckedAppend(webkitTextStrokeShorthand()); |
| 915 map.set(CSSPropertyWebkitTextStrokeWidth, textStroke); |
| 916 map.set(CSSPropertyWebkitTextStrokeColor, textStroke); |
| 917 |
| 918 Vector<StylePropertyShorthand, 1> webkitTransition; |
| 919 webkitTransition.uncheckedAppend(webkitTransitionShorthand()); |
| 920 map.set(CSSPropertyWebkitTransitionProperty, webkitTransition); |
| 921 map.set(CSSPropertyWebkitTransitionDuration, webkitTransition); |
| 922 map.set(CSSPropertyWebkitTransitionTimingFunction, webkitTransition); |
| 923 map.set(CSSPropertyWebkitTransitionDelay, webkitTransition); |
| 924 |
| 925 Vector<StylePropertyShorthand, 1> transform; |
| 926 transform.uncheckedAppend(webkitTransformOriginShorthand()); |
| 927 map.set(CSSPropertyWebkitTransformOriginX, transform); |
| 928 map.set(CSSPropertyWebkitTransformOriginY, transform); |
| 929 map.set(CSSPropertyWebkitTransformOriginZ, transform); |
| 930 |
| 931 Vector<StylePropertyShorthand, 1> width; |
| 932 width.uncheckedAppend(widthShorthand()); |
| 933 map.set(CSSPropertyMinWidth, width); |
| 934 map.set(CSSPropertyMaxWidth, width); |
| 935 |
| 936 Vector<StylePropertyShorthand, 1> height; |
| 937 height.uncheckedAppend(heightShorthand()); |
| 938 map.set(CSSPropertyMinHeight, height); |
| 939 map.set(CSSPropertyMaxHeight, height); |
| 940 } |
| 941 return map.get(propertyID); |
| 942 } |
| 943 |
| 944 unsigned indexOfShorthandForLonghand(CSSPropertyID shorthandID, const Vector<Sty
lePropertyShorthand>& shorthands) |
| 945 { |
| 946 for (unsigned i = 0; i < shorthands.size(); ++i) { |
| 947 if (shorthands.at(i).id() == shorthandID) |
| 948 return i; |
| 949 } |
| 950 ASSERT_NOT_REACHED(); |
| 951 return 0; |
| 952 } |
| 953 |
| 592 } // namespace WebCore | 954 } // namespace WebCore |
| OLD | NEW |