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 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3014 } | 3014 } |
3015 | 3015 |
3016 if (spanValue && !numericValue && !gridLineName) | 3016 if (spanValue && !numericValue && !gridLineName) |
3017 return nullptr; // "span" keyword alone is invalid. | 3017 return nullptr; // "span" keyword alone is invalid. |
3018 if (spanValue && numericValue && numericValue->getIntValue() < 0) | 3018 if (spanValue && numericValue && numericValue->getIntValue() < 0) |
3019 return nullptr; // Negative numbers are not allowed for span. | 3019 return nullptr; // Negative numbers are not allowed for span. |
3020 if (numericValue && numericValue->getIntValue() == 0) | 3020 if (numericValue && numericValue->getIntValue() == 0) |
3021 return nullptr; // An <integer> value of zero makes the declaration | 3021 return nullptr; // An <integer> value of zero makes the declaration |
3022 // invalid. | 3022 // invalid. |
3023 | 3023 |
3024 if (numericValue) { | |
3025 numericValue = CSSPrimitiveValue::create( | |
3026 numericValue->getIntValueClamped(-kGridMaxTracks, kGridMaxTracks), | |
svillar
2016/12/16 10:58:33
Instead of using this you can get the int value an
Manuel Rego
2016/12/16 11:28:41
Yeah sure. Good idea.
| |
3027 CSSPrimitiveValue::UnitType::Integer); | |
3028 } | |
3029 | |
3024 CSSValueList* values = CSSValueList::createSpaceSeparated(); | 3030 CSSValueList* values = CSSValueList::createSpaceSeparated(); |
3025 if (spanValue) | 3031 if (spanValue) |
3026 values->append(*spanValue); | 3032 values->append(*spanValue); |
3027 if (numericValue) | 3033 if (numericValue) |
3028 values->append(*numericValue); | 3034 values->append(*numericValue); |
3029 if (gridLineName) | 3035 if (gridLineName) |
3030 values->append(*gridLineName); | 3036 values->append(*gridLineName); |
3031 ASSERT(values->length()); | 3037 ASSERT(values->length()); |
3032 return values; | 3038 return values; |
3033 } | 3039 } |
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5328 case CSSPropertyGridTemplate: | 5334 case CSSPropertyGridTemplate: |
5329 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5335 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5330 case CSSPropertyGrid: | 5336 case CSSPropertyGrid: |
5331 return consumeGridShorthand(important); | 5337 return consumeGridShorthand(important); |
5332 default: | 5338 default: |
5333 return false; | 5339 return false; |
5334 } | 5340 } |
5335 } | 5341 } |
5336 | 5342 |
5337 } // namespace blink | 5343 } // namespace blink |
OLD | NEW |