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

@ -36,16 +36,14 @@ impl ToComputedValue for specified::PageSize {
fn to_computed_value(&self, ctx: &Context) -> Self::ComputedValue {
match &*self {
Self::Size(s) => PageSize::Size(s.to_computed_value(ctx)),
Self::PaperSizeAndOrientation(p, Orientation::Landscape) => PageSize::Size(Size2D {
Self::PaperSize(p, Orientation::Landscape) => PageSize::Size(Size2D {
width: p.long_edge().to_computed_value(ctx),
height: p.short_edge().to_computed_value(ctx),
}),
Self::PaperSizeAndOrientation(p, Orientation::Portrait) | Self::PaperSize(p) => {
PageSize::Size(Size2D {
width: p.short_edge().to_computed_value(ctx),
height: p.long_edge().to_computed_value(ctx),
})
},
Self::PaperSize(p, Orientation::Portrait) => PageSize::Size(Size2D {
width: p.short_edge().to_computed_value(ctx),
height: p.long_edge().to_computed_value(ctx),
}),
Self::Orientation(o) => PageSize::Orientation(*o),
Self::Auto => PageSize::Auto,
}