зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #14111 - style: Turn the CSS flexible box model on by default (from servo:pcwalton-turn-flexbox-on); r=emilio,jdm
Source-Repo: https://github.com/servo/servo Source-Revision: c4bd2027b723df9a999b25917ebb293acf9f722c
This commit is contained in:
Родитель
c8c928d000
Коммит
1878ef834a
|
@ -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};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче