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

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

Issue 2676993002: Move PropertyRegistry::Registration into PropertyRegistration (Closed)
Patch Set: Rebased Created 3 years, 10 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/CSSParserImpl.h" 5 #include "core/css/parser/CSSParserImpl.h"
6 6
7 #include "core/css/CSSCustomIdentValue.h" 7 #include "core/css/CSSCustomIdentValue.h"
8 #include "core/css/CSSCustomPropertyDeclaration.h" 8 #include "core/css/CSSCustomPropertyDeclaration.h"
9 #include "core/css/CSSKeyframesRule.h" 9 #include "core/css/CSSKeyframesRule.h"
10 #include "core/css/CSSStyleSheet.h" 10 #include "core/css/CSSStyleSheet.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 CSSParserImpl parser(context); 77 CSSParserImpl parser(context);
78 CSSTokenizer tokenizer(value); 78 CSSTokenizer tokenizer(value);
79 parser.consumeVariableValue(tokenizer.tokenRange(), propertyName, important, 79 parser.consumeVariableValue(tokenizer.tokenRange(), propertyName, important,
80 isAnimationTainted); 80 isAnimationTainted);
81 bool didParse = false; 81 bool didParse = false;
82 bool didChange = false; 82 bool didChange = false;
83 if (!parser.m_parsedProperties.isEmpty()) { 83 if (!parser.m_parsedProperties.isEmpty()) {
84 const CSSCustomPropertyDeclaration* parsedDeclaration = 84 const CSSCustomPropertyDeclaration* parsedDeclaration =
85 toCSSCustomPropertyDeclaration(parser.m_parsedProperties[0].value()); 85 toCSSCustomPropertyDeclaration(parser.m_parsedProperties[0].value());
86 if (parsedDeclaration->value() && registry) { 86 if (parsedDeclaration->value() && registry) {
87 const PropertyRegistry::Registration* registration = 87 const PropertyRegistration* registration =
88 registry->registration(propertyName); 88 registry->registration(propertyName);
89 // TODO(timloh): This is a bit wasteful, we parse the registered property 89 // TODO(timloh): This is a bit wasteful, we parse the registered property
90 // to validate but throw away the result. 90 // to validate but throw away the result.
91 if (registration && 91 if (registration &&
92 !registration->syntax().parse(tokenizer.tokenRange(), context, 92 !registration->syntax().parse(tokenizer.tokenRange(), context,
93 isAnimationTainted)) { 93 isAnimationTainted)) {
94 return MutableStylePropertySet::SetResult{didParse, didChange}; 94 return MutableStylePropertySet::SetResult{didParse, didChange};
95 } 95 }
96 } 96 }
97 didParse = true; 97 didParse = true;
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 else 979 else
980 return nullptr; // Parser error, invalid value in keyframe selector 980 return nullptr; // Parser error, invalid value in keyframe selector
981 if (range.atEnd()) 981 if (range.atEnd())
982 return result; 982 return result;
983 if (range.consume().type() != CommaToken) 983 if (range.consume().type() != CommaToken)
984 return nullptr; // Parser error 984 return nullptr; // Parser error
985 } 985 }
986 } 986 }
987 987
988 } // namespace blink 988 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698