style: Style changes to support the 'page-orientation' property

Differential Revision: https://phabricator.services.mozilla.com/D161800
This commit is contained in:
Jonathan Watt 2023-01-16 15:03:44 +00:00 committed by Martin Robinson
parent 9e36918bf0
commit dd372eb5c2
7 changed files with 33 additions and 2 deletions

View file

@ -476,6 +476,7 @@ class Longhand(Property):
"OverflowClipBox", "OverflowClipBox",
"OverflowWrap", "OverflowWrap",
"OverscrollBehavior", "OverscrollBehavior",
"PageOrientation",
"Percentage", "Percentage",
"PrintColorAdjust", "PrintColorAdjust",
"Resize", "Resize",

View file

@ -29,3 +29,15 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-page-3/#using-named-pages", spec="https://drafts.csswg.org/css-page-3/#using-named-pages",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
${helpers.predefined_type(
"page-orientation",
"PageOrientation",
"computed::PageOrientation::Upright",
engines="gecko",
gecko_pref="layout.css.page-orientation.enabled",
initial_specified_value="specified::PageOrientation::Upright",
spec="https://drafts.csswg.org/css-page-3/#page-orientation-prop",
animation_value_type="none",
rule_types_allowed=PAGE_RULE,
)}

View file

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

View file

@ -11,6 +11,7 @@ use crate::values::generics::size::Size2D;
use crate::values::specified::page as specified; use crate::values::specified::page as specified;
pub use generics::page::GenericPageSize; pub use generics::page::GenericPageSize;
pub use generics::page::PageOrientation;
pub use generics::page::PageSizeOrientation; pub use generics::page::PageSizeOrientation;
pub use generics::page::PaperSize; pub use generics::page::PaperSize;
pub use specified::PageName; pub use specified::PageName;

View file

@ -70,6 +70,22 @@ impl PaperSize {
} }
} }
/// Page orientation names.
///
/// https://drafts.csswg.org/css-page-3/#page-orientation-prop
#[derive(
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToResolvedValue, ToShmem,
)]
#[repr(u8)]
pub enum PageOrientation {
/// upright
Upright,
/// rotate-left (counter-clockwise)
RotateLeft,
/// rotate-right (clockwise)
RotateRight,
}
/// Paper orientation /// Paper orientation
/// ///
/// https://drafts.csswg.org/css-page-3/#page-size-prop /// https://drafts.csswg.org/css-page-3/#page-size-prop

View file

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

View file

@ -11,6 +11,7 @@ use crate::values::{generics, CustomIdent};
use cssparser::Parser; use cssparser::Parser;
use style_traits::ParseError; use style_traits::ParseError;
pub use generics::page::PageOrientation;
pub use generics::page::PageSizeOrientation; pub use generics::page::PageSizeOrientation;
pub use generics::page::PaperSize; pub use generics::page::PaperSize;
/// Specified value of the @page size descriptor /// Specified value of the @page size descriptor