mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue