| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/properties/CSSPropertyAPIGridAutoFlow.h" | 5 #include "core/css/properties/CSSPropertyAPIGridAutoFlow.h" |
| 6 | 6 |
| 7 #include "core/css/CSSIdentifierValue.h" | 7 #include "core/css/CSSIdentifierValue.h" |
| 8 #include "core/css/CSSValueList.h" | 8 #include "core/css/CSSValueList.h" |
| 9 #include "core/css/parser/CSSPropertyParserHelpers.h" | 9 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 const CSSValue* CSSPropertyAPIGridAutoFlow::parseSingleValue( | 14 const CSSValue* CSSPropertyAPIGridAutoFlow::parseSingleValue( |
| 15 CSSParserTokenRange& range, | 15 CSSParserTokenRange& range, |
| 16 const CSSParserContext& context) { | 16 const CSSParserContext& context, |
| 17 CSSPropertyID) { |
| 17 DCHECK(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 18 DCHECK(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
| 18 CSSIdentifierValue* row_or_column_value = | 19 CSSIdentifierValue* row_or_column_value = |
| 19 CSSPropertyParserHelpers::ConsumeIdent<CSSValueRow, CSSValueColumn>( | 20 CSSPropertyParserHelpers::ConsumeIdent<CSSValueRow, CSSValueColumn>( |
| 20 range); | 21 range); |
| 21 CSSIdentifierValue* dense_algorithm = | 22 CSSIdentifierValue* dense_algorithm = |
| 22 CSSPropertyParserHelpers::ConsumeIdent<CSSValueDense>(range); | 23 CSSPropertyParserHelpers::ConsumeIdent<CSSValueDense>(range); |
| 23 if (!row_or_column_value) { | 24 if (!row_or_column_value) { |
| 24 row_or_column_value = | 25 row_or_column_value = |
| 25 CSSPropertyParserHelpers::ConsumeIdent<CSSValueRow, CSSValueColumn>( | 26 CSSPropertyParserHelpers::ConsumeIdent<CSSValueRow, CSSValueColumn>( |
| 26 range); | 27 range); |
| 27 if (!row_or_column_value && !dense_algorithm) | 28 if (!row_or_column_value && !dense_algorithm) |
| 28 return nullptr; | 29 return nullptr; |
| 29 } | 30 } |
| 30 CSSValueList* parsed_values = CSSValueList::CreateSpaceSeparated(); | 31 CSSValueList* parsed_values = CSSValueList::CreateSpaceSeparated(); |
| 31 if (row_or_column_value) | 32 if (row_or_column_value) |
| 32 parsed_values->Append(*row_or_column_value); | 33 parsed_values->Append(*row_or_column_value); |
| 33 if (dense_algorithm) | 34 if (dense_algorithm) |
| 34 parsed_values->Append(*dense_algorithm); | 35 parsed_values->Append(*dense_algorithm); |
| 35 return parsed_values; | 36 return parsed_values; |
| 36 } | 37 } |
| 37 | 38 |
| 38 } // namespace blink | 39 } // namespace blink |
| OLD | NEW |