Chromium Code Reviews| 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 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3691 case CSSPropertyAnimationFillMode: | 3691 case CSSPropertyAnimationFillMode: |
| 3692 case CSSPropertyAnimationIterationCount: | 3692 case CSSPropertyAnimationIterationCount: |
| 3693 case CSSPropertyAnimationName: | 3693 case CSSPropertyAnimationName: |
| 3694 case CSSPropertyAnimationPlayState: | 3694 case CSSPropertyAnimationPlayState: |
| 3695 case CSSPropertyTransitionProperty: | 3695 case CSSPropertyTransitionProperty: |
| 3696 case CSSPropertyAnimationTimingFunction: | 3696 case CSSPropertyAnimationTimingFunction: |
| 3697 case CSSPropertyTransitionTimingFunction: | 3697 case CSSPropertyTransitionTimingFunction: |
| 3698 return consumeAnimationPropertyList(property, m_range, m_context, unreso lvedProperty == CSSPropertyAliasWebkitAnimationName); | 3698 return consumeAnimationPropertyList(property, m_range, m_context, unreso lvedProperty == CSSPropertyAliasWebkitAnimationName); |
| 3699 case CSSPropertyGridColumnGap: | 3699 case CSSPropertyGridColumnGap: |
| 3700 case CSSPropertyGridRowGap: | 3700 case CSSPropertyGridRowGap: |
| 3701 return consumeLength(m_range, m_context.mode(), ValueRangeNonNegative); | 3701 return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNe gative, UnitlessQuirk::Allow); |
|
cbiesinger
2016/06/22 18:46:13
Why do you want to allow unitless numbers, particu
jfernandez
2016/06/27 23:56:47
I did allow unitless numbers that for consistency
Timothy Loh
2016/06/28 00:04:45
<track-breadth> doesn't support the unitless quirk
jfernandez
2016/06/28 00:15:19
Done.
I'll add a TODO to change the track-breadth
| |
| 3702 case CSSPropertyShapeMargin: | 3702 case CSSPropertyShapeMargin: |
| 3703 return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNe gative); | 3703 return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNe gative); |
| 3704 case CSSPropertyShapeImageThreshold: | 3704 case CSSPropertyShapeImageThreshold: |
| 3705 return consumeNumber(m_range, ValueRangeAll); | 3705 return consumeNumber(m_range, ValueRangeAll); |
| 3706 case CSSPropertyWebkitBoxOrdinalGroup: | 3706 case CSSPropertyWebkitBoxOrdinalGroup: |
| 3707 case CSSPropertyOrphans: | 3707 case CSSPropertyOrphans: |
| 3708 case CSSPropertyWidows: | 3708 case CSSPropertyWidows: |
| 3709 return consumePositiveInteger(m_range); | 3709 return consumePositiveInteger(m_range); |
| 3710 case CSSPropertyTextDecorationColor: | 3710 case CSSPropertyTextDecorationColor: |
| 3711 ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled()); | 3711 ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled()); |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5131 addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgro undRepeatX : CSSPropertyWebkitMaskRepeatX, property, resultX, important, implici t); | 5131 addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgro undRepeatX : CSSPropertyWebkitMaskRepeatX, property, resultX, important, implici t); |
| 5132 addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgro undRepeatY : CSSPropertyWebkitMaskRepeatY, property, resultY, important, implici t); | 5132 addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgro undRepeatY : CSSPropertyWebkitMaskRepeatY, property, resultY, important, implici t); |
| 5133 return true; | 5133 return true; |
| 5134 } | 5134 } |
| 5135 case CSSPropertyBackground: | 5135 case CSSPropertyBackground: |
| 5136 return consumeBackgroundShorthand(backgroundShorthand(), important); | 5136 return consumeBackgroundShorthand(backgroundShorthand(), important); |
| 5137 case CSSPropertyWebkitMask: | 5137 case CSSPropertyWebkitMask: |
| 5138 return consumeBackgroundShorthand(webkitMaskShorthand(), important); | 5138 return consumeBackgroundShorthand(webkitMaskShorthand(), important); |
| 5139 case CSSPropertyGridGap: { | 5139 case CSSPropertyGridGap: { |
| 5140 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled() && shorthandForPro perty(CSSPropertyGridGap).length() == 2); | 5140 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled() && shorthandForPro perty(CSSPropertyGridGap).length() == 2); |
| 5141 CSSValue* rowGap = consumeLength(m_range, m_context.mode(), ValueRangeNo nNegative); | 5141 CSSValue* rowGap = consumeLengthOrPercent(m_range, m_context.mode(), Val ueRangeNonNegative, UnitlessQuirk::Allow); |
| 5142 CSSValue* columnGap = consumeLength(m_range, m_context.mode(), ValueRang eNonNegative); | 5142 CSSValue* columnGap = consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow); |
| 5143 if (!rowGap || !m_range.atEnd()) | 5143 if (!rowGap || !m_range.atEnd()) |
| 5144 return false; | 5144 return false; |
| 5145 if (!columnGap) | 5145 if (!columnGap) |
| 5146 columnGap = rowGap; | 5146 columnGap = rowGap; |
| 5147 addProperty(CSSPropertyGridRowGap, CSSPropertyGridGap, rowGap, important ); | 5147 addProperty(CSSPropertyGridRowGap, CSSPropertyGridGap, rowGap, important ); |
| 5148 addProperty(CSSPropertyGridColumnGap, CSSPropertyGridGap, columnGap, imp ortant); | 5148 addProperty(CSSPropertyGridColumnGap, CSSPropertyGridGap, columnGap, imp ortant); |
| 5149 return true; | 5149 return true; |
| 5150 } | 5150 } |
| 5151 case CSSPropertyGridColumn: | 5151 case CSSPropertyGridColumn: |
| 5152 case CSSPropertyGridRow: | 5152 case CSSPropertyGridRow: |
| 5153 return consumeGridItemPositionShorthand(property, important); | 5153 return consumeGridItemPositionShorthand(property, important); |
| 5154 case CSSPropertyGridArea: | 5154 case CSSPropertyGridArea: |
| 5155 return consumeGridAreaShorthand(important); | 5155 return consumeGridAreaShorthand(important); |
| 5156 case CSSPropertyGridTemplate: | 5156 case CSSPropertyGridTemplate: |
| 5157 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5157 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
| 5158 case CSSPropertyGrid: | 5158 case CSSPropertyGrid: |
| 5159 return consumeGridShorthand(important); | 5159 return consumeGridShorthand(important); |
| 5160 default: | 5160 default: |
| 5161 return false; | 5161 return false; |
| 5162 } | 5162 } |
| 5163 } | 5163 } |
| 5164 | 5164 |
| 5165 } // namespace blink | 5165 } // namespace blink |
| OLD | NEW |