aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/properties/shorthands/position.mako.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/components/style/properties/shorthands/position.mako.rs b/components/style/properties/shorthands/position.mako.rs
index 471e67c0986..6d2b47d345f 100644
--- a/components/style/properties/shorthands/position.mako.rs
+++ b/components/style/properties/shorthands/position.mako.rs
@@ -9,7 +9,6 @@
servo_pref="layout.flexbox.enabled",
sub_properties="flex-direction flex-wrap"
extra_prefixes="webkit"
- derive_serialize="True"
spec="https://drafts.csswg.org/css-flexbox/#flex-flow-property">
use crate::properties::longhands::{flex_direction, flex_wrap};
@@ -43,6 +42,21 @@
flex_wrap: unwrap_or_initial!(flex_wrap, wrap),
})
}
+
+ impl<'a> ToCss for LonghandsToSerialize<'a> {
+ fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
+ if *self.flex_direction == flex_direction::get_initial_specified_value() &&
+ *self.flex_wrap != flex_wrap::get_initial_specified_value() {
+ return self.flex_wrap.to_css(dest)
+ }
+ self.flex_direction.to_css(dest)?;
+ if *self.flex_wrap != flex_wrap::get_initial_specified_value() {
+ dest.write_char(' ')?;
+ self.flex_wrap.to_css(dest)?;
+ }
+ Ok(())
+ }
+ }
</%helpers:shorthand>
<%helpers:shorthand name="flex"