diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2016-11-10 12:00:55 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-11-10 16:38:15 -0800 |
commit | bb5f351f4ac8febcb6669afeaf336e3e9fa34c39 (patch) | |
tree | f5f0f90c1ba3cfebe550badd2542a6617e8e0e5d /components/style/binding_tools/regen.py | |
parent | 86a56822470af14c184a2d3cc8f58d3633c9d28a (diff) | |
download | servo-bb5f351f4ac8febcb6669afeaf336e3e9fa34c39.tar.gz servo-bb5f351f4ac8febcb6669afeaf336e3e9fa34c39.zip |
stylo: support transform
Diffstat (limited to 'components/style/binding_tools/regen.py')
-rwxr-xr-x | components/style/binding_tools/regen.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/components/style/binding_tools/regen.py b/components/style/binding_tools/regen.py index 997dc612c43..78a22738f1a 100755 --- a/components/style/binding_tools/regen.py +++ b/components/style/binding_tools/regen.py @@ -104,6 +104,7 @@ COMPILATION_TARGETS = { "nsBorderColors", "nsChangeHint", "nscolor", + "nsCSSKeyword", "nsCSSPropertyID", "nsCSSRect", "nsCSSRect_heap", @@ -271,7 +272,11 @@ COMPILATION_TARGETS = { "StyleBasicShape", "StyleBasicShapeType", "StyleClipPath", + "nscoord", + "nsCSSKeyword", "nsCSSShadowArray", + "nsCSSValue", + "nsCSSValueSharedList", "nsChangeHint", "nsFont", "nsIAtom", @@ -335,6 +340,9 @@ COMPILATION_TARGETS = { "RawGeckoDocument", "RawServoDeclarationBlockStrong", ], + "servo_borrow_types": [ + "nsCSSValue", + ], "whitelist_functions": [ "Servo_.*", "Gecko_.*" @@ -544,7 +552,7 @@ Option<&'a {0}>;".format(ty)) zero_size_type(ty, flags) if "servo_immutable_borrow_types" in current_target: - for ty in current_target["servo_immutable_borrow_types"]: + for ty in current_target.get("servo_immutable_borrow_types", []) + current_target.get("servo_borrow_types", []): flags.append("--blacklist-type") flags.append("{}Borrowed".format(ty)) flags.append("--raw-line") @@ -552,8 +560,18 @@ Option<&'a {0}>;".format(ty)) flags.append("--blacklist-type") flags.append("{}BorrowedOrNull".format(ty)) flags.append("--raw-line") - flags.append("pub type {0}BorrowedOrNull<'a> = \ -Option<&'a {0}>;".format(ty)) + flags.append("pub type {0}BorrowedOrNull<'a> = Option<&'a {0}>;".format(ty)) + if "servo_borrow_types" in current_target: + for ty in current_target["servo_borrow_types"]: + flags.append("--blacklist-type") + flags.append("{}BorrowedMut".format(ty)) + flags.append("--raw-line") + flags.append("pub type {0}BorrowedMut<'a> = &'a mut {0};".format(ty)) + flags.append("--blacklist-type") + flags.append("{}BorrowedMutOrNull".format(ty)) + flags.append("--raw-line") + flags.append("pub type {0}BorrowedMutOrNull<'a> = \ +Option<&'a mut {0}>;".format(ty)) # Right now the only immutable borrow types are ones which we import # from the |structs| module. As such, we don't need to create an opaque # type with zero_size_type. If we ever introduce immutable borrow types |