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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 2323633002: Implement animation tainted custom property values (Closed)
Patch Set: Rebased Created 4 years, 2 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/parser/CSSParserImpl.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
index 2ac772f7556716a66238dbe9a7d92f87a52c0a8b..1e0c65a9e15b5e76dd3d6f9e0b7cc51a897eccec 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -63,10 +63,12 @@ bool CSSParserImpl::parseVariableValue(MutableStylePropertySet* declaration,
const AtomicString& propertyName,
const String& value,
bool important,
- const CSSParserContext& context) {
+ const CSSParserContext& context,
+ bool isAnimationTainted) {
CSSParserImpl parser(context);
CSSTokenizer::Scope scope(value);
- parser.consumeVariableValue(scope.tokenRange(), propertyName, important);
+ parser.consumeVariableValue(scope.tokenRange(), propertyName, important,
+ isAnimationTainted);
if (parser.m_parsedProperties.isEmpty())
return false;
return declaration->addParsedProperties(parser.m_parsedProperties);
@@ -856,13 +858,17 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range,
}
size_t propertiesCount = m_parsedProperties.size();
- // TODO(timloh): This only be for StyleRule::Style, crbug.com/641873.
+ // TODO(timloh): This should only be for StyleRule::Style/Keyframe,
+ // crbug.com/641873.
if (unresolvedProperty == CSSPropertyVariable) {
AtomicString variableName = token.value().toAtomicString();
+ bool isAnimationTainted = ruleType == StyleRule::Keyframe;
consumeVariableValue(range.makeSubRange(&range.peek(), declarationValueEnd),
- variableName, important);
+ variableName, important, isAnimationTainted);
}
+ // TODO(timloh): Should this check occur before the call to
+ // consumeVariableValue()?
if (important &&
(ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframe))
return;
@@ -888,9 +894,11 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range,
void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range,
const AtomicString& variableName,
- bool important) {
+ bool important,
+ bool isAnimationTainted) {
if (CSSCustomPropertyDeclaration* value =
- CSSVariableParser::parseDeclarationValue(variableName, range))
+ CSSVariableParser::parseDeclarationValue(variableName, range,
+ isAnimationTainted))
m_parsedProperties.append(
CSSProperty(CSSPropertyVariable, *value, important));
}

Powered by Google App Engine
This is Rietveld 408576698