Commit b77b74c5 authored by bugsnash's avatar bugsnash Committed by Commit bot

Added property id comments to CSSDescriptorIndices entries.

Added trailing comments displaying the property api pointed to by all
the non-null entries of the CSSDescriptorIndices table in
CSSPropertyDescriptor.cpp. This improves the readability of the table.

Changes to generated files:
https://gist.github.com/BugsNash/44fa796f876d5b4727931a4b63cec386/revisions

BUG=668012

Review-Url: https://codereview.chromium.org/2849133002
Cr-Commit-Position: refs/heads/master@{#468490}
parent c0fa1cb6
...@@ -94,11 +94,11 @@ class CSSPropertyAPIWriter(StyleBuilderWriter): ...@@ -94,11 +94,11 @@ class CSSPropertyAPIWriter(StyleBuilderWriter):
self._invalid_descriptor_index = 0 self._invalid_descriptor_index = 0
# Initialize the whole thing to the invalid descriptor to handle gaps # Initialize the whole thing to the invalid descriptor to handle gaps
num_indices = self.last_unresolved_property_id + 1 num_indices = self.last_unresolved_property_id + 1
self._descriptor_indices = [self._invalid_descriptor_index] * num_indices self._descriptor_indices = dict.fromkeys(xrange(num_indices), {'id': self._invalid_descriptor_index, 'api': None})
# Now populate all entries for which there exists a class, i.e. that aren't gaps # Now populate all entries for which there exists a class, i.e. that aren't gaps
for api_class in self._api_classes: for api_class in self._api_classes:
for property_enum in property_enums_for_class[api_class.classname]: for property_enum in property_enums_for_class[api_class.classname]:
self._descriptor_indices[property_enum] = api_class.index self._descriptor_indices[property_enum] = {'id': api_class.index, 'api': api_class.classname}
@template_expander.use_jinja('CSSPropertyDescriptor.cpp.tmpl') @template_expander.use_jinja('CSSPropertyDescriptor.cpp.tmpl')
def generate_property_descriptor_cpp(self): def generate_property_descriptor_cpp(self):
......
{% from 'macros.tmpl' import license, print_if %}
// Copyright 2016 The Chromium Authors. All rights reserved. // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -45,8 +46,8 @@ static_assert(cssPropertyDescriptors[INVALID_DESCRIPTOR_INDEX].{{api_method_name ...@@ -45,8 +46,8 @@ static_assert(cssPropertyDescriptors[INVALID_DESCRIPTOR_INDEX].{{api_method_name
// Lookup table mapping CSSPropertyID to index in the cssPropertyDescriptors // Lookup table mapping CSSPropertyID to index in the cssPropertyDescriptors
// table // table
static size_t CSSDescriptorIndices[] = { static size_t CSSDescriptorIndices[] = {
{% for id in descriptor_indices %} {% for item in descriptor_indices %}
{{id}}, {{descriptor_indices[item].id}},{{print_if(descriptor_indices[item].api != None, ' // ' ~ descriptor_indices[item].api)}}
{% endfor %} {% endfor %}
}; };
......
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