From b05ace3e4a9df4af8973d5067dc32859c5ae5803 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 19 Jun 2018 20:12:45 +0100 Subject: [PATCH] style: Add a '-moz-menulist-button' value to '-moz-appearance'. The '-moz-menulist-button' value currently behavies identically to the 'menulist-button' value. This is not implemented as an alias because later patches in this patch series will change the behavior of our pre-existing 'menulist-button' value to more closely match what Chrome does. Bug: 1428676 Reviewed-by: emilio --- .../style/properties/longhands/box.mako.rs | 1 - components/style/values/specified/box.rs | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index ed08ac8504a..765731c13f2 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -515,7 +515,6 @@ ${helpers.predefined_type( products="gecko", alias="-webkit-appearance:layout.css.webkit-appearance.enabled", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)", - needs_context=False, animation_value_type="discrete", )} diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index afa88955d98..f1295fa5f0b 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -20,11 +20,16 @@ use values::specified::{AllowQuirks, Number}; use values::specified::length::{LengthOrPercentage, NonNegativeLength}; #[cfg(feature = "gecko")] -fn moz_display_values_enabled(context: &ParserContext) -> bool { - use gecko_bindings::structs; +fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool { use stylesheets::Origin; context.stylesheet_origin == Origin::UserAgent || - context.chrome_rules_enabled() || + context.chrome_rules_enabled() +} + +#[cfg(feature = "gecko")] +fn moz_display_values_enabled(context: &ParserContext) -> bool { + use gecko_bindings::structs; + in_ua_or_chrome_sheet(context) || unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_display_values_content_enabled } @@ -33,9 +38,7 @@ fn moz_display_values_enabled(context: &ParserContext) -> bool { #[cfg(feature = "gecko")] fn moz_box_display_values_enabled(context: &ParserContext) -> bool { use gecko_bindings::structs; - use stylesheets::Origin; - context.stylesheet_origin == Origin::UserAgent || - context.chrome_rules_enabled() || + in_ua_or_chrome_sheet(context) || unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_box_display_values_content_enabled } @@ -948,6 +951,9 @@ pub enum Appearance { Meterbar, /// The meter bar's meter indicator. Meterchunk, + /// The "arrowed" part of the dropdown button that open up a dropdown list. + #[parse(condition = "in_ua_or_chrome_sheet")] + MozMenulistButton, /// For HTML's NumberInput, /// A horizontal progress bar.