style: Swap order of values in 'overflow' shorthand property.

Differential Revision: https://phabricator.services.mozilla.com/D3069
This commit is contained in:
L. David Baron 2018-08-10 02:20:53 +00:00 committed by Emilio Cobos Álvarez
parent f14a3edd7d
commit 9206283f7e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -7,7 +7,7 @@
<%helpers:shorthand <%helpers:shorthand
name="overflow" name="overflow"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="overflow-x overflow-y" sub_properties="overflow-y overflow-x"
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow" spec="https://drafts.csswg.org/css-overflow/#propdef-overflow"
> >
use properties::longhands::overflow_x::parse as parse_overflow; use properties::longhands::overflow_x::parse as parse_overflow;
@ -52,9 +52,9 @@
} }
} }
% endif % endif
let overflow_x = parse_overflow(context, input)?; let overflow_y = parse_overflow(context, input)?;
let overflow_y = let overflow_x =
input.try(|i| parse_overflow(context, i)).unwrap_or(overflow_x); input.try(|i| parse_overflow(context, i)).unwrap_or(overflow_y);
Ok(expanded! { Ok(expanded! {
overflow_x: overflow_x, overflow_x: overflow_x,
overflow_y: overflow_y, overflow_y: overflow_y,
@ -63,10 +63,10 @@
impl<'a> ToCss for LonghandsToSerialize<'a> { impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
self.overflow_x.to_css(dest)?; self.overflow_y.to_css(dest)?;
if self.overflow_x != self.overflow_y { if self.overflow_x != self.overflow_y {
dest.write_char(' ')?; dest.write_char(' ')?;
self.overflow_y.to_css(dest)?; self.overflow_x.to_css(dest)?;
} }
Ok(()) Ok(())
} }