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

Unified Diff: third_party/WebKit/Source/build/scripts/make_css_property_apis.py

Issue 2670433002: Makes descriptors hold nullptr for properties not implemented in API. (Closed)
Patch Set: Neatened up code Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/make_css_property_apis.py
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_apis.py b/third_party/WebKit/Source/build/scripts/make_css_property_apis.py
index bc21273f746b5db0fab280b4f03149891e0128ae..de909b5502d8a8c0b06286e505433709f89cd045 100755
--- a/third_party/WebKit/Source/build/scripts/make_css_property_apis.py
+++ b/third_party/WebKit/Source/build/scripts/make_css_property_apis.py
@@ -31,32 +31,36 @@ class CSSPropertyAPIWriter(make_style_builder.StyleBuilderWriter):
# Temporary map of API classname to list of propertyIDs that the API class is for.
properties_for_class = defaultdict(list)
+ # Temporary map of API classname to set of method names this API class implements
+ api_methods_for_class = defaultdict(set)
for property in self._properties.values():
if property['api_class'] is None:
continue
classname = get_classname(property)
+ api_methods_for_class[classname] = property['api_methods']
properties_for_class[classname].append(property['property_id'])
self._outputs[classname + '.h'] = self.generate_property_api_h_builder(classname, property['api_methods'])
- # Stores a list of classes with elements (index, classname, [propertyIDs, ..]).
+ # Stores a list of classes with elements (index, classname, [propertyIDs, ..], [api_methods, ...]).
self._api_classes = []
- ApiClass = namedtuple('ApiClass', ('index', 'classname', 'property_ids'))
+ ApiClass = namedtuple('ApiClass', ('index', 'classname', 'property_ids', 'api_methods'))
for i, classname in enumerate(properties_for_class.keys()):
self._api_classes.append(ApiClass(
index=i + 1,
classname=classname,
- property_ids=properties_for_class[classname]
+ property_ids=properties_for_class[classname],
+ api_methods=api_methods_for_class[classname],
))
@template_expander.use_jinja('CSSPropertyDescriptor.cpp.tmpl')
def generate_property_descriptor_cpp(self):
return {
'api_classes': self._api_classes,
+ 'api_methods': self.json5_file.parameters['api_methods']['valid_values'],
}
# Provides a function object given the classname of the property.
- # This returned function generates a .h file for the specified property.
def generate_property_api_h_builder(self, api_classname, api_methods):
@template_expander.use_jinja('CSSPropertyAPIFiles.h.tmpl')
def generate_property_api_h():
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698