Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h |
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h |
| index 3f73dadffba756012495c4237eef1785fa786950..84593e5b2c0fc498ebb42efe4ebf5f943e6a103b 100644 |
| --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h |
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h |
| @@ -18,18 +18,21 @@ class CSSParserTokenRange; |
| // logic inside the blink style engine. All specific properties are subclasses |
| // of CSSPropertyAPI. |
| // |
| -// To add a new property using this API: |
| -// - Make a class that implements CSSPropertyAPI, and implement the static |
| -// methods. |
| -// - Update the cssPropertyDescriptors array in CSSPropertyDescriptor.cpp to |
| -// call GET_DESCRIPTOR(classname). |
| +// To add a new implementation of this API for a property: |
| +// - Make a class that implements CSSPropertyAPI. |
| +// - For each method that you wish to implement in this class, add this method |
| +// name to the api_methods flag in CSSProperties.json5. |
| +// - Implement these methods in the .cpp file. |
| // |
| -// To add new functions using this API: |
| -// - New functions and static variables can be added in this class. A default |
| -// implementation of functions can optionally be provided. |
| -// - When adding new functions, also add them to GET_DESCRIPTOR, and the get() |
| -// method in CSSPropertyDescriptors.cpp, and the descriptor struct in |
| -// CSSPropertyDescriptor.h. |
| +// To add new functions to this API: |
| +// - Add the function to the struct below. |
| +// - Add the function to CSSPropertyAPIFiles.h.tmpl template file, surrounded |
| +// with an {% if "methodName" in implementedMethods %} check. |
| +// - Add the function name to the valid_methods array in |
| +// make_css_property_apis.py. |
| +// - Add function to the initializer list in the cssPropertyDescriptors array |
| +// in CSSPropertyDescriptor.cpp.tmpl, and add a nullptr to the invalid |
| +// CSSPropertyDescriptor. |
|
sashab
2017/01/31 22:50:58
Ahh I'm so happy to see that we are maintaining th
|
| class CSSPropertyAPI { |
| STATIC_ONLY(CSSPropertyAPI); |
| @@ -37,7 +40,10 @@ class CSSPropertyAPI { |
| // Parses a single CSS property and returns the corresponding CSSValue. If the |
| // input is invalid it returns nullptr. |
| static const CSSValue* parseSingleValue(CSSParserTokenRange&, |
| - const CSSParserContext*); |
| + const CSSParserContext*) { |
| + NOTREACHED(); |
|
sashab
2017/01/31 22:50:58
Add comment above this line like
// No code should
|
| + return nullptr; |
| + } |
| }; |
| } // namespace blink |