diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 32ab3079f03..b9b17860dcf 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -60,7 +60,7 @@ class Keyword(object): extra_gecko_values=None, extra_servo_values=None, aliases=None, extra_gecko_aliases=None, extra_servo_aliases=None, - gecko_strip_moz_prefix=True, + gecko_strip_moz_prefix=None, gecko_inexhaustive=None): self.name = name self.values = values.split() @@ -75,7 +75,8 @@ class Keyword(object): self.extra_gecko_aliases = parse_aliases(extra_gecko_aliases or "") self.extra_servo_aliases = parse_aliases(extra_servo_aliases or "") self.consts_map = {} if custom_consts is None else custom_consts - self.gecko_strip_moz_prefix = gecko_strip_moz_prefix + self.gecko_strip_moz_prefix = True \ + if gecko_strip_moz_prefix is None else gecko_strip_moz_prefix self.gecko_inexhaustive = gecko_inexhaustive or (gecko_enum_prefix is None) def gecko_values(self): diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 6a08e9242b9..0f2027fe401 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -701,7 +701,7 @@ 'gecko_constant_prefix', 'gecko_enum_prefix', 'extra_gecko_values', 'extra_servo_values', 'aliases', 'extra_gecko_aliases', 'extra_servo_aliases', - 'custom_consts', 'gecko_inexhaustive', + 'custom_consts', 'gecko_inexhaustive', 'gecko_strip_moz_prefix', ]} %> diff --git a/components/style/properties/longhand/ui.mako.rs b/components/style/properties/longhand/ui.mako.rs index d4cdf0a5e43..41926a69bec 100644 --- a/components/style/properties/longhand/ui.mako.rs +++ b/components/style/properties/longhand/ui.mako.rs @@ -17,11 +17,13 @@ ${helpers.single_keyword("ime-mode", "auto normal active disabled inactive", spec="https://drafts.csswg.org/css-ui/#input-method-editor")} ${helpers.single_keyword("-moz-user-select", "auto text none all element elements" + - " toggle tri-state -moz-all -moz-none -moz-text", + " toggle tri-state -moz-all -moz-text", products="gecko", alias="-webkit-user-select", gecko_ffi_name="mUserSelect", gecko_enum_prefix="StyleUserSelect", + gecko_strip_moz_prefix=False, + aliases="-moz-none=none", animation_value_type="none", spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select")} diff --git a/tests/unit/style/parsing/ui.rs b/tests/unit/style/parsing/ui.rs index 14d96656b32..df62a90755b 100644 --- a/tests/unit/style/parsing/ui.rs +++ b/tests/unit/style/parsing/ui.rs @@ -20,8 +20,9 @@ fn test_moz_user_select() { assert_roundtrip_with_context!(_moz_user_select::parse, "toggle"); assert_roundtrip_with_context!(_moz_user_select::parse, "tri-state"); assert_roundtrip_with_context!(_moz_user_select::parse, "-moz-all"); - assert_roundtrip_with_context!(_moz_user_select::parse, "-moz-none"); assert_roundtrip_with_context!(_moz_user_select::parse, "-moz-text"); + assert_eq!(parse(_moz_user_select::parse, "-moz-none"), + Ok(_moz_user_select::SpecifiedValue::none)); assert!(parse(_moz_user_select::parse, "potato").is_err()); }