mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
style: Hide -moz- display values from content behind a pref.
Bug: 1288572 Reviewed-by: xidorn MozReview-Commit-ID: HDQPub043H1
This commit is contained in:
parent
1da798e65b
commit
cf7b10a32d
2 changed files with 22 additions and 3 deletions
|
@ -9,8 +9,6 @@
|
||||||
inherited=False,
|
inherited=False,
|
||||||
gecko_name="Display") %>
|
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
|
// 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.
|
// placeholder pseudo-element an inline-block in the UA stylesheet in Gecko.
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
|
@ -19,7 +17,6 @@ ${helpers.predefined_type(
|
||||||
"computed::Display::inline()",
|
"computed::Display::inline()",
|
||||||
initial_specified_value="specified::Display::inline()",
|
initial_specified_value="specified::Display::inline()",
|
||||||
animation_value_type="discrete",
|
animation_value_type="discrete",
|
||||||
needs_context=False,
|
|
||||||
flags="APPLIES_TO_PLACEHOLDER",
|
flags="APPLIES_TO_PLACEHOLDER",
|
||||||
spec="https://drafts.csswg.org/css-display/#propdef-display",
|
spec="https://drafts.csswg.org/css-display/#propdef-display",
|
||||||
servo_restyle_damage="rebuild_and_reflow"
|
servo_restyle_damage="rebuild_and_reflow"
|
||||||
|
|
|
@ -19,6 +19,17 @@ use values::generics::box_::VerticalAlign as GenericVerticalAlign;
|
||||||
use values::specified::{AllowQuirks, Number};
|
use values::specified::{AllowQuirks, Number};
|
||||||
use values::specified::length::{LengthOrPercentage, NonNegativeLength};
|
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)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
|
||||||
SpecifiedValueInfo, ToComputedValue, ToCss)]
|
SpecifiedValueInfo, ToComputedValue, ToCss)]
|
||||||
|
@ -69,26 +80,37 @@ pub enum Display {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
WebkitInlineBox,
|
WebkitInlineBox,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozBox,
|
MozBox,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozInlineBox,
|
MozInlineBox,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozGrid,
|
MozGrid,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozInlineGrid,
|
MozInlineGrid,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozGridGroup,
|
MozGridGroup,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozGridLine,
|
MozGridLine,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozStack,
|
MozStack,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozInlineStack,
|
MozInlineStack,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozDeck,
|
MozDeck,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozPopup,
|
MozPopup,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
|
#[css(parse_condition = "moz_display_values_enabled")]
|
||||||
MozGroupbox,
|
MozGroupbox,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue