stylo: System font support for keyword font longhands

This commit is contained in:
Manish Goregaokar 2017-03-21 20:38:12 -07:00 committed by Manish Goregaokar
parent c1c4c8fa59
commit b0dcb72722
7 changed files with 193 additions and 75 deletions

View file

@ -13,6 +13,9 @@ LOGICAL_SIZES = ["block-size", "inline-size"]
ALL_SIDES = [(side, False) for side in PHYSICAL_SIDES] + [(side, True) for side in LOGICAL_SIDES]
ALL_SIZES = [(size, False) for size in PHYSICAL_SIZES] + [(size, True) for size in LOGICAL_SIZES]
SYSTEM_FONT_LONGHANDS = """font_family font_size font_style
font_variant_caps font_stretch font_kerning
font_variant_position""".split()
def maybe_moz_logical_alias(product, side, prop):
if product == "gecko" and side[1]:
@ -32,6 +35,10 @@ def to_rust_ident(name):
def to_camel_case(ident):
return re.sub("(^|_|-)([a-z])", lambda m: m.group(2).upper(), ident.strip("_").strip("-"))
def to_camel_case_lower(ident):
camel = to_camel_case(ident)
return camel[0].lower() + camel[1:]
def parse_aliases(value):
aliases = {}