OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/parser/CSSPropertyParser.h" | 5 #include "core/css/parser/CSSPropertyParser.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/css/CSSBasicShapeValues.h" | 8 #include "core/css/CSSBasicShapeValues.h" |
9 #include "core/css/CSSBorderImage.h" | 9 #include "core/css/CSSBorderImage.h" |
10 #include "core/css/CSSContentDistributionValue.h" | 10 #include "core/css/CSSContentDistributionValue.h" |
(...skipping 3237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3248 CSSValueID id = range.peek().id(); | 3248 CSSValueID id = range.peek().id(); |
3249 if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter | 3249 if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter |
3250 || id == CSSValueSelfStart || id == CSSValueSelfEnd || id == CSSValueFle xStart | 3250 || id == CSSValueSelfStart || id == CSSValueSelfEnd || id == CSSValueFle xStart |
3251 || id == CSSValueFlexEnd || id == CSSValueLeft || id == CSSValueRight) | 3251 || id == CSSValueFlexEnd || id == CSSValueLeft || id == CSSValueRight) |
3252 return consumeIdent(range); | 3252 return consumeIdent(range); |
3253 return nullptr; | 3253 return nullptr; |
3254 } | 3254 } |
3255 | 3255 |
3256 static PassRefPtrWillBeRawPtr<CSSValue> consumeSelfPositionOverflowPosition(CSSP arserTokenRange& range) | 3256 static PassRefPtrWillBeRawPtr<CSSValue> consumeSelfPositionOverflowPosition(CSSP arserTokenRange& range) |
3257 { | 3257 { |
3258 if (identMatches<CSSValueAuto, CSSValueStretch, CSSValueBaseline, CSSValueLa stBaseline>(range.peek().id())) | 3258 if (identMatches<CSSValueAuto, CSSValueNormal, CSSValueStretch, CSSValueBase line, CSSValueLastBaseline>(range.peek().id())) |
3259 return consumeIdent(range); | 3259 return consumeIdent(range); |
3260 | 3260 |
3261 RefPtrWillBeRawPtr<CSSPrimitiveValue> overflowPosition = consumeIdent<CSSVal ueUnsafe, CSSValueSafe>(range); | 3261 RefPtrWillBeRawPtr<CSSPrimitiveValue> overflowPosition = consumeIdent<CSSVal ueUnsafe, CSSValueSafe>(range); |
3262 RefPtrWillBeRawPtr<CSSPrimitiveValue> selfPosition = consumeSelfPositionKeyw ord(range); | 3262 RefPtrWillBeRawPtr<CSSPrimitiveValue> selfPosition = consumeSelfPositionKeyw ord(range); |
3263 if (!selfPosition) | 3263 if (!selfPosition) |
3264 return nullptr; | 3264 return nullptr; |
3265 if (!overflowPosition) | 3265 if (!overflowPosition) |
3266 overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); | 3266 overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); |
3267 if (overflowPosition) | 3267 if (overflowPosition) |
3268 return CSSValuePair::create(selfPosition.release(), overflowPosition, CS SValuePair::DropIdenticalValues); | 3268 return CSSValuePair::create(selfPosition.release(), overflowPosition, CS SValuePair::DropIdenticalValues); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3630 case CSSPropertyWebkitMaskComposite: | 3630 case CSSPropertyWebkitMaskComposite: |
3631 case CSSPropertyWebkitMaskImage: | 3631 case CSSPropertyWebkitMaskImage: |
3632 case CSSPropertyWebkitMaskOrigin: | 3632 case CSSPropertyWebkitMaskOrigin: |
3633 case CSSPropertyWebkitMaskPositionX: | 3633 case CSSPropertyWebkitMaskPositionX: |
3634 case CSSPropertyWebkitMaskPositionY: | 3634 case CSSPropertyWebkitMaskPositionY: |
3635 case CSSPropertyWebkitMaskSize: | 3635 case CSSPropertyWebkitMaskSize: |
3636 return consumeCommaSeparatedBackgroundComponent(unresolvedProperty, m_ra nge, m_context); | 3636 return consumeCommaSeparatedBackgroundComponent(unresolvedProperty, m_ra nge, m_context); |
3637 case CSSPropertyWebkitMaskRepeatX: | 3637 case CSSPropertyWebkitMaskRepeatX: |
3638 case CSSPropertyWebkitMaskRepeatY: | 3638 case CSSPropertyWebkitMaskRepeatY: |
3639 return nullptr; | 3639 return nullptr; |
3640 case CSSPropertyAlignItems: | |
3641 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | |
3642 if (identMatches<CSSValueAuto>(m_range.peek().id())) { | |
Timothy Loh
2016/03/15 00:30:28
Can we just make a separate function for align-ite
| |
3643 // align-items property does not allow the 'auto' value. | |
3644 return nullptr; | |
3645 } | |
3640 case CSSPropertyJustifySelf: | 3646 case CSSPropertyJustifySelf: |
3641 case CSSPropertyAlignSelf: | 3647 case CSSPropertyAlignSelf: |
3642 case CSSPropertyAlignItems: | |
3643 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 3648 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
3644 return consumeSelfPositionOverflowPosition(m_range); | 3649 return consumeSelfPositionOverflowPosition(m_range); |
3645 case CSSPropertyJustifyItems: | 3650 case CSSPropertyJustifyItems: |
3646 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 3651 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
3647 return consumeJustifyItems(m_range); | 3652 return consumeJustifyItems(m_range); |
3648 default: | 3653 default: |
3649 CSSParserValueList valueList(m_range); | 3654 CSSParserValueList valueList(m_range); |
3650 if (valueList.size()) { | 3655 if (valueList.size()) { |
3651 m_valueList = &valueList; | 3656 m_valueList = &valueList; |
3652 if (RefPtrWillBeRawPtr<CSSValue> result = legacyParseValue(unresolve dProperty)) { | 3657 if (RefPtrWillBeRawPtr<CSSValue> result = legacyParseValue(unresolve dProperty)) { |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4581 m_currentShorthand = oldShorthand; | 4586 m_currentShorthand = oldShorthand; |
4582 CSSParserValueList valueList(m_range); | 4587 CSSParserValueList valueList(m_range); |
4583 if (!valueList.size()) | 4588 if (!valueList.size()) |
4584 return false; | 4589 return false; |
4585 m_valueList = &valueList; | 4590 m_valueList = &valueList; |
4586 return legacyParseShorthand(unresolvedProperty, important); | 4591 return legacyParseShorthand(unresolvedProperty, important); |
4587 } | 4592 } |
4588 } | 4593 } |
4589 | 4594 |
4590 } // namespace blink | 4595 } // namespace blink |
OLD | NEW |