Changeset 106980 in webkit
- Timestamp:
- Feb 7, 2012 1:22:29 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106978 r106980 1 2012-02-07 Tony Chang <tony@chromium.org> 2 3 move warning about css values and render style constants closer to where it applies 4 https://bugs.webkit.org/show_bug.cgi?id=78017 5 6 Reviewed by Darin Adler. 7 8 Move the warning about keeping RenderStyleConstnats.h enums and 9 CSSValueKeywords.in values in the same order closer to the properties 10 that the warning applies to. The warning was easy to miss and was 11 confusing since it doesn't apply to most values. 12 13 Also refactor 2 conversion functions to 14 enumerate the possible values so the order doesn't matter. 15 16 No new tests, just refactoring and comment cleanup. 17 18 * css/CSSPrimitiveValueMappings.h: 19 (WebCore::CSSPrimitiveValue::operator EListStylePosition): Name all possible values and add a NOT_REACHED(). 20 (WebCore::CSSPrimitiveValue::operator EUserModify): Name all possible values and add a NOT_REACHED(). 21 * css/CSSValueKeywords.in: 22 * css/SVGCSSPropertyNames.in: 23 * css/SVGCSSValueKeywords.in: 24 * rendering/style/RenderStyleConstants.h: 25 1 26 2012-02-06 Jer Noble <jer.noble@apple.com> 2 27 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r106274 r106980 1397 1397 template<> inline CSSPrimitiveValue::operator EListStylePosition() const 1398 1398 { 1399 return (EListStylePosition)(m_value.ident - CSSValueOutside); 1399 switch (m_value.ident) { 1400 case CSSValueOutside: 1401 return OUTSIDE; 1402 case CSSValueInside: 1403 return INSIDE; 1404 default: 1405 ASSERT_NOT_REACHED(); 1406 return OUTSIDE; 1407 } 1400 1408 } 1401 1409 … … 2286 2294 template<> inline CSSPrimitiveValue::operator EUserModify() const 2287 2295 { 2288 return static_cast<EUserModify>(m_value.ident - CSSValueReadOnly); 2296 switch (m_value.ident) { 2297 case CSSValueReadOnly: 2298 return READ_ONLY; 2299 case CSSValueReadWrite: 2300 return READ_WRITE; 2301 case CSSValueReadWritePlaintextOnly: 2302 return READ_WRITE_PLAINTEXT_ONLY; 2303 default: 2304 ASSERT_NOT_REACHED(); 2305 return READ_ONLY; 2306 } 2289 2307 } 2290 2308 -
trunk/Source/WebCore/css/CSSValueKeywords.in
r105694 r106980 1 // These are all values accepted for CSS2. 2 // 3 // WARNING: 4 // -------- 5 // 6 // The Values are sorted according to the properties they belong to, 7 // and have to be in the same order as the enums in RenderStyleConstants.h. 8 // 9 // If not, the optimizations in the cssparser and style selector will fail, 10 // and produce incorrect results. 1 // 2 // CSS value names 11 3 // 12 4 inherit … … 17 9 // CSS_PROP_BORDER_BOTTOM_STYLE 18 10 // CSS_PROP_BORDER_LEFT_STYLE 11 // The order here must match the order of the EBorderStyle enum in RenderStyleConstants.h. 19 12 none 20 13 hidden … … 216 209 // 217 210 // CSS_PROP_TEXT_ALIGN: 211 // The order here must match the order of the ETextAlign enum in RenderStyleConstants.h. 218 212 // 219 213 -webkit-auto … … 233 227 // 234 228 // CSS_PROP_LIST_STYLE_TYPE: 229 // The order here must match the order of the EListStyleType enum in RenderStyleConstants.h. 235 230 // 236 231 disc … … 317 312 // 318 313 // CSS_PROP_DISPLAY: 314 // The order here must match the order of the EDisplay enum in RenderStyleConstants.h. 319 315 // 320 316 inline … … 345 341 // 346 342 // CSS_PROP_CURSOR: 343 // The order here must match the order of the ECursor enum in RenderStyleConstants.h. 347 344 // 348 345 auto … … 604 601 605 602 // -webkit-appearance 606 // The order here shouldmatch the order in the ControlPart enum in ThemeTypes.h.603 // The order here must match the order in the ControlPart enum in ThemeTypes.h. 607 604 // All appearance values that should be accepted by the parser should be listed between 'checkbox' and 'textarea': 608 605 checkbox -
trunk/Source/WebCore/css/SVGCSSPropertyNames.in
r89362 r106980 1 1 // 2 // all valid SVG CSS2 properties.2 // SVG CSS property names 3 3 // 4 4 -
trunk/Source/WebCore/css/SVGCSSValueKeywords.in
r92792 r106980 1 // These are all values accepted for CSS2.2 1 // 3 // WARNING: 4 // -------- 5 // 6 // The Values are sorted according to the properties they belong to, 7 // and have to be in the same order as the enums in RenderStyle.h. 8 // 9 // If not, the optimizations in the cssparser and style selector will fail, 10 // and produce incorrect results. 11 // 2 // SVG CSS value names 12 3 // 13 4 // CSS_PROP_*_COLOR -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r105694 r106980 29 29 namespace WebCore { 30 30 31 /*32 * WARNING:33 * --------34 *35 * The order of the values in the enums have to agree with the order specified36 * in CSSValueKeywords.in, otherwise some optimizations in the parser will fail,37 * and produce invalid results.38 */39 31 static const size_t PrintColorAdjustBits = 1; 40 32 enum PrintColorAdjust { … … 94 86 95 87 // These have been defined in the order of their precedence for border-collapsing. Do 96 // not change this order! 88 // not change this order! This order also must match the order in CSSValueKeywords.in. 97 89 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, OUTSET, RIDGE, DOTTED, DASHED, SOLID, DOUBLE }; 98 90 … … 230 222 }; 231 223 232 // The order of this enum must match the order of the list style types in CSSValueKeywords.in. 224 // The order of this enum must match the order of the list style types in CSSValueKeywords.in. 233 225 enum EListStyleType { 234 226 Disc, … … 336 328 }; 337 329 330 // The order of this enum must match the order of the text align values in CSSValueKeywords.in. 338 331 enum ETextAlign { 339 332 TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND, … … 409 402 }; 410 403 404 // The order of this enum must match the order of the display values in CSSValueKeywords.in. 411 405 enum EDisplay { 412 406 INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, INLINE_BLOCK,
Note: See TracChangeset
for help on using the changeset viewer.