| 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/CSSPropertyAPIQuotes.h" | 5 #include "core/css/properties/CSSPropertyAPIQuotes.h" |
| 6 | 6 |
| 7 #include "core/css/CSSStringValue.h" | 7 #include "core/css/CSSStringValue.h" |
| 8 #include "core/css/CSSValueList.h" | 8 #include "core/css/CSSValueList.h" |
| 9 #include "core/css/parser/CSSParserContext.h" | 9 #include "core/css/parser/CSSParserContext.h" |
| 10 #include "core/css/parser/CSSPropertyParserHelpers.h" | 10 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 const CSSValue* CSSPropertyAPIQuotes::parseSingleValue( | 14 const CSSValue* CSSPropertyAPIQuotes::parseSingleValue( |
| 15 CSSParserTokenRange& range, | 15 CSSParserTokenRange& range, |
| 16 const CSSParserContext& context) { | 16 const CSSParserContext& context, |
| 17 CSSPropertyID) { |
| 17 if (range.Peek().Id() == CSSValueNone) | 18 if (range.Peek().Id() == CSSValueNone) |
| 18 return CSSPropertyParserHelpers::ConsumeIdent(range); | 19 return CSSPropertyParserHelpers::ConsumeIdent(range); |
| 19 CSSValueList* values = CSSValueList::CreateSpaceSeparated(); | 20 CSSValueList* values = CSSValueList::CreateSpaceSeparated(); |
| 20 while (!range.AtEnd()) { | 21 while (!range.AtEnd()) { |
| 21 CSSStringValue* parsed_value = | 22 CSSStringValue* parsed_value = |
| 22 CSSPropertyParserHelpers::ConsumeString(range); | 23 CSSPropertyParserHelpers::ConsumeString(range); |
| 23 if (!parsed_value) | 24 if (!parsed_value) |
| 24 return nullptr; | 25 return nullptr; |
| 25 values->Append(*parsed_value); | 26 values->Append(*parsed_value); |
| 26 } | 27 } |
| 27 if (values->length() && values->length() % 2 == 0) | 28 if (values->length() && values->length() % 2 == 0) |
| 28 return values; | 29 return values; |
| 29 return nullptr; | 30 return nullptr; |
| 30 } | 31 } |
| 31 | 32 |
| 32 } // namespace blink | 33 } // namespace blink |
| OLD | NEW |