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

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

Issue 2249653002: border-foo WIP Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V9 Created 4 years, 4 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/CSSPropertyMetadata.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
index a7866727bca4196398aea782fbe058f3d40b9545..06316f79fa36fac468e02e00791e693d32513835 100644
--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
@@ -3,6 +3,7 @@
#include "core/css/CSSPropertyMetadata.h"
+#include "core/css/CSSValuePool.h"
#include "platform/RuntimeEnabledFeatures.h"
#include <bitset>
@@ -67,4 +68,203 @@ bool CSSPropertyMetadata::isDescriptorOnly(CSSPropertyID property)
return property >= {{descriptors[0].property_id}} && property <= {{descriptors[-1].property_id}};
}
+CSSValue* CSSPropertyMetadata::initialValue(CSSPropertyID property)
+{
+ CSSValue* value = nullptr;
+ switch (property) {
+ case CSSPropertyOutlineColor:
+ case CSSPropertyWebkitTextFillColor:
+ case CSSPropertyWebkitBorderAfterColor:
+ case CSSPropertyWebkitBorderBeforeColor:
+ case CSSPropertyWebkitTextEmphasisColor:
+ case CSSPropertyTextDecorationColor:
+ case CSSPropertyColumnRuleColor:
+ case CSSPropertyBorderColor:
+ case CSSPropertyBorderTopColor:
+ case CSSPropertyBorderRightColor:
+ case CSSPropertyBorderBottomColor:
+ case CSSPropertyBorderLeftColor: {
+ DEFINE_STATIC_LOCAL(CSSValue*, currentColor, (new CSSPrimitiveValue(CSSValueCurrentcolor)));
+ value = currentColor;
+ break;
+ }
+ case CSSPropertyOutlineWidth:
+ case CSSPropertyColumnRuleWidth:
+ case CSSPropertyWebkitBorderAfterWidth:
+ case CSSPropertyWebkitBorderBeforeWidth:
+ case CSSPropertyBorderWidth:
+ case CSSPropertyBorderTopWidth:
+ case CSSPropertyBorderRightWidth:
+ case CSSPropertyBorderBottomWidth:
+ case CSSPropertyBorderLeftWidth: {
+ DEFINE_STATIC_LOCAL(CSSValue*, medium, (new CSSPrimitiveValue(CSSValueMedium)));
+ value = medium;
+ break;
+ }
+ case CSSPropertyAnimationName:
+ case CSSPropertyAnimationFillMode:
+ case CSSPropertyGridTemplateColumns:
+ case CSSPropertyGridTemplateRows:
+ case CSSPropertyGridTemplateAreas:
+ case CSSPropertyWebkitMaskImage:
+ case CSSPropertyBackgroundImage:
+ case CSSPropertyOutlineStyle:
+ case CSSPropertyColumnRuleStyle:
+ case CSSPropertyWebkitTextEmphasisStyle:
+ case CSSPropertyBorderStyle:
+ case CSSPropertyBorderTopStyle:
+ case CSSPropertyBorderRightStyle:
+ case CSSPropertyBorderBottomStyle:
+ case CSSPropertyBorderLeftStyle:
+ case CSSPropertyCounterReset:
+ case CSSPropertyCounterIncrement:
+ case CSSPropertyBorderImageSource:
+ case CSSPropertyWebkitMaskBoxImageSource:
+ case CSSPropertyListStyleImage: {
+ DEFINE_STATIC_LOCAL(CSSValue*, none, (new CSSPrimitiveValue(CSSValueNone)));
+ value = none;
+ break;
+ }
+ case CSSPropertyWebkitMaskRepeatX:
+ case CSSPropertyWebkitMaskRepeatY:
+ case CSSPropertyBackgroundRepeatX:
+ case CSSPropertyBackgroundRepeatY:
+ case CSSPropertyBackgroundRepeat: {
+ DEFINE_STATIC_LOCAL(CSSValue*, repeat, (new CSSPrimitiveValue(CSSValueRepeat)));
+ value = repeat;
+ break;
+ }
+ case CSSPropertyWebkitMaskBoxImageRepeat:
+ case CSSPropertyBorderImageRepeat: {
+ DEFINE_STATIC_LOCAL(CSSValue*, stretch, (new CSSPrimitiveValue(CSSValueStretch)));
+ value = stretch;
+ break;
+ }
+ case CSSPropertyAnimationIterationCount:
+ case CSSPropertyWebkitMaskBoxImageWidth:
+ case CSSPropertyBorderImageWidth: {
+ DEFINE_STATIC_LOCAL(CSSValue*, imageWidth, (new CSSPrimitiveValue(1, CSSPrimitiveValue::UnitType::Integer)));
+ value = imageWidth;
+ break;
+ }
+ case CSSPropertyWebkitMaskBoxImageSlice:
+ case CSSPropertyBorderImageSlice: {
+ DEFINE_STATIC_LOCAL(CSSValue*, imageSlice, (new CSSPrimitiveValue(100, CSSPrimitiveValue::UnitType::Percentage)));
+ value = imageSlice;
+ break;
+ }
+ case CSSPropertyWebkitMaskPositionX:
+ case CSSPropertyWebkitMaskPositionY:
+ case CSSPropertyBackgroundPositionX:
+ case CSSPropertyBackgroundPositionY: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundPosition, (new CSSPrimitiveValue(0, CSSPrimitiveValue::UnitType::Percentage)));
+ value = backgroundPosition;
+ break;
+ }
+ case CSSPropertyTransitionDelay:
+ case CSSPropertyTransitionDuration:
+ case CSSPropertyAnimationDelay:
+ case CSSPropertyAnimationDuration: {
+ DEFINE_STATIC_LOCAL(CSSValue*, seconds, (new CSSPrimitiveValue(0, CSSPrimitiveValue::UnitType::Seconds)));
+ value = seconds;
+ break;
+ }
+ case CSSPropertyTransitionTimingFunction:
+ case CSSPropertyAnimationTimingFunction: {
+ DEFINE_STATIC_LOCAL(CSSValue*, ease, (new CSSPrimitiveValue(CSSValueEase)));
+ value = ease;
+ break;
+ }
+ case CSSPropertyAnimationPlayState: {
+ DEFINE_STATIC_LOCAL(CSSValue*, running, (new CSSPrimitiveValue(CSSValueRunning)));
+ value = running;
+ break;
+ }
+ case CSSPropertyAnimationDirection: {
+ DEFINE_STATIC_LOCAL(CSSValue*, normal, (new CSSPrimitiveValue(CSSValueNormal)));
+ value = normal;
+ break;
+ }
+ case CSSPropertyTransitionProperty: {
+ DEFINE_STATIC_LOCAL(CSSValue*, all, (new CSSPrimitiveValue(CSSValueAll)));
+ value = all;
+ break;
+ }
+ case CSSPropertyListStyleType: {
+ DEFINE_STATIC_LOCAL(CSSValue*, disc, (new CSSPrimitiveValue(CSSValueDisc)));
+ value = disc;
+ break;
+ }
+ case CSSPropertyListStylePosition: {
+ DEFINE_STATIC_LOCAL(CSSValue*, listStylePosition, (new CSSPrimitiveValue(CSSValueOutside)));
+ value = listStylePosition;
+ break;
+ }
+ case CSSPropertyTextDecorationStyle: {
+ DEFINE_STATIC_LOCAL(CSSValue*, decorationStyle, (new CSSPrimitiveValue(CSSValueSolid)));
+ value = decorationStyle;
+ break;
+ }
+ case CSSPropertyWebkitTextStrokeColor: {
+ DEFINE_STATIC_LOCAL(CSSValue*, textStrokeColor, (CSSColorValue::create(Color::black)));
+ value = textStrokeColor;
+ break;
+ }
+ case CSSPropertyGridColumnGap:
+ case CSSPropertyGridRowGap:
+ case CSSPropertyWebkitMaskBoxImageOutset:
+ case CSSPropertyBorderImageOutset:
+ case CSSPropertyWebkitTextStrokeWidth: {
+ DEFINE_STATIC_LOCAL(CSSValue*, textStrokeWidth, (new CSSPrimitiveValue(0, CSSPrimitiveValue::UnitType::Integer)));
+ value = textStrokeWidth;
+ break;
+ }
+ case CSSPropertyGridAutoFlow:
+ case CSSPropertyFlexDirection: {
+ DEFINE_STATIC_LOCAL(CSSValue*, flexDirection, (new CSSPrimitiveValue(CSSValueRow)));
+ value = flexDirection;
+ break;
+ }
+ case CSSPropertyFlexWrap: {
+ DEFINE_STATIC_LOCAL(CSSValue*, flexWrap, (new CSSPrimitiveValue(CSSValueNowrap)));
+ value = flexWrap;
+ break;
+ }
+ case CSSPropertyGridAutoColumns:
+ case CSSPropertyGridAutoRows:
+ case CSSPropertyWebkitMaskSize:
+ case CSSPropertyBackgroundSize: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundSize, (new CSSPrimitiveValue(CSSValueAuto)));
+ value = backgroundSize;
+ break;
+ }
+ case CSSPropertyBackgroundAttachment: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundAttachment, (new CSSPrimitiveValue(CSSValueScroll)));
+ value = backgroundAttachment;
+ break;
+ }
+ case CSSPropertyWebkitMaskClip:
+ case CSSPropertyBackgroundClip: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundClip, (new CSSPrimitiveValue(CSSValueBorderBox)));
+ value = backgroundClip;
+ break;
+ }
+ case CSSPropertyWebkitMaskOrigin:
+ case CSSPropertyBackgroundOrigin: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundOrigin, (new CSSPrimitiveValue(CSSValuePaddingBox)));
+ value = backgroundOrigin;
+ break;
+ }
+ case CSSPropertyBackgroundColor: {
+ DEFINE_STATIC_LOCAL(CSSValue*, backgroundColor, (new CSSPrimitiveValue(CSSValueTransparent)));
+ value = backgroundColor;
+ break;
+ }
+ default:
+ return nullptr;
+ }
+ value->setImplicit();
+ return value;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698