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

Unified Diff: third_party/WebKit/Source/core/css/StylePropertySet.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/StylePropertySet.cpp
diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.cpp b/third_party/WebKit/Source/core/css/StylePropertySet.cpp
index 8aa3a7c90159efc7555a57e9c24c4b9dfb620df9..0bc52a5ee212095888a8e04abed441ebc6188b1a 100644
--- a/third_party/WebKit/Source/core/css/StylePropertySet.cpp
+++ b/third_party/WebKit/Source/core/css/StylePropertySet.cpp
@@ -296,7 +296,7 @@ bool StylePropertySet::isPropertyImplicit(CSSPropertyID propertyID) const {
return propertyAt(foundPropertyIndex).isImplicit();
}
-bool MutableStylePropertySet::setProperty(
+MutableStylePropertySet::SetResult MutableStylePropertySet::setProperty(
CSSPropertyID unresolvedProperty,
const String& value,
bool important,
@@ -306,8 +306,11 @@ bool MutableStylePropertySet::setProperty(
// Setting the value to an empty string just removes the property in both IE
// and Gecko. Setting it to null seems to produce less consistent results, but
// we treat it just the same.
- if (value.isEmpty())
- return removeProperty(resolveCSSPropertyID(unresolvedProperty));
+ if (value.isEmpty()) {
+ bool didParse = true;
+ bool didChange = removeProperty(resolveCSSPropertyID(unresolvedProperty));
+ return SetResult{didParse, didChange};
+ }
// When replacing an existing property value, this moves the property to the
// end of the list. Firefox preserves the position, and MSIE moves the
@@ -316,14 +319,17 @@ bool MutableStylePropertySet::setProperty(
contextStyleSheet);
}
-bool MutableStylePropertySet::setProperty(
+MutableStylePropertySet::SetResult MutableStylePropertySet::setProperty(
const AtomicString& customPropertyName,
const String& value,
bool important,
StyleSheetContents* contextStyleSheet,
bool isAnimationTainted) {
- if (value.isEmpty())
- return removeProperty(customPropertyName);
+ if (value.isEmpty()) {
+ bool didParse = true;
+ bool didChange = removeProperty(customPropertyName);
+ return MutableStylePropertySet::SetResult{didParse, didChange};
+ }
return CSSParser::parseValueForCustomProperty(this, customPropertyName, value,
important, contextStyleSheet,
isAnimationTainted);
« no previous file with comments | « third_party/WebKit/Source/core/css/StylePropertySet.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698