mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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:
parent
45d6e64d51
commit
c2a50c92fa
3 changed files with 21 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue