mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Support offset-anchor.
Differential Revision: https://phabricator.services.mozilla.com/D39432
This commit is contained in:
parent
e04273a4d9
commit
33690b9eaf
6 changed files with 57 additions and 2 deletions
|
@ -41,6 +41,40 @@ impl<H, V> Position<H, V> {
|
|||
}
|
||||
}
|
||||
|
||||
/// A generic type for representing an `Auto | <position>`.
|
||||
/// This is used by <offset-anchor> for now.
|
||||
/// https://drafts.fxtf.org/motion-1/#offset-anchor-property
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
Parse,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C, u8)]
|
||||
pub enum GenericPositionOrAuto<Pos> {
|
||||
/// The <position> value.
|
||||
Position(Pos),
|
||||
/// The keyword `auto`.
|
||||
Auto,
|
||||
}
|
||||
|
||||
pub use self::GenericPositionOrAuto as PositionOrAuto;
|
||||
|
||||
impl<Pos> PositionOrAuto<Pos> {
|
||||
/// Return `auto`.
|
||||
#[inline]
|
||||
pub fn auto() -> Self {
|
||||
PositionOrAuto::Auto
|
||||
}
|
||||
}
|
||||
|
||||
/// A generic value for the `z-index` property.
|
||||
#[derive(
|
||||
Animate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue