mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Make some grid/grid-template values serialize to a shorter form.
Differential Revision: https://phabricator.services.mozilla.com/D53913
This commit is contained in:
parent
014c41f54a
commit
70ec6ffe36
3 changed files with 62 additions and 20 deletions
|
@ -102,8 +102,8 @@ impl Parse for ImplicitGridTracks<TrackSize<LengthPercentage>> {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
use style_traits::{Separator, Space};
|
||||
let track_sizes = Space::parse(input, |i| TrackSize::parse(context, i))?;
|
||||
if track_sizes.len() == 1 && track_sizes[0].is_auto() {
|
||||
//`auto`, which is the initial value, is always represented by an empty slice.
|
||||
if track_sizes.len() == 1 && track_sizes[0].is_initial() {
|
||||
// A single track with the initial value is always represented by an empty slice.
|
||||
return Ok(Default::default());
|
||||
}
|
||||
return Ok(ImplicitGridTracks(track_sizes.into()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue