Chromium Code Reviews| 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..db02f57c0ed816c12f126e61079da33e3af604f5 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 group in propertyGroups %} |
| +#include "core/css/properties/CSSPropertyAPI{{group}}.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 %} |
|
sashab
2016/12/08 23:56:35
Ahhhh this template file is so nice now ~^_^~
aazzam
2016/12/09 00:44:39
:D
|
| + case CSSProperty{{property['upper_camel_name']}}: |
| + return cssPropertyDescriptors[{{property['api_array_index']}}]; |
| + {% endfor %} |
| default: |
| return cssPropertyDescriptors[0]; |
| } |