diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 3a046010f15..0b5f2972c20 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -472,6 +472,7 @@ def set_gecko_property(ffi_name, expr): // as signed type when we have both signed/unsigned integer in order to use them // as match's arms. // Also, to use same implementation here we use casted constant if we have only singed values. + % if keyword.gecko_enum_prefix is None: % for value in keyword.values_for('gecko'): const ${keyword.casted_constant_name(value, cast_type)} : ${cast_type} = structs::${keyword.gecko_constant(value)} as ${cast_type}; @@ -485,6 +486,16 @@ def set_gecko_property(ffi_name, expr): x => panic!("Found unexpected value in style struct for ${ident} property: {:?}", x), % endif } + % else: + match ${get_gecko_property(gecko_ffi_name)} { + % for value in keyword.values_for('gecko'): + structs::${keyword.gecko_constant(value)} => Keyword::${to_rust_ident(value)}, + % endfor + % if keyword.gecko_inexhaustive: + x => panic!("Found unexpected value in style struct for ${ident} property: {:?}", x), + % endif + } + % endif } @@ -2823,7 +2834,6 @@ fn static_assert() { "-moz-grid-group -moz-grid-line -moz-stack -moz-inline-stack -moz-deck " + "-moz-popup -moz-groupbox", gecko_enum_prefix="StyleDisplay", - gecko_inexhaustive="True", gecko_strip_moz_prefix=False) %> pub fn set_display(&mut self, v: longhands::display::computed_value::T) { diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 615d7bafa0c..3850e99e983 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -195,14 +195,12 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style', ${helpers.single_keyword("box-decoration-break", "slice clone", gecko_enum_prefix="StyleBoxDecorationBreak", - gecko_inexhaustive=True, spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break", products="gecko", animation_value_type="discrete")} ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", gecko_ffi_name="mFloatEdge", gecko_enum_prefix="StyleFloatEdge", - gecko_inexhaustive=True, products="gecko", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-float-edge)", animation_value_type="discrete")} diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index da1bf83bd8e..12f229b3af6 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -1793,7 +1793,6 @@ ${helpers.single_keyword("-moz-orient", gecko_ffi_name="mOrient", gecko_enum_prefix="StyleOrient", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-orient)", - gecko_inexhaustive="True", animation_value_type="discrete")} <%helpers:longhand name="will-change" products="gecko" animation_value_type="discrete" diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index 5a98f464d11..3742adb5f63 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -45,7 +45,6 @@ ${helpers.predefined_type("fill-opacity", "SVGOpacity", "Default::default()", ${helpers.single_keyword("fill-rule", "nonzero evenodd", gecko_enum_prefix="StyleFillRule", - gecko_inexhaustive=True, products="gecko", animation_value_type="discrete", spec="https://www.w3.org/TR/SVG11/painting.html#FillRuleProperty")} @@ -110,7 +109,6 @@ ${helpers.predefined_type( ${helpers.single_keyword("clip-rule", "nonzero evenodd", products="gecko", gecko_enum_prefix="StyleFillRule", - gecko_inexhaustive=True, animation_value_type="discrete", spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty")} diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index bcbe35287ce..9fbab4b6753 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -25,7 +25,6 @@ ${helpers.single_keyword("text-transform", ${helpers.single_keyword("hyphens", "manual none auto", gecko_enum_prefix="StyleHyphens", - gecko_inexhaustive=True, products="gecko", animation_value_type="discrete", extra_prefixes="moz", spec="https://drafts.csswg.org/css-text/#propdef-hyphens")} @@ -66,7 +65,6 @@ ${helpers.single_keyword("word-break", extra_gecko_values="inter-character" extra_specified="${'distribute' if product == 'gecko' else ''}" gecko_enum_prefix="StyleTextJustify" - gecko_inexhaustive="True" animation_value_type="discrete" flags="APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text/#propdef-text-justify"> @@ -368,7 +366,6 @@ ${helpers.predefined_type("word-spacing", extra_gecko_values="-moz-pre-space" gecko_enum_prefix="StyleWhiteSpace" needs_conversion="True" - gecko_inexhaustive="True" animation_value_type="discrete" // Only allowed for UA sheets, which set it // !important. diff --git a/components/style/properties/longhand/pointing.mako.rs b/components/style/properties/longhand/pointing.mako.rs index 09f9e114609..0b68c58076d 100644 --- a/components/style/properties/longhand/pointing.mako.rs +++ b/components/style/properties/longhand/pointing.mako.rs @@ -155,7 +155,6 @@ ${helpers.single_keyword("pointer-events", "auto none", animation_value_type="di ${helpers.single_keyword("-moz-user-input", "auto none enabled disabled", products="gecko", gecko_ffi_name="mUserInput", gecko_enum_prefix="StyleUserInput", - gecko_inexhaustive=True, animation_value_type="discrete", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-input)")} @@ -163,7 +162,6 @@ ${helpers.single_keyword("-moz-user-modify", "read-only read-write write-only", products="gecko", gecko_ffi_name="mUserModify", gecko_enum_prefix="StyleUserModify", needs_conversion=True, - gecko_inexhaustive=True, animation_value_type="discrete", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify)")} @@ -171,7 +169,6 @@ ${helpers.single_keyword("-moz-user-focus", "none ignore normal select-after select-before select-menu select-same select-all", products="gecko", gecko_ffi_name="mUserFocus", gecko_enum_prefix="StyleUserFocus", - gecko_inexhaustive=True, animation_value_type="discrete", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus)")} diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index b1904aae146..11bea2992fe 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -232,7 +232,6 @@ ${helpers.single_keyword("box-sizing", spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing", gecko_enum_prefix="StyleBoxSizing", custom_consts={ "content-box": "Content", "border-box": "Border" }, - gecko_inexhaustive=True, animation_value_type="discrete")} ${helpers.single_keyword("object-fit", "fill contain cover none scale-down", diff --git a/components/style/properties/longhand/ui.mako.rs b/components/style/properties/longhand/ui.mako.rs index 492cd8ca3f4..c174360133b 100644 --- a/components/style/properties/longhand/ui.mako.rs +++ b/components/style/properties/longhand/ui.mako.rs @@ -22,7 +22,6 @@ ${helpers.single_keyword("-moz-user-select", "auto text none all element element alias="-webkit-user-select", gecko_ffi_name="mUserSelect", gecko_enum_prefix="StyleUserSelect", - gecko_inexhaustive=True, gecko_strip_moz_prefix=False, aliases="-moz-none=none", animation_value_type="discrete", @@ -31,14 +30,12 @@ ${helpers.single_keyword("-moz-user-select", "auto text none all element element ${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", products="gecko", gecko_ffi_name="mWindowDragging", gecko_enum_prefix="StyleWindowDragging", - gecko_inexhaustive=True, animation_value_type="discrete", spec="None (Nonstandard Firefox-only property)")} ${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet", products="gecko", gecko_ffi_name="mWindowShadow", gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW", - gecko_inexhaustive=True, animation_value_type="discrete", internal=True, spec="None (Nonstandard internal property)")} diff --git a/components/style/properties/longhand/xul.mako.rs b/components/style/properties/longhand/xul.mako.rs index 6802f60460c..15b8a695411 100644 --- a/components/style/properties/longhand/xul.mako.rs +++ b/components/style/properties/longhand/xul.mako.rs @@ -11,7 +11,6 @@ ${helpers.single_keyword("-moz-box-align", "stretch start center baseline end", products="gecko", gecko_ffi_name="mBoxAlign", gecko_enum_prefix="StyleBoxAlign", - gecko_inexhaustive=True, animation_value_type="discrete", alias="-webkit-box-align", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-align)")} @@ -19,7 +18,6 @@ ${helpers.single_keyword("-moz-box-align", "stretch start center baseline end", ${helpers.single_keyword("-moz-box-direction", "normal reverse", products="gecko", gecko_ffi_name="mBoxDirection", gecko_enum_prefix="StyleBoxDirection", - gecko_inexhaustive=True, animation_value_type="discrete", alias="-webkit-box-direction", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction)")} @@ -34,7 +32,6 @@ ${helpers.single_keyword("-moz-box-orient", "horizontal vertical", products="gecko", gecko_ffi_name="mBoxOrient", extra_gecko_aliases="inline-axis=horizontal block-axis=vertical", gecko_enum_prefix="StyleBoxOrient", - gecko_inexhaustive=True, animation_value_type="discrete", alias="-webkit-box-orient", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-orient)")} @@ -42,7 +39,6 @@ ${helpers.single_keyword("-moz-box-orient", "horizontal vertical", ${helpers.single_keyword("-moz-box-pack", "start center end justify", products="gecko", gecko_ffi_name="mBoxPack", gecko_enum_prefix="StyleBoxPack", - gecko_inexhaustive=True, animation_value_type="discrete", alias="-webkit-box-pack", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)")} @@ -50,7 +46,6 @@ ${helpers.single_keyword("-moz-box-pack", "start center end justify", ${helpers.single_keyword("-moz-stack-sizing", "stretch-to-fit ignore ignore-horizontal ignore-vertical", products="gecko", gecko_ffi_name="mStackSizing", gecko_enum_prefix="StyleStackSizing", - gecko_inexhaustive=True, animation_value_type="discrete", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-stack-sizing)")}