style: Rename page::PageOrientation to page::PageSizeOrientation

The @page rule may contain both 'page-orientation' and 'size' properties. The
'size' property can contain an orientation component which was being
represented as 'PageOrientation' prior to this patch. This patch changes that
to 'PageSizeOrientation' so that 'PageOrientation' can be used for
'page-orientation' in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D160790
This commit is contained in:
Jonathan Watt 2022-10-31 22:52:16 +00:00 committed by Martin Robinson
parent b2ab136cd9
commit 2c1799a8df
5 changed files with 15 additions and 15 deletions

View file

@ -72,7 +72,7 @@ pub use self::list::ListStyleType;
pub use self::list::Quotes;
pub use self::motion::{OffsetPath, OffsetRotate};
pub use self::outline::OutlineStyle;
pub use self::page::{PageName, PageOrientation, PageSize, PaperSize};
pub use self::page::{PageName, PageSize, PageSizeOrientation, PaperSize};
pub use self::percentage::{NonNegativePercentage, Percentage};
pub use self::position::AspectRatio;
pub use self::position::{

View file

@ -11,7 +11,7 @@ use crate::values::{generics, CustomIdent};
use cssparser::Parser;
use style_traits::ParseError;
pub use generics::page::PageOrientation;
pub use generics::page::PageSizeOrientation;
pub use generics::page::PaperSize;
/// Specified value of the @page size descriptor
pub type PageSize = generics::page::PageSize<Size2D<NonNegativeLength>>;
@ -24,12 +24,12 @@ impl Parse for PageSize {
// Try to parse as <page-size> [ <orientation> ]
if let Ok(paper_size) = input.try_parse(PaperSize::parse) {
let orientation = input
.try_parse(PageOrientation::parse)
.unwrap_or(PageOrientation::Portrait);
.try_parse(PageSizeOrientation::parse)
.unwrap_or(PageSizeOrientation::Portrait);
return Ok(PageSize::PaperSize(paper_size, orientation));
}
// Try to parse as <orientation> [ <page-size> ]
if let Ok(orientation) = input.try_parse(PageOrientation::parse) {
if let Ok(orientation) = input.try_parse(PageSizeOrientation::parse) {
if let Ok(paper_size) = input.try_parse(PaperSize::parse) {
return Ok(PageSize::PaperSize(paper_size, orientation));
}