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

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

Issue 1837413002: Ensure that we don't allow 'none' alongside other values in content property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 54440bfe70f0364eecdda6eb159c20f3dbdadbd4..a0700612cc2035d1a4176f82202c260307541d43 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -658,9 +658,11 @@ void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&)
void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& state, CSSValue* value)
{
if (value->isPrimitiveValue()) {
- ASSERT(toCSSPrimitiveValue(*value).getValueID() == CSSValueNormal);
- state.style()->clearContent();
- return;
+ CSSValueID cssValueID = toCSSPrimitiveValue(*value).getValueID();
+ if (cssValueID == CSSValueNormal || cssValueID == CSSValueNone) {
Timothy Loh 2016/03/30 02:53:28 why did the assert become an if?
nainar 2016/03/30 03:27:36 Switched back.
+ state.style()->clearContent();
+ return;
+ };
}
// list of string, uri, counter, attr, i
@@ -730,13 +732,11 @@ void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
didSet = true;
break;
default:
- // none does not have any effect.
- { }
+ ASSERT_NOT_REACHED();
}
}
}
- if (!didSet)
- state.style()->clearContent();
+ ASSERT(didSet);
}
void StyleBuilderFunctions::applyValueCSSPropertyWebkitLocale(StyleResolverState& state, CSSValue* value)

Powered by Google App Engine
This is Rietveld 408576698