Skip to content

Commit

Permalink
style: Turn the CSS flexible box model on by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton authored and nox committed Nov 8, 2016
1 parent f1c3e97 commit 05f7384
Show file tree
Hide file tree
Showing 18 changed files with 6 additions and 62 deletions.
7 changes: 0 additions & 7 deletions components/style/properties/longhand/box.mako.rs
Expand Up @@ -23,7 +23,6 @@
""".split()
if product == "gecko":
values += "-moz-box -moz-inline-box".split()
experimental_values = set("flex".split())
%>
pub use self::computed_value::T as SpecifiedValue;
use values::computed::ComputedValueAsSpecified;
Expand Down Expand Up @@ -61,12 +60,6 @@
match_ignore_ascii_case! { try!(input.expect_ident()),
% for value in values:
"${value}" => {
% if value in experimental_values and product == "servo":
if !::util::prefs::PREFS.get("layout.${value}.enabled")
.as_boolean().unwrap_or(false) {
return Err(())
}
% endif
Ok(computed_value::T::${to_rust_ident(value)})
},
% endfor
Expand Down
12 changes: 4 additions & 8 deletions components/style/properties/longhand/position.mako.rs
Expand Up @@ -66,45 +66,41 @@

// Flex container properties
${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse",
experimental=True, animatable=False)}
animatable=False)}

${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
experimental=True, animatable=False)}
animatable=False)}

// FIXME(stshine): The type of 'justify-content' and 'align-content' is uint16_t in gecko
// FIXME(stshine): Its higher bytes are used to store fallback value. Disable them in geckolib for now
${helpers.single_keyword("justify-content", "flex-start flex-end center space-between space-around",
experimental=True,
gecko_constant_prefix="NS_STYLE_JUSTIFY",
products="servo",
animatable=False)}

// FIXME(heycam): Disable align-items in geckolib since we don't support the Gecko initial value
// 'normal' yet.
${helpers.single_keyword("align-items", "stretch flex-start flex-end center baseline",
experimental=True,
need_clone=True,
gecko_constant_prefix="NS_STYLE_ALIGN",
animatable=False,
products="servo")}

${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around",
experimental=True,
gecko_constant_prefix="NS_STYLE_ALIGN",
products="servo",
animatable=False)}

// Flex item properties
${helpers.predefined_type("flex-grow", "Number",
"0.0", "parse_non_negative",
experimental=True, animatable=True)}
animatable=True)}

${helpers.predefined_type("flex-shrink", "Number",
"1.0", "parse_non_negative",
experimental=True, animatable=True)}
animatable=True)}

${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center baseline",
experimental=True,
need_clone=True,
gecko_constant_prefix="NS_STYLE_ALIGN",
animatable=False)}
Expand Down
6 changes: 2 additions & 4 deletions components/style/properties/shorthand/position.mako.rs
Expand Up @@ -5,8 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" />

// https://drafts.csswg.org/css-flexbox/#flex-flow-property
<%helpers:shorthand name="flex-flow" sub_properties="flex-direction flex-wrap"
experimental="True">
<%helpers:shorthand name="flex-flow" sub_properties="flex-direction flex-wrap">
use properties::longhands::{flex_direction, flex_wrap};

pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
Expand Down Expand Up @@ -56,8 +55,7 @@
</%helpers:shorthand>

// https://drafts.csswg.org/css-flexbox/#flex-property
<%helpers:shorthand name="flex" sub_properties="flex-grow flex-shrink flex-basis"
experimental="True">
<%helpers:shorthand name="flex" sub_properties="flex-grow flex-shrink flex-basis">
use app_units::Au;
use values::specified::{Number, Length, LengthOrPercentageOrAutoOrContent};

Expand Down
2 changes: 0 additions & 2 deletions resources/package-prefs.json
Expand Up @@ -49,8 +49,6 @@
"layout.column-gap.enabled": false,
"layout.column-width.enabled": false,
"layout.columns.enabled": false,
"layout.flex-direction.enabled": false,
"layout.flex.enabled": false,
"layout.text-orientation.enabled": false,
"layout.viewport.enabled": false,
"layout.writing-mode.enabled": false,
Expand Down
2 changes: 0 additions & 2 deletions resources/prefs.json
Expand Up @@ -50,8 +50,6 @@
"layout.column-gap.enabled": false,
"layout.column-width.enabled": false,
"layout.columns.enabled": false,
"layout.flex-direction.enabled": false,
"layout.flex.enabled": false,
"layout.text-orientation.enabled": false,
"layout.viewport.enabled": false,
"layout.writing-mode.enabled": false,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 05f7384

Please sign in to comment.