Index: third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl |
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl |
similarity index 71% |
rename from third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp |
rename to third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl |
index 42b713810cd365b70197b189ca5a9f3ea3f5551a..0c28cca6afc79e8c3ddc269a9bb53059a28bb915 100644 |
--- a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp |
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl |
@@ -1,10 +1,11 @@ |
// Copyright 2016 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
- |
#include "core/css/properties/CSSPropertyDescriptor.h" |
-#include "core/css/properties/CSSPropertyAPIPadding.h" |
+{% for classname in classnames %} |
+#include "core/css/properties/CSSPropertyAPI{{classname}}.h" |
+{% endfor %} |
namespace blink { |
@@ -25,10 +26,9 @@ static_assert( |
static CSSPropertyDescriptor cssPropertyDescriptors[] = { |
GET_INVALID_DESCRIPTOR(), |
- GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingEnd), |
- GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingStart), |
- GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingBefore), |
- GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingAfter), |
+ {% for property in properties %} |
+ GET_DESCRIPTOR(CSSPropertyAPI{{property['upper_camel_name']}}), |
+ {% endfor %} |
}; |
const CSSPropertyDescriptor& CSSPropertyDescriptor::get(CSSPropertyID id) { |
@@ -38,14 +38,10 @@ const CSSPropertyDescriptor& CSSPropertyDescriptor::get(CSSPropertyID id) { |
// cssPropertyDescriptors[id], and generate the cssPropertyDescriptors array |
// to hold invalid descriptors for methods which haven't been implemented yet. |
switch (id) { |
- case CSSPropertyWebkitPaddingEnd: |
- return cssPropertyDescriptors[1]; |
- case CSSPropertyWebkitPaddingStart: |
- return cssPropertyDescriptors[2]; |
- case CSSPropertyWebkitPaddingBefore: |
- return cssPropertyDescriptors[3]; |
- case CSSPropertyWebkitPaddingAfter: |
- return cssPropertyDescriptors[4]; |
+ {% for property in properties %} |
+ case CSSProperty{{property['upper_camel_name']}}: |
+ return cssPropertyDescriptors[{{property['api_array_index']}}]; |
+ {% endfor %} |
default: |
return cssPropertyDescriptors[0]; |
} |