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

Unified Diff: third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl

Issue 2903413002: Restructure type tracking in StyleValues to work better with new numeric types (Closed)
Patch Set: rebase Created 3 years, 6 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/build/scripts/templates/CSSOMTypes.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl
index 2252e28842451bf31f44cf81ef6188fa67d81bde..b526edb2323ccbb9e1f0af85c1fd95658e96e685 100644
--- a/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl
@@ -13,19 +13,15 @@ namespace blink {
bool CSSOMTypes::PropertyCanTake(CSSPropertyID id,
const CSSStyleValue& styleValue) {
- // Shortcut special case.
- if (styleValue.GetType() == CSSStyleValue::kSimpleLengthType ||
- styleValue.GetType() == CSSStyleValue::kCalcLengthType) {
- // TODO(meade): Rewrite this once the new length types are spec'd.
- // if (ToCSSLengthValue(styleValue).ContainsPercent() &&
- // !CSSPropertyMetadata::PropertySupportsPercentage(id)) {
- // return false;
- // }
- } else if (styleValue.GetType() == CSSStyleValue::kKeywordType) {
- // Keywords are also handled differently.
+ if (styleValue.GetType() == CSSStyleValue::kKeywordType) {
return CSSOMKeywords::ValidKeywordForProperty(
id, ToCSSKeywordValue(styleValue));
- } else if (styleValue.GetType() == CSSStyleValue::kUnknown) {
+ }
+ if (styleValue.ContainsPercent() &&
+ !CSSPropertyMetadata::PropertySupportsPercentage(id)) {
+ return false;
+ }
+ if (styleValue.GetType() == CSSStyleValue::kUnknownType) {
// The check happens later in this case.
return true;
}
« no previous file with comments | « third_party/WebKit/Source/build/scripts/make_cssom_types.py ('k') | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698