diff options
author | sagudev <16504129+sagudev@users.noreply.github.com> | 2023-02-20 06:16:13 +0100 |
---|---|---|
committer | sagudev <16504129+sagudev@users.noreply.github.com> | 2023-02-20 06:16:13 +0100 |
commit | ee7c393773797cf1f52d052d2a69d3d4bc71a2aa (patch) | |
tree | fea4ed7527b0d805d0d034cafc0d8d2271ec5b02 /components/script/dom/bindings/codegen/run.py | |
parent | 42d8269ac97a231e6a24677af2e2e60197210990 (diff) | |
download | servo-ee7c393773797cf1f52d052d2a69d3d4bc71a2aa.tar.gz servo-ee7c393773797cf1f52d052d2a69d3d4bc71a2aa.zip |
Fix Codegen
Diffstat (limited to 'components/script/dom/bindings/codegen/run.py')
-rw-r--r-- | components/script/dom/bindings/codegen/run.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/run.py b/components/script/dom/bindings/codegen/run.py index 7f58de15d69..4d8d05f0116 100644 --- a/components/script/dom/bindings/codegen/run.py +++ b/components/script/dom/bindings/codegen/run.py @@ -24,7 +24,7 @@ def main(): webidls = [name for name in os.listdir(webidls_dir) if name.endswith(".webidl")] for webidl in webidls: filename = os.path.join(webidls_dir, webidl) - with open(filename, "rb") as f: + with open(filename, "r", encoding="utf-8") as f: parser.parse(f.read(), filename) add_css_properties_attributes(css_properties_json, parser) @@ -72,7 +72,7 @@ def generate(config, name, filename): def add_css_properties_attributes(css_properties_json, parser): css_properties = json.load(open(css_properties_json, "rb")) idl = "partial interface CSSStyleDeclaration {\n%s\n};\n" % "\n".join( - " [%sCEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString %s;" % ( + " [%sCEReactions, SetterThrows] attribute [LegacyNullToEmptyString] DOMString %s;" % ( ('Pref="%s", ' % data["pref"] if data["pref"] else ""), attribute_name ) @@ -80,7 +80,7 @@ def add_css_properties_attributes(css_properties_json, parser): for (property_name, data) in sorted(properties_list.items()) for attribute_name in attribute_names(property_name) ) - parser.parse(idl.encode("utf-8"), "CSSStyleDeclaration_generated.webidl") + parser.parse(idl, "CSSStyleDeclaration_generated.webidl") def attribute_names(property_name): |