From 20d9a076d431d4af9eeedc75e7326249edf9829c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 27 Oct 2018 23:41:30 +0200 Subject: [PATCH] style: Properly handle exhaustive matches in animation keywords to avoid a warning. Need to do the gecko_inexhaustive thing because those animation properties have an EndGuard_ generated by IPDL I suspect. --- components/style/properties/gecko.mako.rs | 2 ++ components/style/properties/longhands/box.mako.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index d54c8418689..430eb42bdc9 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -3000,7 +3000,9 @@ fn static_assert() { % for value in keyword.gecko_values(): structs::${keyword.gecko_constant(value)} => Keyword::${to_camel_case(value)}, % endfor + % if keyword.gecko_inexhaustive: _ => panic!("Found unexpected value for animation-${ident}"), + % endif } } ${impl_animation_count(ident, gecko_ffi_name)} diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index 8cbba2d8b83..d5e6a9b1106 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -247,6 +247,7 @@ ${helpers.single_keyword( gecko_enum_prefix="PlaybackDirection", custom_consts=animation_direction_custom_consts, extra_prefixes=animation_extra_prefixes, + gecko_inexhaustive=True, spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction", allowed_in_keyframe_block=False, )} @@ -271,6 +272,7 @@ ${helpers.single_keyword( vector=True, gecko_enum_prefix="FillMode", extra_prefixes=animation_extra_prefixes, + gecko_inexhaustive=True, spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode", allowed_in_keyframe_block=False, )}