mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Serialization differences with "columns" with one or more auto
value
Differential Revision: https://phabricator.services.mozilla.com/D166087
This commit is contained in:
parent
2edc1139b6
commit
e38d2369c5
1 changed files with 14 additions and 1 deletions
|
@ -8,7 +8,6 @@
|
|||
engines="gecko servo"
|
||||
sub_properties="column-width column-count"
|
||||
servo_pref="layout.columns.enabled"
|
||||
derive_serialize="True"
|
||||
spec="https://drafts.csswg.org/css-multicol/#propdef-columns">
|
||||
use crate::properties::longhands::{column_count, column_width};
|
||||
|
||||
|
@ -54,6 +53,20 @@
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToCss for LonghandsToSerialize<'a> {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
|
||||
if self.column_width.is_auto() {
|
||||
return self.column_count.to_css(dest)
|
||||
}
|
||||
self.column_width.to_css(dest)?;
|
||||
if !self.column_count.is_auto() {
|
||||
dest.write_char(' ')?;
|
||||
self.column_count.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
</%helpers:shorthand>
|
||||
|
||||
<%helpers:shorthand
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue