mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: rustfmt recent changes.
This commit is contained in:
parent
069c0b06de
commit
1af30fa0c9
9 changed files with 62 additions and 23 deletions
|
@ -5,17 +5,16 @@
|
|||
//! Generic types for the handling of
|
||||
//! [grids](https://drafts.csswg.org/css-grid/).
|
||||
|
||||
use crate::{Atom, Zero};
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::specified;
|
||||
use crate::values::specified::grid::parse_line_names;
|
||||
use crate::values::{CSSFloat, CustomIdent};
|
||||
use crate::{Atom, Zero};
|
||||
use cssparser::Parser;
|
||||
use std::fmt::{self, Write};
|
||||
use std::{cmp, mem, usize};
|
||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||
|
||||
|
||||
/// These are the limits that we choose to clamp grid line numbers to.
|
||||
/// http://drafts.csswg.org/css-grid/#overlarge-grids
|
||||
/// line_num is clamped to this range at parse time.
|
||||
|
@ -146,7 +145,10 @@ impl Parse for GridLine<specified::Integer> {
|
|||
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
}
|
||||
|
||||
grid_line.line_num = specified::Integer::new(cmp::max(MIN_GRID_LINE, cmp::min(value, MAX_GRID_LINE)));
|
||||
grid_line.line_num = specified::Integer::new(cmp::max(
|
||||
MIN_GRID_LINE,
|
||||
cmp::min(value, MAX_GRID_LINE),
|
||||
));
|
||||
} else if let Ok(name) = input.try(|i| i.expect_ident_cloned()) {
|
||||
if val_before_span || grid_line.ident != atom!("") {
|
||||
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
|
@ -230,7 +232,16 @@ impl<L> TrackBreadth<L> {
|
|||
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
|
||||
///
|
||||
/// cbindgen:derive-tagged-enum-copy-constructor=true
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C, u8)]
|
||||
pub enum GenericTrackSize<L> {
|
||||
/// A flexible `<track-breadth>`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue