Commit 1e995582 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

blinkbuild: Remove lower_camel_case() in name_utilities.py

Use NameStyleUtilities.to_lower_camel_case() instead.
This CL doesn't change generated C++ code.

Bug: 843927
Change-Id: I3badfc7a432dcc400303d3d03e4a687f0c95fec4
Reviewed-on: https://chromium-review.googlesource.com/1073127Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561812}
parent 665ceb41
......@@ -6,7 +6,6 @@
import json5_generator
from name_utilities import (
upper_camel_case,
lower_camel_case,
enum_value_name,
enum_for_css_property,
enum_for_css_property_alias
......@@ -170,7 +169,6 @@ class CSSProperties(object):
updated_alias['enum_value'] = aliased_property['enum_value'] + \
self._alias_offset
updated_alias['upper_camel_name'] = upper_camel_case(alias['name'].original)
updated_alias['lower_camel_name'] = lower_camel_case(alias['name'].original)
self._aliases[i] = updated_alias
def expand_parameters(self, property_):
......@@ -182,7 +180,6 @@ class CSSProperties(object):
name = property_['name'].original
property_['property_id'] = enum_for_css_property(name)
property_['upper_camel_name'] = upper_camel_case(name)
property_['lower_camel_name'] = lower_camel_case(name)
property_['is_internal'] = name.startswith('-internal-')
method_name = property_['name_for_methods']
if not method_name:
......
......@@ -31,18 +31,18 @@
namespace blink {
{% for property in properties %}
const StylePropertyShorthand& {{property.lower_camel_name}}Shorthand() {
static const CSSProperty* {{property.lower_camel_name}}Properties[] = {
const StylePropertyShorthand& {{property.name.to_lower_camel_case()}}Shorthand() {
static const CSSProperty* {{property.name.to_lower_camel_case()}}Properties[] = {
{% for longhand_id in property.longhand_property_ids %}
&Get{{longhand_id}}(),
{% endfor %}
};
static StylePropertyShorthand {{property.lower_camel_name}}Longhands(
static StylePropertyShorthand {{property.name.to_lower_camel_case()}}Longhands(
{{property.property_id}},
{{property.lower_camel_name}}Properties,
arraysize({{property.lower_camel_name}}Properties));
return {{property.lower_camel_name}}Longhands;
{{property.name.to_lower_camel_case()}}Properties,
arraysize({{property.name.to_lower_camel_case()}}Properties));
return {{property.name.to_lower_camel_case()}}Longhands;
}
{% endfor %}
......@@ -68,7 +68,7 @@ const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID) {
switch (propertyID) {
{% for property in properties %}
case {{property.property_id}}:
return {{property.lower_camel_name}}Shorthand();
return {{property.name.to_lower_camel_case()}}Shorthand();
{% endfor %}
default: {
return emptyShorthand;
......@@ -83,7 +83,7 @@ void getMatchingShorthandsForLonghand(
{% for longhand_id, shorthands in longhands_dictionary.items() %}
case {{longhand_id}}: {
{% for shorthand in shorthands %}
result->UncheckedAppend({{shorthand.lower_camel_name}}Shorthand());
result->UncheckedAppend({{shorthand.name.to_lower_camel_case()}}Shorthand());
{% endfor %}
break;
}
......
......@@ -57,7 +57,7 @@ class StylePropertyShorthand {
};
{% for property in properties %}
const StylePropertyShorthand& {{property.lower_camel_name}}Shorthand();
const StylePropertyShorthand& {{property.name.to_lower_camel_case()}}Shorthand();
{% endfor %}
const StylePropertyShorthand& animationShorthandForParsing();
......
......@@ -32,13 +32,6 @@ import re
from blinkbuild.name_style_converter import tokenize_name
def lower_first_letter(name):
"""Return name with first letter lowercased."""
if not name:
return ''
return name[0].lower() + name[1:]
def upper_first_letter(name):
"""Return name with first letter uppercased."""
if not name:
......@@ -115,11 +108,6 @@ def upper_camel_case(words):
return ''.join(upper_first_letter(word) for word in words)
@naming_style
def lower_camel_case(words):
return lower_first_letter(upper_camel_case(words))
@naming_style
def snake_case(words):
return '_'.join(word.lower() for word in words)
......
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