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

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

Issue 2835893002: Refactored out need to pass property to IsValidAnimationPropertyList. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index a0c37022a935fc21ba8da1523c000fba5367e2e0..f11de89c59dca385d097d9c3fa103ddcaea9fd13 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -490,9 +490,8 @@ static CSSValue* ConsumeAnimationValue(CSSPropertyID property,
}
}
-static bool IsValidAnimationPropertyList(CSSPropertyID property,
- const CSSValueList& value_list) {
- if (property != CSSPropertyTransitionProperty || value_list.length() < 2)
+static bool IsValidAnimationPropertyList(const CSSValueList& value_list) {
+ if (value_list.length() < 2)
return true;
for (auto& value : value_list) {
if (value->IsIdentifierValue() &&
@@ -515,7 +514,8 @@ static CSSValueList* ConsumeAnimationPropertyList(
return nullptr;
list->Append(*value);
} while (ConsumeCommaIncludingWhitespace(range));
- if (!IsValidAnimationPropertyList(property, *list))
+ if (property == CSSPropertyTransitionProperty &&
+ !IsValidAnimationPropertyList(*list))
return nullptr;
DCHECK(list->length());
return list;
@@ -561,7 +561,11 @@ bool CSSPropertyParser::ConsumeAnimationShorthand(
} while (ConsumeCommaIncludingWhitespace(range_));
for (size_t i = 0; i < longhand_count; ++i) {
- if (!IsValidAnimationPropertyList(shorthand.properties()[i], *longhands[i]))
+ // TODO(bugsnash): Refactor out the need to check for
+ // CSSPropertyTransitionProperty here when this is method implemented in the
+ // property APIs
+ if (shorthand.properties()[i] == CSSPropertyTransitionProperty &&
+ !IsValidAnimationPropertyList(*longhands[i]))
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698