| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool CSSPropertyParser::parseValue(CSSPropertyID property, bool important, | 117 bool CSSPropertyParser::parseValue(CSSPropertyID property, bool important, |
| 118 CSSParserValueList* valueList, const CSSParserContext& context, bool inViewp
ort, | 118 CSSParserValueList* valueList, const CSSParserContext& context, bool inViewp
ort, |
| 119 Vector<CSSProperty, 256>& parsedProperties, CSSRuleSourceData::Type ruleType
) | 119 Vector<CSSProperty, 256>& parsedProperties, CSSRuleSourceData::Type ruleType
) |
| 120 { | 120 { |
| 121 CSSPropertyParser parser(valueList, context, inViewport, parsedProperties, r
uleType); | 121 CSSPropertyParser parser(valueList, context, inViewport, parsedProperties, r
uleType); |
| 122 return parser.parseValue(property, important); | 122 return parser.parseValue(property, important); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void CSSPropertyParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, Pa
ssRefPtr<CSSValue> value, bool important, bool implicit) | |
| 126 { | |
| 127 RefPtr<CSSValue> val = value.get(); | |
| 128 addProperty(propId, value, important, implicit); | |
| 129 | |
| 130 CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId); | |
| 131 if (prefixingVariant == propId) | |
| 132 return; | |
| 133 | |
| 134 if (m_currentShorthand) { | |
| 135 // We can't use ShorthandScope here as we can already be inside one (e.g
we are parsing CSSTransition). | |
| 136 m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand); | |
| 137 addProperty(prefixingVariant, val.release(), important, implicit); | |
| 138 m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand); | |
| 139 } else { | |
| 140 addProperty(prefixingVariant, val.release(), important, implicit); | |
| 141 } | |
| 142 } | |
| 143 | |
| 144 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> v
alue, bool important, bool implicit) | 125 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> v
alue, bool important, bool implicit) |
| 145 { | 126 { |
| 146 int shorthandIndex = 0; | 127 int shorthandIndex = 0; |
| 147 bool setFromShorthand = false; | 128 bool setFromShorthand = false; |
| 148 | 129 |
| 149 if (m_currentShorthand) { | 130 if (m_currentShorthand) { |
| 150 Vector<StylePropertyShorthand, 4> shorthands; | 131 Vector<StylePropertyShorthand, 4> shorthands; |
| 151 getMatchingShorthandsForLonghand(propId, &shorthands); | 132 getMatchingShorthandsForLonghand(propId, &shorthands); |
| 152 // Viewport descriptors have width and height as shorthands, but it does
n't | 133 // Viewport descriptors have width and height as shorthands, but it does
n't |
| 153 // make sense for CSSProperties.in to consider them as such. The shortha
nd | 134 // make sense for CSSProperties.in to consider them as such. The shortha
nd |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return CSSPrimitiveValue::create(m_parsedCalculation.release()); | 379 return CSSPrimitiveValue::create(m_parsedCalculation.release()); |
| 399 | 380 |
| 400 return nullptr; | 381 return nullptr; |
| 401 } | 382 } |
| 402 | 383 |
| 403 void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, PassRe
fPtr<CSSValue> prpValue, bool important) | 384 void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, PassRe
fPtr<CSSValue> prpValue, bool important) |
| 404 { | 385 { |
| 405 const StylePropertyShorthand& shorthand = shorthandForProperty(propId); | 386 const StylePropertyShorthand& shorthand = shorthandForProperty(propId); |
| 406 unsigned shorthandLength = shorthand.length(); | 387 unsigned shorthandLength = shorthand.length(); |
| 407 if (!shorthandLength) { | 388 if (!shorthandLength) { |
| 408 addPropertyWithPrefixingVariant(propId, prpValue, important); | 389 addProperty(propId, prpValue, important); |
| 409 return; | 390 return; |
| 410 } | 391 } |
| 411 | 392 |
| 412 RefPtr<CSSValue> value = prpValue; | 393 RefPtr<CSSValue> value = prpValue; |
| 413 ShorthandScope scope(this, propId); | 394 ShorthandScope scope(this, propId); |
| 414 const CSSPropertyID* longhands = shorthand.properties(); | 395 const CSSPropertyID* longhands = shorthand.properties(); |
| 415 for (unsigned i = 0; i < shorthandLength; ++i) | 396 for (unsigned i = 0; i < shorthandLength; ++i) |
| 416 addPropertyWithPrefixingVariant(longhands[i], value, important); | 397 addProperty(longhands[i], value, important); |
| 417 } | 398 } |
| 418 | 399 |
| 419 bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important) | 400 bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important) |
| 420 { | 401 { |
| 421 if (!isInternalPropertyAndValueParsingEnabledForMode(m_context.mode()) && is
InternalProperty(propId)) | 402 if (!isInternalPropertyAndValueParsingEnabledForMode(m_context.mode()) && is
InternalProperty(propId)) |
| 422 return false; | 403 return false; |
| 423 | 404 |
| 424 // We don't count the UA style sheet in our statistics. | 405 // We don't count the UA style sheet in our statistics. |
| 425 if (m_context.useCounter()) | 406 if (m_context.useCounter()) |
| 426 m_context.useCounter()->count(m_context, propId); | 407 m_context.useCounter()->count(m_context, propId); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 return true; | 1073 return true; |
| 1093 } | 1074 } |
| 1094 case CSSPropertyAnimationDelay: | 1075 case CSSPropertyAnimationDelay: |
| 1095 case CSSPropertyAnimationDirection: | 1076 case CSSPropertyAnimationDirection: |
| 1096 case CSSPropertyAnimationDuration: | 1077 case CSSPropertyAnimationDuration: |
| 1097 case CSSPropertyAnimationFillMode: | 1078 case CSSPropertyAnimationFillMode: |
| 1098 case CSSPropertyAnimationName: | 1079 case CSSPropertyAnimationName: |
| 1099 case CSSPropertyAnimationPlayState: | 1080 case CSSPropertyAnimationPlayState: |
| 1100 case CSSPropertyAnimationIterationCount: | 1081 case CSSPropertyAnimationIterationCount: |
| 1101 case CSSPropertyAnimationTimingFunction: | 1082 case CSSPropertyAnimationTimingFunction: |
| 1102 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | |
| 1103 case CSSPropertyWebkitAnimationDelay: | |
| 1104 case CSSPropertyWebkitAnimationDirection: | |
| 1105 case CSSPropertyWebkitAnimationDuration: | |
| 1106 case CSSPropertyWebkitAnimationFillMode: | |
| 1107 case CSSPropertyWebkitAnimationName: | |
| 1108 case CSSPropertyWebkitAnimationPlayState: | |
| 1109 case CSSPropertyWebkitAnimationIterationCount: | |
| 1110 case CSSPropertyWebkitAnimationTimingFunction: | |
| 1111 case CSSPropertyTransitionDelay: | 1083 case CSSPropertyTransitionDelay: |
| 1112 case CSSPropertyTransitionDuration: | 1084 case CSSPropertyTransitionDuration: |
| 1113 case CSSPropertyTransitionTimingFunction: | 1085 case CSSPropertyTransitionTimingFunction: |
| 1114 case CSSPropertyTransitionProperty: | 1086 case CSSPropertyTransitionProperty: { |
| 1115 case CSSPropertyWebkitTransitionDelay: | |
| 1116 case CSSPropertyWebkitTransitionDuration: | |
| 1117 case CSSPropertyWebkitTransitionTimingFunction: | |
| 1118 case CSSPropertyWebkitTransitionProperty: { | |
| 1119 if (RefPtr<CSSValueList> val = parseAnimationPropertyList(propId)) { | 1087 if (RefPtr<CSSValueList> val = parseAnimationPropertyList(propId)) { |
| 1120 addPropertyWithPrefixingVariant(propId, val.release(), important); | 1088 addProperty(propId, val.release(), important); |
| 1121 return true; | 1089 return true; |
| 1122 } | 1090 } |
| 1123 return false; | 1091 return false; |
| 1124 } | 1092 } |
| 1125 | 1093 |
| 1126 case CSSPropertyWillChange: | 1094 case CSSPropertyWillChange: |
| 1127 parsedValue = parseWillChange(); | 1095 parsedValue = parseWillChange(); |
| 1128 break; | 1096 break; |
| 1129 // End of CSS3 properties | 1097 // End of CSS3 properties |
| 1130 | 1098 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 return parseShorthand(propId, flexFlowShorthand(), important); | 1192 return parseShorthand(propId, flexFlowShorthand(), important); |
| 1225 case CSSPropertyFont: | 1193 case CSSPropertyFont: |
| 1226 // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [
/ 'line-height' ]? | 1194 // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [
/ 'line-height' ]? |
| 1227 // 'font-family' ] | inherit | 1195 // 'font-family' ] | inherit |
| 1228 return parseFont(important); | 1196 return parseFont(important); |
| 1229 case CSSPropertyListStyle: | 1197 case CSSPropertyListStyle: |
| 1230 return parseShorthand(propId, listStyleShorthand(), important); | 1198 return parseShorthand(propId, listStyleShorthand(), important); |
| 1231 case CSSPropertyWebkitTextStroke: | 1199 case CSSPropertyWebkitTextStroke: |
| 1232 return parseShorthand(propId, webkitTextStrokeShorthand(), important); | 1200 return parseShorthand(propId, webkitTextStrokeShorthand(), important); |
| 1233 case CSSPropertyAnimation: | 1201 case CSSPropertyAnimation: |
| 1234 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | |
| 1235 case CSSPropertyWebkitAnimation: | |
| 1236 return parseAnimationShorthand(propId, important); | 1202 return parseAnimationShorthand(propId, important); |
| 1237 case CSSPropertyTransition: | 1203 case CSSPropertyTransition: |
| 1238 case CSSPropertyWebkitTransition: | |
| 1239 return parseTransitionShorthand(propId, important); | 1204 return parseTransitionShorthand(propId, important); |
| 1240 case CSSPropertyInvalid: | 1205 case CSSPropertyInvalid: |
| 1241 return false; | 1206 return false; |
| 1242 case CSSPropertyPage: | 1207 case CSSPropertyPage: |
| 1243 return parsePage(propId, important); | 1208 return parsePage(propId, important); |
| 1244 // CSS Text Layout Module Level 3: Vertical writing support | 1209 // CSS Text Layout Module Level 3: Vertical writing support |
| 1245 case CSSPropertyWebkitTextEmphasis: | 1210 case CSSPropertyWebkitTextEmphasis: |
| 1246 return parseShorthand(propId, webkitTextEmphasisShorthand(), important); | 1211 return parseShorthand(propId, webkitTextEmphasisShorthand(), important); |
| 1247 | 1212 |
| 1248 case CSSPropertyWebkitTextEmphasisStyle: | 1213 case CSSPropertyWebkitTextEmphasisStyle: |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 // invalid shorthand and we have to ignore it | 1518 // invalid shorthand and we have to ignore it |
| 1554 if (!found) | 1519 if (!found) |
| 1555 return false; | 1520 return false; |
| 1556 } | 1521 } |
| 1557 | 1522 |
| 1558 for (size_t i = 0; i < numProperties; ++i) { | 1523 for (size_t i = 0; i < numProperties; ++i) { |
| 1559 // If we didn't find the property, set an intial value. | 1524 // If we didn't find the property, set an intial value. |
| 1560 if (!parsedProperty[i]) | 1525 if (!parsedProperty[i]) |
| 1561 values[i]->append(cssValuePool().createImplicitInitialValue()); | 1526 values[i]->append(cssValuePool().createImplicitInitialValue()); |
| 1562 | 1527 |
| 1563 if (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()) | 1528 addProperty(animationProperties.properties()[i], values[i].release(), im
portant); |
| 1564 addPropertyWithPrefixingVariant(animationProperties.properties()[i],
values[i].release(), important); | |
| 1565 else | |
| 1566 addProperty(animationProperties.properties()[i], values[i].release()
, important); | |
| 1567 } | 1529 } |
| 1568 | 1530 |
| 1569 return true; | 1531 return true; |
| 1570 } | 1532 } |
| 1571 | 1533 |
| 1572 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) | 1534 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) |
| 1573 { | 1535 { |
| 1574 const unsigned numProperties = 4; | 1536 const unsigned numProperties = 4; |
| 1575 const StylePropertyShorthand& shorthand = parsingShorthandForProperty(propId
); | 1537 const StylePropertyShorthand& shorthand = parsingShorthandForProperty(propId
); |
| 1576 ASSERT(numProperties == shorthand.length()); | 1538 ASSERT(numProperties == shorthand.length()); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1604 break; | 1566 break; |
| 1605 } | 1567 } |
| 1606 } | 1568 } |
| 1607 | 1569 |
| 1608 // if we didn't find at least one match, this is an | 1570 // if we didn't find at least one match, this is an |
| 1609 // invalid shorthand and we have to ignore it | 1571 // invalid shorthand and we have to ignore it |
| 1610 if (!found) | 1572 if (!found) |
| 1611 return false; | 1573 return false; |
| 1612 } | 1574 } |
| 1613 | 1575 |
| 1614 ASSERT(shorthand.properties()[3] == CSSPropertyTransitionProperty || shortha
nd.properties()[3] == CSSPropertyWebkitTransitionProperty); | 1576 ASSERT(shorthand.properties()[3] == CSSPropertyTransitionProperty); |
| 1615 if (!isValidTransitionPropertyList(values[3].get())) | 1577 if (!isValidTransitionPropertyList(values[3].get())) |
| 1616 return false; | 1578 return false; |
| 1617 | 1579 |
| 1618 // Fill in any remaining properties with the initial value and add | 1580 // Fill in any remaining properties with the initial value and add |
| 1619 for (size_t i = 0; i < numProperties; ++i) { | 1581 for (size_t i = 0; i < numProperties; ++i) { |
| 1620 if (!parsedProperty[i]) | 1582 if (!parsedProperty[i]) |
| 1621 values[i]->append(cssValuePool().createImplicitInitialValue()); | 1583 values[i]->append(cssValuePool().createImplicitInitialValue()); |
| 1622 addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].rel
ease(), important); | 1584 addProperty(shorthand.properties()[i], values[i].release(), important); |
| 1623 } | 1585 } |
| 1624 | 1586 |
| 1625 return true; | 1587 return true; |
| 1626 } | 1588 } |
| 1627 | 1589 |
| 1628 bool CSSPropertyParser::parseShorthand(CSSPropertyID propId, const StyleProperty
Shorthand& shorthand, bool important) | 1590 bool CSSPropertyParser::parseShorthand(CSSPropertyID propId, const StyleProperty
Shorthand& shorthand, bool important) |
| 1629 { | 1591 { |
| 1630 // We try to match as many properties as possible | 1592 // We try to match as many properties as possible |
| 1631 // We set up an array of booleans to mark which property has been found, | 1593 // We set up an array of booleans to mark which property has been found, |
| 1632 // and we try to search for properties until it makes no longer any sense. | 1594 // and we try to search for properties until it makes no longer any sense. |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 numSteps = clampToInteger(v->fValue); | 2620 numSteps = clampToInteger(v->fValue); |
| 2659 if (numSteps < 1) | 2621 if (numSteps < 1) |
| 2660 return nullptr; | 2622 return nullptr; |
| 2661 | 2623 |
| 2662 if (args->next()) { | 2624 if (args->next()) { |
| 2663 // There is a comma so we need to parse the second value | 2625 // There is a comma so we need to parse the second value |
| 2664 if (!consumeComma(args)) | 2626 if (!consumeComma(args)) |
| 2665 return nullptr; | 2627 return nullptr; |
| 2666 switch (args->current()->id) { | 2628 switch (args->current()->id) { |
| 2667 case CSSValueMiddle: | 2629 case CSSValueMiddle: |
| 2668 if (!RuntimeEnabledFeatures::webAnimationsAPIEnabled()) | |
| 2669 return nullptr; | |
| 2670 stepAtPosition = StepsTimingFunction::StepAtMiddle; | 2630 stepAtPosition = StepsTimingFunction::StepAtMiddle; |
| 2671 break; | 2631 break; |
| 2672 case CSSValueStart: | 2632 case CSSValueStart: |
| 2673 stepAtPosition = StepsTimingFunction::StepAtStart; | 2633 stepAtPosition = StepsTimingFunction::StepAtStart; |
| 2674 break; | 2634 break; |
| 2675 case CSSValueEnd: | 2635 case CSSValueEnd: |
| 2676 stepAtPosition = StepsTimingFunction::StepAtEnd; | 2636 stepAtPosition = StepsTimingFunction::StepAtEnd; |
| 2677 break; | 2637 break; |
| 2678 default: | 2638 default: |
| 2679 return nullptr; | 2639 return nullptr; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2708 } | 2668 } |
| 2709 | 2669 |
| 2710 return nullptr; | 2670 return nullptr; |
| 2711 } | 2671 } |
| 2712 | 2672 |
| 2713 PassRefPtr<CSSValue> CSSPropertyParser::parseAnimationProperty(CSSPropertyID pro
pId) | 2673 PassRefPtr<CSSValue> CSSPropertyParser::parseAnimationProperty(CSSPropertyID pro
pId) |
| 2714 { | 2674 { |
| 2715 RefPtr<CSSValue> value = nullptr; | 2675 RefPtr<CSSValue> value = nullptr; |
| 2716 switch (propId) { | 2676 switch (propId) { |
| 2717 case CSSPropertyAnimationDelay: | 2677 case CSSPropertyAnimationDelay: |
| 2718 case CSSPropertyWebkitAnimationDelay: | |
| 2719 case CSSPropertyTransitionDelay: | 2678 case CSSPropertyTransitionDelay: |
| 2720 case CSSPropertyWebkitTransitionDelay: | |
| 2721 value = parseAnimationDelay(); | 2679 value = parseAnimationDelay(); |
| 2722 break; | 2680 break; |
| 2723 case CSSPropertyAnimationDirection: | 2681 case CSSPropertyAnimationDirection: |
| 2724 case CSSPropertyWebkitAnimationDirection: | |
| 2725 value = parseAnimationDirection(); | 2682 value = parseAnimationDirection(); |
| 2726 break; | 2683 break; |
| 2727 case CSSPropertyAnimationDuration: | 2684 case CSSPropertyAnimationDuration: |
| 2728 case CSSPropertyWebkitAnimationDuration: | |
| 2729 case CSSPropertyTransitionDuration: | 2685 case CSSPropertyTransitionDuration: |
| 2730 case CSSPropertyWebkitTransitionDuration: | |
| 2731 value = parseAnimationDuration(); | 2686 value = parseAnimationDuration(); |
| 2732 break; | 2687 break; |
| 2733 case CSSPropertyAnimationFillMode: | 2688 case CSSPropertyAnimationFillMode: |
| 2734 case CSSPropertyWebkitAnimationFillMode: | |
| 2735 value = parseAnimationFillMode(); | 2689 value = parseAnimationFillMode(); |
| 2736 break; | 2690 break; |
| 2737 case CSSPropertyAnimationIterationCount: | 2691 case CSSPropertyAnimationIterationCount: |
| 2738 case CSSPropertyWebkitAnimationIterationCount: | |
| 2739 value = parseAnimationIterationCount(); | 2692 value = parseAnimationIterationCount(); |
| 2740 break; | 2693 break; |
| 2741 case CSSPropertyAnimationName: | 2694 case CSSPropertyAnimationName: |
| 2742 case CSSPropertyWebkitAnimationName: | |
| 2743 value = parseAnimationName(); | 2695 value = parseAnimationName(); |
| 2744 break; | 2696 break; |
| 2745 case CSSPropertyAnimationPlayState: | 2697 case CSSPropertyAnimationPlayState: |
| 2746 case CSSPropertyWebkitAnimationPlayState: | |
| 2747 value = parseAnimationPlayState(); | 2698 value = parseAnimationPlayState(); |
| 2748 break; | 2699 break; |
| 2749 case CSSPropertyTransitionProperty: | 2700 case CSSPropertyTransitionProperty: |
| 2750 case CSSPropertyWebkitTransitionProperty: | |
| 2751 value = parseAnimationProperty(); | 2701 value = parseAnimationProperty(); |
| 2752 break; | 2702 break; |
| 2753 case CSSPropertyAnimationTimingFunction: | 2703 case CSSPropertyAnimationTimingFunction: |
| 2754 case CSSPropertyWebkitAnimationTimingFunction: | |
| 2755 case CSSPropertyTransitionTimingFunction: | 2704 case CSSPropertyTransitionTimingFunction: |
| 2756 case CSSPropertyWebkitTransitionTimingFunction: | |
| 2757 value = parseAnimationTimingFunction(); | 2705 value = parseAnimationTimingFunction(); |
| 2758 break; | 2706 break; |
| 2759 default: | 2707 default: |
| 2760 ASSERT_NOT_REACHED(); | 2708 ASSERT_NOT_REACHED(); |
| 2761 return nullptr; | 2709 return nullptr; |
| 2762 } | 2710 } |
| 2763 | 2711 |
| 2764 if (value) | 2712 if (value) |
| 2765 m_valueList->next(); | 2713 m_valueList->next(); |
| 2766 return value.release(); | 2714 return value.release(); |
| 2767 } | 2715 } |
| 2768 | 2716 |
| 2769 PassRefPtr<CSSValueList> CSSPropertyParser::parseAnimationPropertyList(CSSProper
tyID propId) | 2717 PassRefPtr<CSSValueList> CSSPropertyParser::parseAnimationPropertyList(CSSProper
tyID propId) |
| 2770 { | 2718 { |
| 2771 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 2719 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 2772 while (m_valueList->current()) { | 2720 while (m_valueList->current()) { |
| 2773 RefPtr<CSSValue> value = parseAnimationProperty(propId); | 2721 RefPtr<CSSValue> value = parseAnimationProperty(propId); |
| 2774 if (!value) | 2722 if (!value) |
| 2775 return nullptr; | 2723 return nullptr; |
| 2776 list->append(value.release()); | 2724 list->append(value.release()); |
| 2777 if (CSSParserValue* parserValue = m_valueList->current()) { | 2725 if (CSSParserValue* parserValue = m_valueList->current()) { |
| 2778 if (!isComma(parserValue)) | 2726 if (!isComma(parserValue)) |
| 2779 return nullptr; | 2727 return nullptr; |
| 2780 m_valueList->next(); | 2728 m_valueList->next(); |
| 2781 ASSERT(m_valueList->current()); | 2729 ASSERT(m_valueList->current()); |
| 2782 } | 2730 } |
| 2783 } | 2731 } |
| 2784 if ((propId == CSSPropertyTransitionProperty || propId == CSSPropertyWebkitT
ransitionProperty) && !isValidTransitionPropertyList(list.get())) | 2732 if (propId == CSSPropertyTransitionProperty && !isValidTransitionPropertyLis
t(list.get())) |
| 2785 return nullptr; | 2733 return nullptr; |
| 2786 ASSERT(list->length()); | 2734 ASSERT(list->length()); |
| 2787 return list.release(); | 2735 return list.release(); |
| 2788 } | 2736 } |
| 2789 | 2737 |
| 2790 static inline bool isCSSWideKeyword(CSSParserValue& value) | 2738 static inline bool isCSSWideKeyword(CSSParserValue& value) |
| 2791 { | 2739 { |
| 2792 return value.id == CSSValueInitial || value.id == CSSValueInherit || value.i
d == CSSValueDefault; | 2740 return value.id == CSSValueInitial || value.id == CSSValueInherit || value.i
d == CSSValueDefault; |
| 2793 } | 2741 } |
| 2794 | 2742 |
| (...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6196 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 6144 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 6197 } | 6145 } |
| 6198 | 6146 |
| 6199 bool CSSPropertyParser::isSystemColor(int id) | 6147 bool CSSPropertyParser::isSystemColor(int id) |
| 6200 { | 6148 { |
| 6201 // FIXME(sky): remove | 6149 // FIXME(sky): remove |
| 6202 return false; | 6150 return false; |
| 6203 } | 6151 } |
| 6204 | 6152 |
| 6205 } // namespace blink | 6153 } // namespace blink |
| OLD | NEW |