Bug 1620035 - Convert GenerateComputedDOMStyleGenerated.py and GenerateCSSPropsGenerated.py to py3; r=firefox-build-system-reviewers,rstewart

Depends on D65379

Differential Revision: https://phabricator.services.mozilla.com/D65380

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Shal 2020-03-05 17:04:53 +00:00
parent 1c8f1349ca
commit 05e6591e3b
3 changed files with 2 additions and 5 deletions

View File

@ -49,7 +49,7 @@ def generate(output, dataFile):
output.write("};\n\n")
# Generate kIDLNameSortPositionTable
ps = sorted(properties, key=lambda p: p.idlname)
ps = sorted(properties, key=lambda p: p.idlname if p.idlname else '')
ps = [(p, position) for position, p in enumerate(ps)]
ps.sort(key=lambda item: item[0].index)
output.write("const int32_t nsCSSProps::"

View File

@ -54,10 +54,9 @@ static constexpr Entry kEntries[] = {
properties = runpy.run_path(dataFile)["data"]
properties = filter(exposed_on_getcs, properties)
properties.sort(key=order_key)
TEMPLATE = " {{ eCSSProperty_{}, &nsComputedDOMStyle::{} }},\n"
for p in properties:
for p in sorted(properties, key=order_key):
output.write(TEMPLATE.format(p.id, getter_entry(p)))
output.write("};\n")

View File

@ -290,12 +290,10 @@ if CONFIG['COMPILE_ENVIRONMENT']:
])
GeneratedFile('nsComputedDOMStyleGenerated.inc',
script='GenerateComputedDOMStyleGenerated.py',
py2=True,
entry_point='generate',
inputs=['!ServoCSSPropList.py'])
GeneratedFile('nsCSSPropsGenerated.inc',
script='GenerateCSSPropsGenerated.py',
py2=True,
entry_point='generate',
inputs=['!ServoCSSPropList.py'])
GeneratedFile('ServoStyleConsts.h', script='/build/RunCbindgen.py',