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

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

Issue 1920583002: NOT FOR LANDING: Hack up CSSParser for speed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing consts. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
index a1cf7fbcf16f2f6d58513a2a84e8e2c5a4483f8c..d4819b38ce7bd53a3f2fe02a8f806634bbef9446 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -55,7 +55,7 @@ PassRefPtr<CSSVariableData> CSSVariableResolver::resolveCustomProperty(AtomicStr
Vector<CSSParserToken> tokens;
m_variablesSeen.add(name);
- bool success = resolveTokenRange(variableData.tokens(), tokens);
+ bool success = resolveTokenRange(variableData.tokenRange(), tokens);
m_variablesSeen.remove(name);
// The old variable data holds onto the backing string the new resolved CSSVariableData
@@ -135,9 +135,9 @@ CSSValue* CSSVariableResolver::resolveVariableReferences(StyleVariableData* styl
CSSVariableResolver resolver(styleVariableData);
Vector<CSSParserToken> tokens;
- if (!resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens))
+ if (!resolver.resolveTokenRange(value.variableDataValue()->tokenRange(), tokens))
return cssValuePool().createUnsetValue();
- CSSValue* result = CSSPropertyParser::parseSingleValue(id, tokens, strictCSSParserContext());
+ CSSValue* result = CSSPropertyParser::parseSingleValue(id, CSSParserTokenRange(tokens.begin(), tokens.end()), strictCSSParserContext());
if (!result)
return cssValuePool().createUnsetValue();
return result;
@@ -148,13 +148,13 @@ void CSSVariableResolver::resolveAndApplyVariableReferences(StyleResolverState&
CSSVariableResolver resolver(state.style()->variables());
Vector<CSSParserToken> tokens;
- if (resolver.resolveTokenRange(value.variableDataValue()->tokens(), tokens)) {
+ if (resolver.resolveTokenRange(value.variableDataValue()->tokenRange(), tokens)) {
CSSParserContext context(HTMLStandardMode, 0);
HeapVector<CSSProperty, 256> parsedProperties;
// TODO: Non-shorthands should just call CSSPropertyParser::parseSingleValue
- if (CSSPropertyParser::parseValue(id, false, CSSParserTokenRange(tokens), context, parsedProperties, StyleRule::RuleType::Style)) {
+ if (CSSPropertyParser::parseValue(id, false, CSSParserTokenRange(tokens.begin(), tokens.end()), context, parsedProperties, StyleRule::RuleType::Style)) {
unsigned parsedPropertiesCount = parsedProperties.size();
for (unsigned i = 0; i < parsedPropertiesCount; ++i)
StyleBuilder::applyProperty(parsedProperties[i].id(), state, parsedProperties[i].value());

Powered by Google App Engine
This is Rietveld 408576698