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

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

Issue 2524303002: Emit console warning when element.animate() keyframe value fails to parse (Closed)
Patch Set: Review changes Created 4 years, 1 month 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 0bc4d5b0fd70a4e2341fba02b2fd1aa963ef90c2..b87180927300e20a5e04c826bc74dcce8fc98ef4 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -8,7 +8,6 @@
#include "core/css/CSSCustomPropertyDeclaration.h"
#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSStyleSheet.h"
-#include "core/css/StylePropertySet.h"
#include "core/css/StyleRuleImport.h"
#include "core/css/StyleRuleKeyframe.h"
#include "core/css/StyleRuleNamespace.h"
@@ -42,11 +41,12 @@ CSSParserImpl::CSSParserImpl(const CSSParserContext& context,
m_styleSheet(styleSheet),
m_observerWrapper(nullptr) {}
-bool CSSParserImpl::parseValue(MutableStylePropertySet* declaration,
- CSSPropertyID unresolvedProperty,
- const String& string,
- bool important,
- const CSSParserContext& context) {
+MutableStylePropertySet::SetResult CSSParserImpl::parseValue(
+ MutableStylePropertySet* declaration,
+ CSSPropertyID unresolvedProperty,
+ const String& string,
+ bool important,
+ const CSSParserContext& context) {
CSSParserImpl parser(context);
StyleRule::RuleType ruleType = StyleRule::Style;
if (declaration->cssParserMode() == CSSViewportRuleMode)
@@ -56,24 +56,33 @@ bool CSSParserImpl::parseValue(MutableStylePropertySet* declaration,
CSSTokenizer tokenizer(string);
parser.consumeDeclarationValue(tokenizer.tokenRange(), unresolvedProperty,
important, ruleType);
- if (parser.m_parsedProperties.isEmpty())
- return false;
- return declaration->addParsedProperties(parser.m_parsedProperties);
+ bool didParse = false;
+ bool didChange = false;
+ if (!parser.m_parsedProperties.isEmpty()) {
+ didParse = true;
+ didChange = declaration->addParsedProperties(parser.m_parsedProperties);
+ }
+ return MutableStylePropertySet::SetResult{didParse, didChange};
}
-bool CSSParserImpl::parseVariableValue(MutableStylePropertySet* declaration,
- const AtomicString& propertyName,
- const String& value,
- bool important,
- const CSSParserContext& context,
- bool isAnimationTainted) {
+MutableStylePropertySet::SetResult CSSParserImpl::parseVariableValue(
+ MutableStylePropertySet* declaration,
+ const AtomicString& propertyName,
+ const String& value,
+ bool important,
+ const CSSParserContext& context,
+ bool isAnimationTainted) {
CSSParserImpl parser(context);
CSSTokenizer tokenizer(value);
parser.consumeVariableValue(tokenizer.tokenRange(), propertyName, important,
isAnimationTainted);
- if (parser.m_parsedProperties.isEmpty())
- return false;
- return declaration->addParsedProperties(parser.m_parsedProperties);
+ bool didParse = false;
+ bool didChange = false;
+ if (!parser.m_parsedProperties.isEmpty()) {
+ didParse = true;
+ didChange = declaration->addParsedProperties(parser.m_parsedProperties);
+ }
+ return MutableStylePropertySet::SetResult{didParse, didChange};
}
static inline void filterProperties(
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserImpl.h ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698