style: Turn the CSS flexible box model on by default.

See
https://groups.google.com/forum/#!topic/mozilla.dev.servo/MWBms2_BMJo
for discussion.
This commit is contained in:
Patrick Walton 2016-10-04 16:16:58 -07:00 committed by Anthony Ramine
parent f1c3e97fb4
commit 05f738409e
18 changed files with 6 additions and 62 deletions

View file

@ -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;
@ -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

View file

@ -66,15 +66,14 @@
// 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)}
@ -82,14 +81,12 @@ ${helpers.single_keyword("justify-content", "flex-start flex-end center space-be
// 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)}
@ -97,14 +94,13 @@ ${helpers.single_keyword("align-content", "stretch flex-start flex-end center sp
// 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)}

View file

@ -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, ()> {
@ -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};

View file

@ -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,

View file

@ -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,

View file

@ -1,3 +0,0 @@
[flex-order.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-align-self-baseline-horiz-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-align-self-horiz-005.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-overflow-horiz-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-overflow-horiz-004.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-overflow-horiz-005.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-root-node-001a.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-root-node-001b.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-whitespace-handling-002.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-with-pseudo-elements-001.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-with-pseudo-elements-002.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox-with-pseudo-elements-003.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[flexbox_absolute-atomic.htm]
type: reftest
expected: FAIL