mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
parent
f1c3e97fb4
commit
05f738409e
18 changed files with 6 additions and 62 deletions
|
@ -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
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue