# GENERATE CSSOM from cssattrs import cssidlattributes def property_from_attribute(attribute): output = "" if attribute == "cssFloat": return "float" for char in attribute: if char.isupper(): output += "-" output += char.lower() else: output += char return output def generate_propertyidl(): value = "" for attribute in cssidlattributes.split("\n"): value += " attribute DOMString " + attribute + ";\n" return value def generate_propertytable(): value = "" for attribute in cssidlattributes.split("\n"): identifier = "dom-CSSStyleDeclaration-" + attribute value += "
" + attribute + "" + property_from_attribute(attribute) + "\"