Changeset 118044 in webkit
- Timestamp:
- May 22, 2012 1:50:04 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118041 r118044 1 2012-05-22 Tony Chang <tony@chromium.org> 2 3 REGRESSION(r117613): Dromaeo/jslib-style-prototype regressed by 20% 4 https://bugs.webkit.org/show_bug.cgi?id=87142 5 6 Reviewed by Alexis Menard. 7 8 Move CSSPropertyDisplay back into isValidKeywordPropertyAndValue. 9 Pass in the parser context so we can check whether we're grid or not. 10 11 No new tests. Covered by Dromaeo/jslib-style-prototype perf test. 12 13 * css/CSSParser.cpp: 14 (WebCore::isValidKeywordPropertyAndValue): 15 (WebCore::isKeywordPropertyID): 16 (WebCore::parseKeywordValue): 17 (WebCore::CSSParser::parseValue): 18 (WebCore::CSSParser::parseFont): 19 1 20 == Rolled over to ChangeLog-2012-05-22 == -
trunk/Source/WebCore/css/CSSParser.cpp
r117809 r118044 495 495 } 496 496 497 static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int valueID )497 static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int valueID, const CSSParserContext& parserContext) 498 498 { 499 499 if (!valueID) … … 533 533 return true; 534 534 break; 535 case CSSPropertyDisplay: 536 // inline | block | list-item | run-in | inline-block | table | 537 // inline-table | table-row-group | table-header-group | table-footer-group | table-row | 538 // table-column-group | table-column | table-cell | table-caption | -webkit-box | -webkit-inline-box | none | inherit 539 // -webkit-flex | -webkit-inline-flex | -webkit-grid | -webkit-inline-grid 540 if ((valueID >= CSSValueInline && valueID <= CSSValueWebkitInlineFlex) || valueID == CSSValueNone) 541 return true; 542 if (parserContext.isCSSGridLayoutEnabled && (valueID == CSSValueWebkitGrid || valueID == CSSValueWebkitInlineGrid)) 543 return true; 544 break; 545 535 546 case CSSPropertyEmptyCells: // show | hide | inherit 536 547 if (valueID == CSSValueShow || valueID == CSSValueHide) … … 820 831 case CSSPropertyClear: 821 832 case CSSPropertyDirection: 833 case CSSPropertyDisplay: 822 834 case CSSPropertyEmptyCells: 823 835 case CSSPropertyFloat: … … 903 915 } 904 916 905 static bool parseKeywordValue(StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important )917 static bool parseKeywordValue(StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, const CSSParserContext& parserContext) 906 918 { 907 919 ASSERT(!string.isEmpty()); … … 923 935 else if (valueID == CSSValueInitial) 924 936 value = cssValuePool().createExplicitInitialValue(); 925 else if (isValidKeywordPropertyAndValue(propertyId, valueID ))937 else if (isValidKeywordPropertyAndValue(propertyId, valueID, parserContext)) 926 938 value = cssValuePool().createIdentifierValue(valueID); 927 939 else … … 949 961 if (parseColorValue(declaration, propertyID, string, important, cssParserMode)) 950 962 return true; 951 if (parseKeywordValue(declaration, propertyID, string, important ))963 if (parseKeywordValue(declaration, propertyID, string, important, contextStyleSheet->parserContext())) 952 964 return true; 953 965 … … 1446 1458 1447 1459 if (isKeywordPropertyID(propId)) { 1448 if (!isValidKeywordPropertyAndValue(propId, id ))1460 if (!isValidKeywordPropertyAndValue(propId, id, m_context)) 1449 1461 return false; 1450 1462 if (m_valueList->next() && !inShorthand()) … … 1458 1470 1459 1471 switch (propId) { 1460 case CSSPropertyDisplay:1461 // inline | block | list-item | run-in | inline-block | table |1462 // inline-table | table-row-group | table-header-group | table-footer-group | table-row |1463 // table-column-group | table-column | table-cell | table-caption | -webkit-box | -webkit-inline-box | none | inherit1464 // -webkit-flex | -webkit-inline-flex | -webkit-grid | -webkit-inline-grid1465 if ((id >= CSSValueInline && id <= CSSValueWebkitInlineFlex) || id == CSSValueNone)1466 validPrimitive = true;1467 else if (cssGridLayoutEnabled() && (id == CSSValueWebkitGrid || id == CSSValueWebkitInlineGrid))1468 validPrimitive = true;1469 break;1470 1471 1472 case CSSPropertySize: // <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ] 1472 1473 return parseSize(propId, important); … … 2475 2476 case CSSPropertyClear: 2476 2477 case CSSPropertyDirection: 2478 case CSSPropertyDisplay: 2477 2479 case CSSPropertyEmptyCells: 2478 2480 case CSSPropertyFloat: … … 4389 4391 CSSParserValue* value; 4390 4392 while ((value = m_valueList->current())) { 4391 if (!fontStyleParsed && isValidKeywordPropertyAndValue(CSSPropertyFontStyle, value->id )) {4393 if (!fontStyleParsed && isValidKeywordPropertyAndValue(CSSPropertyFontStyle, value->id, m_context)) { 4392 4394 addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(value->id), important); 4393 4395 fontStyleParsed = true;
Note: See TracChangeset
for help on using the changeset viewer.