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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp

Issue 2101143005: 0 -> nullptr for UseCounter pointer in CSSParserContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo Created 4 years, 5 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 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/resolver/CSSVariableResolver.h" 5 #include "core/css/resolver/CSSVariableResolver.h"
6 6
7 #include "core/CSSPropertyNames.h" 7 #include "core/CSSPropertyNames.h"
8 #include "core/CSSValueKeywords.h" 8 #include "core/CSSValueKeywords.h"
9 #include "core/StyleBuilderFunctions.h" 9 #include "core/StyleBuilderFunctions.h"
10 #include "core/StylePropertyShorthand.h" 10 #include "core/StylePropertyShorthand.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return CSSUnsetValue::create(); 142 return CSSUnsetValue::create();
143 return result; 143 return result;
144 } 144 }
145 145
146 void CSSVariableResolver::resolveAndApplyVariableReferences(StyleResolverState& state, CSSPropertyID id, const CSSVariableReferenceValue& value) 146 void CSSVariableResolver::resolveAndApplyVariableReferences(StyleResolverState& state, CSSPropertyID id, const CSSVariableReferenceValue& value)
147 { 147 {
148 CSSVariableResolver resolver(state.style()->variables()); 148 CSSVariableResolver resolver(state.style()->variables());
149 149
150 Vector<CSSParserToken> tokens; 150 Vector<CSSParserToken> tokens;
151 if (resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens)) { 151 if (resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens)) {
152 CSSParserContext context(HTMLStandardMode, 0); 152 CSSParserContext context(HTMLStandardMode, nullptr);
153 153
154 HeapVector<CSSProperty, 256> parsedProperties; 154 HeapVector<CSSProperty, 256> parsedProperties;
155 155
156 // TODO: Non-shorthands should just call CSSPropertyParser::parseSingleV alue 156 // TODO: Non-shorthands should just call CSSPropertyParser::parseSingleV alue
157 if (CSSPropertyParser::parseValue(id, false, CSSParserTokenRange(tokens) , context, parsedProperties, StyleRule::RuleType::Style)) { 157 if (CSSPropertyParser::parseValue(id, false, CSSParserTokenRange(tokens) , context, parsedProperties, StyleRule::RuleType::Style)) {
158 unsigned parsedPropertiesCount = parsedProperties.size(); 158 unsigned parsedPropertiesCount = parsedProperties.size();
159 for (unsigned i = 0; i < parsedPropertiesCount; ++i) 159 for (unsigned i = 0; i < parsedPropertiesCount; ++i)
160 StyleBuilder::applyProperty(parsedProperties[i].id(), state, *pa rsedProperties[i].value()); 160 StyleBuilder::applyProperty(parsedProperties[i].id(), state, *pa rsedProperties[i].value());
161 return; 161 return;
162 } 162 }
(...skipping 21 matching lines...) Expand all
184 variable.value = resolver.resolveCustomProperty(variable.key, *varia ble.value); 184 variable.value = resolver.resolveCustomProperty(variable.key, *varia ble.value);
185 } 185 }
186 } 186 }
187 187
188 CSSVariableResolver::CSSVariableResolver(StyleVariableData* styleVariableData) 188 CSSVariableResolver::CSSVariableResolver(StyleVariableData* styleVariableData)
189 : m_styleVariableData(styleVariableData) 189 : m_styleVariableData(styleVariableData)
190 { 190 {
191 } 191 }
192 192
193 } // namespace blink 193 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserMode.cpp ('k') | third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698