diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 82e609c44e9..6c388d1efbd 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -9,8 +9,6 @@ inherited=False, gecko_name="Display") %> -// TODO(SimonSapin): don't parse `inline-table`, since we don't support it -// // We allow "display" to apply to placeholders because we need to make the // placeholder pseudo-element an inline-block in the UA stylesheet in Gecko. ${helpers.predefined_type( @@ -19,7 +17,6 @@ ${helpers.predefined_type( "computed::Display::inline()", initial_specified_value="specified::Display::inline()", animation_value_type="discrete", - needs_context=False, flags="APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-display/#propdef-display", servo_restyle_damage="rebuild_and_reflow" diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 3caee1e7f08..bece7115c17 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -19,6 +19,17 @@ use values::generics::box_::VerticalAlign as GenericVerticalAlign; 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; + use stylesheets::Origin; + context.stylesheet_origin == Origin::UserAgent || + context.chrome_rules_enabled() || + unsafe { + structs::StaticPrefs_sVarCache_layout_css_xul_display_values_content_enabled + } +} + #[allow(missing_docs)] #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)] @@ -69,26 +80,37 @@ pub enum Display { #[cfg(feature = "gecko")] WebkitInlineBox, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozBox, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozInlineBox, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozGrid, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozInlineGrid, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozGridGroup, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozGridLine, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozStack, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozInlineStack, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozDeck, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozPopup, #[cfg(feature = "gecko")] + #[css(parse_condition = "moz_display_values_enabled")] MozGroupbox, }