Commit 7bf16d19 authored by bugsnash's avatar bugsnash Committed by Commit bot

Added generated class level comments to all CSSPropertyAPIs.

Added generated class level comments to all CSSPropertyAPIs with a
definition of the class and status.

BUG=668012

Review-Url: https://codereview.chromium.org/2864583002
Cr-Commit-Position: refs/heads/master@{#469580}
parent 1492be9e
...@@ -78,7 +78,7 @@ class CSSPropertyAPIWriter(StyleBuilderWriter): ...@@ -78,7 +78,7 @@ class CSSPropertyAPIWriter(StyleBuilderWriter):
# This list contains duplicate entries, but is only used to check if a method is # This list contains duplicate entries, but is only used to check if a method is
# implemented for an api_class. # implemented for an api_class.
self.methods_for_classes[classname] += property_['api_methods'] self.methods_for_classes[classname] += property_['api_methods']
self._outputs[classname + '.h'] = self.generate_property_api_h_builder(classname) self._outputs[classname + '.h'] = self.generate_property_api_h_builder(classname, property_['name'])
# Stores a list of classes with elements (index, classname, [propertyIDs, ..], [api_methods, ...]). # Stores a list of classes with elements (index, classname, [propertyIDs, ..], [api_methods, ...]).
self._api_classes = [] self._api_classes = []
...@@ -124,11 +124,12 @@ class CSSPropertyAPIWriter(StyleBuilderWriter): ...@@ -124,11 +124,12 @@ class CSSPropertyAPIWriter(StyleBuilderWriter):
} }
# Provides a function object given the classname of the property. # Provides a function object given the classname of the property.
def generate_property_api_h_builder(self, api_classname): def generate_property_api_h_builder(self, api_classname, property_name):
@template_expander.use_jinja('CSSPropertyAPIFiles.h.tmpl') @template_expander.use_jinja('CSSPropertyAPIFiles.h.tmpl')
def generate_property_api_h(): def generate_property_api_h():
return { return {
'api_classname': api_classname, 'api_classname': api_classname,
'property_name': property_name,
'methods_for_class': self.methods_for_classes[api_classname], 'methods_for_class': self.methods_for_classes[api_classname],
'all_api_methods': self.all_api_methods, 'all_api_methods': self.all_api_methods,
} }
......
...@@ -13,6 +13,15 @@ namespace blink { ...@@ -13,6 +13,15 @@ namespace blink {
class CSSParserTokenRange; class CSSParserTokenRange;
class CSSParserContext; class CSSParserContext;
// {{api_classname}} is the API that contains logic
// for handling the {{property_name}} property.
// The methods defined here are standard among property APIs and can be
// accessed through a CSSPropertyDescriptor object.
//
// Status (5th May 2017): Eventually, all logic pertaining to the
// {{property_name}} property will be contained within
// {{api_classname}}. Currently, the code base is in a transitional
// state and property specific logic is still scattered around the code base.
class {{api_classname}} : public CSSPropertyAPI { class {{api_classname}} : public CSSPropertyAPI {
public: public:
{% for api_method in all_api_methods if api_method in methods_for_class %} {% for api_method in all_api_methods if api_method in methods_for_class %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment