style: Remove the paper size variant of GenericPageSize and add an implied default to the paper size and orientation variant

Differential Revision: https://phabricator.services.mozilla.com/D119915
This commit is contained in:
Emily McDonough 2023-05-22 10:09:22 +02:00 committed by Oriol Brufau
parent 45d6e64d51
commit c2a50c92fa
3 changed files with 21 additions and 20 deletions

View file

@ -94,22 +94,25 @@ pub enum Orientation {
Landscape,
}
#[inline]
fn is_portrait(orientation: &Orientation) -> bool {
*orientation == Orientation::Portrait
}
/// Page size property
///
/// https://drafts.csswg.org/css-page-3/#page-size-prop
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
#[repr(C, u8)]
pub enum GenericPageSize<S> {
/// Page dimensions.
Size(S),
/// Paper size with no orientation.
PaperSize(PaperSize),
/// An orientation with no size.
Orientation(Orientation),
/// Paper size by name, with an orientation.
PaperSizeAndOrientation(PaperSize, Orientation),
/// `auto` value.
Auto,
/// Page dimensions.
Size(S),
/// An orientation with no size.
Orientation(Orientation),
/// Paper size by name
PaperSize(PaperSize, #[css(skip_if = "is_portrait")] Orientation),
}
pub use self::GenericPageSize as PageSize;