Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIContain.cpp

Issue 2808383008: Added unresolved property argument to ParseSingleValue method (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/CSSPropertyAPIContain.h" 5 #include "core/css/properties/CSSPropertyAPIContain.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 10
11 namespace blink { 11 namespace blink {
12 12
13 // none | strict | content | [ layout || style || paint || size ] 13 // none | strict | content | [ layout || style || paint || size ]
14 const CSSValue* CSSPropertyAPIContain::parseSingleValue( 14 const CSSValue* CSSPropertyAPIContain::parseSingleValue(
15 CSSParserTokenRange& range, 15 CSSParserTokenRange& range,
16 const CSSParserContext& context) { 16 const CSSParserContext& context,
17 CSSPropertyID) {
17 CSSValueID id = range.Peek().Id(); 18 CSSValueID id = range.Peek().Id();
18 if (id == CSSValueNone) 19 if (id == CSSValueNone)
19 return CSSPropertyParserHelpers::ConsumeIdent(range); 20 return CSSPropertyParserHelpers::ConsumeIdent(range);
20 21
21 CSSValueList* list = CSSValueList::CreateSpaceSeparated(); 22 CSSValueList* list = CSSValueList::CreateSpaceSeparated();
22 if (id == CSSValueStrict || id == CSSValueContent) { 23 if (id == CSSValueStrict || id == CSSValueContent) {
23 list->Append(*CSSPropertyParserHelpers::ConsumeIdent(range)); 24 list->Append(*CSSPropertyParserHelpers::ConsumeIdent(range));
24 return list; 25 return list;
25 } 26 }
26 while (true) { 27 while (true) {
27 CSSIdentifierValue* ident = CSSPropertyParserHelpers::ConsumeIdent< 28 CSSIdentifierValue* ident = CSSPropertyParserHelpers::ConsumeIdent<
28 CSSValuePaint, CSSValueLayout, CSSValueStyle, CSSValueSize>(range); 29 CSSValuePaint, CSSValueLayout, CSSValueStyle, CSSValueSize>(range);
29 if (!ident) 30 if (!ident)
30 break; 31 break;
31 if (list->HasValue(*ident)) 32 if (list->HasValue(*ident))
32 return nullptr; 33 return nullptr;
33 list->Append(*ident); 34 list->Append(*ident);
34 } 35 }
35 36
36 if (!list->length()) 37 if (!list->length())
37 return nullptr; 38 return nullptr;
38 return list; 39 return list;
39 } 40 }
40 41
41 } // namespace blink 42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698