Iterate through properties in priority order when computing keyframes

This is largely just a translation of Gecko's
PropertyPriorityIterator[1] into rust with the exception that IDL sort
order is only defined for shorthands since that's all we currently
require.

[1] http://searchfox.org/mozilla-central/rev/3a3af33f513071ea829debdfbc628caebcdf6996/dom/animation/KeyframeUtils.cpp#151
This commit is contained in:
Brian Birtles 2017-07-24 13:50:18 +09:00
parent 46ffcbaf7b
commit 8e7011da8a
3 changed files with 112 additions and 5 deletions

View file

@ -46,6 +46,11 @@ def to_camel_case_lower(ident):
return camel[0].lower() + camel[1:]
# https://drafts.csswg.org/cssom/#css-property-to-idl-attribute
def to_idl_name(ident):
return re.sub("-([a-z])", lambda m: m.group(1).upper(), ident)
def parse_aliases(value):
aliases = {}
for pair in value.split():