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

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

Issue 2801893003: Revert of Changed CSSParserContext argument from * to & for null safety. (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/CSSPropertyAPIContent.h" 5 #include "core/css/properties/CSSPropertyAPIContent.h"
6 6
7 #include "core/CSSValueKeywords.h" 7 #include "core/CSSValueKeywords.h"
8 #include "core/css/CSSCounterValue.h" 8 #include "core/css/CSSCounterValue.h"
9 #include "core/css/CSSFunctionValue.h" 9 #include "core/css/CSSFunctionValue.h"
10 #include "core/css/CSSStringValue.h" 10 #include "core/css/CSSStringValue.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 if (!args.atEnd()) 66 if (!args.atEnd())
67 return nullptr; 67 return nullptr;
68 return CSSCounterValue::create(identifier, listStyle, separator); 68 return CSSCounterValue::create(identifier, listStyle, separator);
69 } 69 }
70 70
71 } // namespace 71 } // namespace
72 72
73 const CSSValue* CSSPropertyAPIContent::parseSingleValue( 73 const CSSValue* CSSPropertyAPIContent::parseSingleValue(
74 CSSParserTokenRange& range, 74 CSSParserTokenRange& range,
75 const CSSParserContext& context) { 75 const CSSParserContext* context) {
76 if (CSSPropertyParserHelpers::identMatches<CSSValueNone, CSSValueNormal>( 76 if (CSSPropertyParserHelpers::identMatches<CSSValueNone, CSSValueNormal>(
77 range.peek().id())) 77 range.peek().id()))
78 return CSSPropertyParserHelpers::consumeIdent(range); 78 return CSSPropertyParserHelpers::consumeIdent(range);
79 79
80 CSSValueList* values = CSSValueList::createSpaceSeparated(); 80 CSSValueList* values = CSSValueList::createSpaceSeparated();
81 81
82 do { 82 do {
83 CSSValue* parsedValue = 83 CSSValue* parsedValue =
84 CSSPropertyParserHelpers::consumeImage(range, &context); 84 CSSPropertyParserHelpers::consumeImage(range, context);
85 if (!parsedValue) { 85 if (!parsedValue) {
86 parsedValue = CSSPropertyParserHelpers::consumeIdent< 86 parsedValue = CSSPropertyParserHelpers::consumeIdent<
87 CSSValueOpenQuote, CSSValueCloseQuote, CSSValueNoOpenQuote, 87 CSSValueOpenQuote, CSSValueCloseQuote, CSSValueNoOpenQuote,
88 CSSValueNoCloseQuote>(range); 88 CSSValueNoCloseQuote>(range);
89 } 89 }
90 if (!parsedValue) 90 if (!parsedValue)
91 parsedValue = CSSPropertyParserHelpers::consumeString(range); 91 parsedValue = CSSPropertyParserHelpers::consumeString(range);
92 if (!parsedValue) { 92 if (!parsedValue) {
93 if (range.peek().functionId() == CSSValueAttr) { 93 if (range.peek().functionId() == CSSValueAttr) {
94 parsedValue = consumeAttr( 94 parsedValue = consumeAttr(
95 CSSPropertyParserHelpers::consumeFunction(range), &context); 95 CSSPropertyParserHelpers::consumeFunction(range), context);
96 } else if (range.peek().functionId() == CSSValueCounter) { 96 } else if (range.peek().functionId() == CSSValueCounter) {
97 parsedValue = consumeCounterContent( 97 parsedValue = consumeCounterContent(
98 CSSPropertyParserHelpers::consumeFunction(range), false); 98 CSSPropertyParserHelpers::consumeFunction(range), false);
99 } else if (range.peek().functionId() == CSSValueCounters) { 99 } else if (range.peek().functionId() == CSSValueCounters) {
100 parsedValue = consumeCounterContent( 100 parsedValue = consumeCounterContent(
101 CSSPropertyParserHelpers::consumeFunction(range), true); 101 CSSPropertyParserHelpers::consumeFunction(range), true);
102 } 102 }
103 if (!parsedValue) 103 if (!parsedValue)
104 return nullptr; 104 return nullptr;
105 } 105 }
106 values->append(*parsedValue); 106 values->append(*parsedValue);
107 } while (!range.atEnd()); 107 } while (!range.atEnd());
108 108
109 return values; 109 return values;
110 } 110 }
111 111
112 } // namespace blink 112 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698