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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 1541443002: Fix small bugs in new CSS Property parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V4 Created 5 years 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/resolver/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index 015b87d5aecb72df12d7190a4ae0869ca21faa23..e82ccf3ef6a93133bb4faf5a883080dbcb5af06b 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -650,20 +650,24 @@ void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState
void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value)
{
- ASSERT(value->isValueList());
bool willChangeContents = false;
bool willChangeScrollPosition = false;
Vector<CSSPropertyID> willChangeProperties;
- for (auto& willChangeValue : toCSSValueList(*value)) {
- if (willChangeValue->isCustomIdentValue())
- willChangeProperties.append(toCSSCustomIdentValue(*willChangeValue).valueAsPropertyID());
- else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueContents)
- willChangeContents = true;
- else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueScrollPosition)
- willChangeScrollPosition = true;
- else
- ASSERT_NOT_REACHED();
+ if (value->isPrimitiveValue()) {
+ ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto);
+ } else {
+ ASSERT(value->isValueList());
+ for (auto& willChangeValue : toCSSValueList(*value)) {
+ if (willChangeValue->isCustomIdentValue())
+ willChangeProperties.append(toCSSCustomIdentValue(*willChangeValue).valueAsPropertyID());
+ else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueContents)
+ willChangeContents = true;
+ else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueScrollPosition)
+ willChangeScrollPosition = true;
+ else
+ ASSERT_NOT_REACHED();
+ }
}
state.style()->setWillChangeContents(willChangeContents);
state.style()->setWillChangeScrollPosition(willChangeScrollPosition);

Powered by Google App Engine
This is Rietveld 408576698