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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParser.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/parser/CSSParser.h" 5 #include "core/css/parser/CSSParser.h"
6 6
7 #include "core/css/CSSColorValue.h" 7 #include "core/css/CSSColorValue.h"
8 #include "core/css/CSSKeyframeRule.h" 8 #include "core/css/CSSKeyframeRule.h"
9 #include "core/css/StyleColor.h" 9 #include "core/css/StyleColor.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 return parseValue(declaration, unresolvedProperty, string, important, 96 return parseValue(declaration, unresolvedProperty, string, important,
97 context); 97 context);
98 } 98 }
99 99
100 bool CSSParser::parseValueForCustomProperty( 100 bool CSSParser::parseValueForCustomProperty(
101 MutableStylePropertySet* declaration, 101 MutableStylePropertySet* declaration,
102 const AtomicString& propertyName, 102 const AtomicString& propertyName,
103 const String& value, 103 const String& value,
104 bool important, 104 bool important,
105 StyleSheetContents* styleSheet) { 105 StyleSheetContents* styleSheet,
106 bool isAnimationTainted) {
106 DCHECK(CSSVariableParser::isValidVariableName(propertyName)); 107 DCHECK(CSSVariableParser::isValidVariableName(propertyName));
107 if (value.isEmpty()) 108 if (value.isEmpty())
108 return false; 109 return false;
109 CSSParserMode parserMode = declaration->cssParserMode(); 110 CSSParserMode parserMode = declaration->cssParserMode();
110 CSSParserContext context(parserMode, nullptr); 111 CSSParserContext context(parserMode, nullptr);
111 if (styleSheet) { 112 if (styleSheet) {
112 context = styleSheet->parserContext(); 113 context = styleSheet->parserContext();
113 context.setMode(parserMode); 114 context.setMode(parserMode);
114 } 115 }
115 return CSSParserImpl::parseVariableValue(declaration, propertyName, value, 116 return CSSParserImpl::parseVariableValue(
116 important, context); 117 declaration, propertyName, value, important, context, isAnimationTainted);
117 } 118 }
118 119
119 ImmutableStylePropertySet* CSSParser::parseCustomPropertySet( 120 ImmutableStylePropertySet* CSSParser::parseCustomPropertySet(
120 CSSParserTokenRange range) { 121 CSSParserTokenRange range) {
121 return CSSParserImpl::parseCustomPropertySet(range); 122 return CSSParserImpl::parseCustomPropertySet(range);
122 } 123 }
123 124
124 bool CSSParser::parseValue(MutableStylePropertySet* declaration, 125 bool CSSParser::parseValue(MutableStylePropertySet* declaration,
125 CSSPropertyID unresolvedProperty, 126 CSSPropertyID unresolvedProperty,
126 const String& string, 127 const String& string,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 builder.append(propertyValue); 214 builder.append(propertyValue);
214 builder.append("; }"); 215 builder.append("; }");
215 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); 216 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString());
216 if (!rule || !rule->isFontFaceRule()) 217 if (!rule || !rule->isFontFaceRule())
217 return nullptr; 218 return nullptr;
218 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue( 219 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(
219 propertyID); 220 propertyID);
220 } 221 }
221 222
222 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParser.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698