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

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

Issue 2632083002: Provide a CSSParserContext to CSSSyntaxDescriptor (Closed)
Patch Set: Fix parser context in PropertyRegistration Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertyRegistration.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 PropertyRegistry::Registration* 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(), 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;
98 didChange = declaration->addParsedProperties(parser.m_parsedProperties); 98 didChange = declaration->addParsedProperties(parser.m_parsedProperties);
99 } 99 }
100 return MutableStylePropertySet::SetResult{didParse, didChange}; 100 return MutableStylePropertySet::SetResult{didParse, didChange};
101 } 101 }
102 102
(...skipping 876 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
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertyRegistration.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698